summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java
diff options
context:
space:
mode:
authorStephan Wunderlich <sw@openoffice.org>2003-01-27 17:20:08 +0000
committerStephan Wunderlich <sw@openoffice.org>2003-01-27 17:20:08 +0000
commit26ebdfc472be16f0eb4110aab0335666d2ba5e62 (patch)
tree89b1b245105889ab56b358ce8d2edecee7f009dc /qadevOOo/tests/java
parentc1b610e51c2f678a8adb7c4c265aafb7e1aeb8e1 (diff)
NEW: initial version
Diffstat (limited to 'qadevOOo/tests/java')
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessible.java97
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleAction.java203
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java524
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleContext.java294
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleEditableText.java582
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java239
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleExtendedComponent.java166
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleImage.java114
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java462
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleTable.java1050
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java1024
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java355
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java157
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlCheckBoxModel.java133
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java161
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlContainerModel.java107
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlCurrencyFieldModel.java144
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlDateFieldModel.java195
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlDialogElement.java69
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlDialogModel.java110
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlEditModel.java153
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlFileControlModel.java140
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlFixedLineModel.java99
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlFixedTextModel.java134
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlFormattedFieldModel.java259
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlGroupBoxModel.java120
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlImageControlModel.java118
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlListBoxModel.java149
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlModel.java69
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlNumericFieldModel.java144
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlPatternFieldModel.java127
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlProgressBarModel.java125
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlRadioButtonModel.java131
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlScrollBarModel.java114
-rw-r--r--qadevOOo/tests/java/ifc/awt/_UnoControlTimeFieldModel.java160
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XButton.java151
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XCheckBox.java183
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XComboBox.java324
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XControl.java261
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XControlContainer.java175
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XCurrencyField.java345
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XDataTransferProviderAccess.java168
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XDateField.java369
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XDialog.java191
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XFixedText.java153
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XItemListener.java152
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XLayoutConstrains.java110
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XListBox.java553
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XNumericField.java345
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XPatternField.java209
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XRadioButton.java186
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XSpinField.java249
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTabController.java201
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTabControllerModel.java201
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTextComponent.java295
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTextLayoutConstrains.java113
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTextListener.java161
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTimeField.java324
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XToolkit.java184
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTopWindow.java236
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XView.java169
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XWindow.java644
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java271
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XIntrospection.java95
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java383
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java252
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XPropertySet.java641
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XPropertySetInfo.java160
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XPropertyState.java279
-rw-r--r--qadevOOo/tests/java/ifc/bridge/_XBridge.java181
-rw-r--r--qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java264
-rw-r--r--qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java244
-rw-r--r--qadevOOo/tests/java/ifc/chart/_BarDiagram.java193
-rw-r--r--qadevOOo/tests/java/ifc/chart/_Chart3DBarProperties.java131
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartAxis.java231
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartAxisXSupplier.java175
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartAxisYSupplier.java200
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartAxisZSupplier.java237
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartDataPointProperties.java149
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartDataRowProperties.java97
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartDocument.java78
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartLegend.java76
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartStatistics.java107
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartTableAddressSupplier.java101
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartTitle.java92
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartTwoAxisXSupplier.java141
-rw-r--r--qadevOOo/tests/java/ifc/chart/_ChartTwoAxisYSupplier.java141
-rw-r--r--qadevOOo/tests/java/ifc/chart/_Diagram.java101
-rw-r--r--qadevOOo/tests/java/ifc/chart/_Dim3DDiagram.java100
-rw-r--r--qadevOOo/tests/java/ifc/chart/_LineDiagram.java228
-rw-r--r--qadevOOo/tests/java/ifc/chart/_StackableDiagram.java122
-rw-r--r--qadevOOo/tests/java/ifc/chart/_StockDiagram.java120
-rw-r--r--qadevOOo/tests/java/ifc/chart/_X3DDisplay.java110
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XAxisXSupplier.java139
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XAxisYSupplier.java142
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XAxisZSupplier.java142
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XChartData.java200
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XChartDataArray.java234
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XChartDocument.java197
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XDiagram.java189
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XStatisticDisplay.java124
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XTwoAxisXSupplier.java96
-rw-r--r--qadevOOo/tests/java/ifc/chart/_XTwoAxisYSupplier.java104
-rw-r--r--qadevOOo/tests/java/ifc/connection/_XAcceptor.java353
-rw-r--r--qadevOOo/tests/java/ifc/connection/_XConnector.java230
-rw-r--r--qadevOOo/tests/java/ifc/container/_XChild.java124
-rw-r--r--qadevOOo/tests/java/ifc/container/_XContainer.java348
-rw-r--r--qadevOOo/tests/java/ifc/container/_XContentEnumerationAccess.java128
-rw-r--r--qadevOOo/tests/java/ifc/container/_XElementAccess.java102
-rw-r--r--qadevOOo/tests/java/ifc/container/_XEnumeration.java166
-rw-r--r--qadevOOo/tests/java/ifc/container/_XEnumerationAccess.java90
-rw-r--r--qadevOOo/tests/java/ifc/container/_XHierarchicalNameAccess.java125
-rw-r--r--qadevOOo/tests/java/ifc/container/_XIndexAccess.java201
-rw-r--r--qadevOOo/tests/java/ifc/container/_XIndexContainer.java243
-rw-r--r--qadevOOo/tests/java/ifc/container/_XIndexReplace.java244
-rw-r--r--qadevOOo/tests/java/ifc/container/_XNameAccess.java196
-rw-r--r--qadevOOo/tests/java/ifc/container/_XNameContainer.java295
-rw-r--r--qadevOOo/tests/java/ifc/container/_XNameReplace.java197
-rw-r--r--qadevOOo/tests/java/ifc/container/_XNamed.java193
-rw-r--r--qadevOOo/tests/java/ifc/container/_XSet.java183
-rw-r--r--qadevOOo/tests/java/ifc/datatransfer/_XDataFormatTranslator.java110
-rw-r--r--qadevOOo/tests/java/ifc/datatransfer/_XMimeContentTypeFactory.java127
-rw-r--r--qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboard.java179
-rw-r--r--qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardEx.java88
-rw-r--r--qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardNotifier.java208
-rw-r--r--qadevOOo/tests/java/ifc/datatransfer/clipboard/_XFlushableClipboard.java89
-rw-r--r--qadevOOo/tests/java/ifc/document/_DocumentInfo.java185
-rw-r--r--qadevOOo/tests/java/ifc/document/_ExportFilter.java85
-rw-r--r--qadevOOo/tests/java/ifc/document/_ImportFilter.java86
-rw-r--r--qadevOOo/tests/java/ifc/document/_OfficeDocument.java79
-rw-r--r--qadevOOo/tests/java/ifc/document/_XActionLockable.java142
-rw-r--r--qadevOOo/tests/java/ifc/document/_XDocumentInfo.java261
-rw-r--r--qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java207
-rw-r--r--qadevOOo/tests/java/ifc/document/_XEmbeddedObjectSupplier.java89
-rw-r--r--qadevOOo/tests/java/ifc/document/_XEventsSupplier.java93
-rw-r--r--qadevOOo/tests/java/ifc/document/_XExporter.java123
-rw-r--r--qadevOOo/tests/java/ifc/document/_XFilter.java217
-rw-r--r--qadevOOo/tests/java/ifc/document/_XImporter.java110
-rw-r--r--qadevOOo/tests/java/ifc/document/_XLinkTargetSupplier.java92
-rw-r--r--qadevOOo/tests/java/ifc/document/_XMimeTypeInfo.java124
-rw-r--r--qadevOOo/tests/java/ifc/document/_XStandaloneDocumentInfo.java164
-rw-r--r--qadevOOo/tests/java/ifc/document/_XTypeDetection.java138
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_ConnectorProperties.java82
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_ConnectorShape.java111
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_DrawingDocument.java79
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java186
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_EllipseShape.java80
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_FillProperties.java225
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_GenericDrawPage.java130
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java190
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_Layer.java81
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_LineProperties.java111
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_MeasureProperties.java94
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_MeasureShape.java80
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_PolyPolygonBezierDescriptor.java81
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_PolyPolygonDescriptor.java81
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java137
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_ShadowProperties.java82
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_Shape.java153
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_TextProperties.java101
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_TextShape.java78
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XControlShape.java139
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java119
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPageExpander.java107
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPageSummarizer.java107
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPages.java127
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPagesSupplier.java97
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawView.java139
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XGluePointsSupplier.java97
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XLayerManager.java199
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java103
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XMasterPageTarget.java141
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XMasterPagesSupplier.java96
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShape.java219
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java142
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java143
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java129
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeGroup.java103
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java143
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapes.java142
-rw-r--r--qadevOOo/tests/java/ifc/form/_DataAwareControlModel.java202
-rw-r--r--qadevOOo/tests/java/ifc/form/_FormComponent.java77
-rw-r--r--qadevOOo/tests/java/ifc/form/_FormControlModel.java79
-rw-r--r--qadevOOo/tests/java/ifc/form/_XApproveActionBroadcaster.java143
-rw-r--r--qadevOOo/tests/java/ifc/form/_XBoundComponent.java91
-rw-r--r--qadevOOo/tests/java/ifc/form/_XBoundControl.java115
-rw-r--r--qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java234
-rw-r--r--qadevOOo/tests/java/ifc/form/_XFormController.java206
-rw-r--r--qadevOOo/tests/java/ifc/form/_XFormsSupplier.java78
-rw-r--r--qadevOOo/tests/java/ifc/form/_XGrid.java116
-rw-r--r--qadevOOo/tests/java/ifc/form/_XGridColumnFactory.java113
-rw-r--r--qadevOOo/tests/java/ifc/form/_XGridFieldDataSupplier.java101
-rw-r--r--qadevOOo/tests/java/ifc/form/_XImageProducerSupplier.java94
-rw-r--r--qadevOOo/tests/java/ifc/form/_XLoadListener.java127
-rw-r--r--qadevOOo/tests/java/ifc/form/_XLoadable.java276
-rw-r--r--qadevOOo/tests/java/ifc/form/_XReset.java227
-rw-r--r--qadevOOo/tests/java/ifc/form/_XSubmit.java215
-rw-r--r--qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java281
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_CheckBox.java78
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_ComboBox.java77
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_CommandButton.java79
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_CurrencyField.java93
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DataForm.java123
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseComboBox.java80
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseFormattedField.java78
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseImageControl.java78
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseListBox.java80
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabasePatternField.java79
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DatabaseTextField.java79
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_DateField.java90
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_FileControl.java78
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_GridControl.java123
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_HTMLForm.java81
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_HiddenControl.java78
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_ImageButton.java80
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_ListBox.java80
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_NumericField.java92
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_PatternField.java78
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_RadioButton.java80
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_TextField.java78
-rw-r--r--qadevOOo/tests/java/ifc/form/component/_TimeField.java92
-rw-r--r--qadevOOo/tests/java/ifc/formula/_FormulaProperties.java133
-rw-r--r--qadevOOo/tests/java/ifc/frame/_Frame.java69
-rw-r--r--qadevOOo/tests/java/ifc/frame/_SynchronousFrameLoader.java79
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XComponentLoader.java188
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XController.java259
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDesktop.java155
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDispatch.java207
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDispatchProvider.java199
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDispatchProviderInterception.java174
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java225
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java284
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java306
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XFrame.java561
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XFrameLoader.java242
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XFramesSupplier.java226
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XModel.java278
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XStorable.java256
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java212
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XTasksSupplier.java136
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java714
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XCalendar.java550
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XCharacterClassification.java447
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XCollator.java462
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XIndexEntrySupplier.java138
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XLocaleData.java531
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XNumberFormatCode.java196
-rw-r--r--qadevOOo/tests/java/ifc/i18n/_XTransliteration.java523
-rw-r--r--qadevOOo/tests/java/ifc/io/_XActiveDataControl.java282
-rw-r--r--qadevOOo/tests/java/ifc/io/_XActiveDataSink.java144
-rw-r--r--qadevOOo/tests/java/ifc/io/_XActiveDataSource.java137
-rw-r--r--qadevOOo/tests/java/ifc/io/_XConnectable.java165
-rw-r--r--qadevOOo/tests/java/ifc/io/_XDataInputStream.java453
-rw-r--r--qadevOOo/tests/java/ifc/io/_XDataOutputStream.java314
-rw-r--r--qadevOOo/tests/java/ifc/io/_XInputStream.java280
-rw-r--r--qadevOOo/tests/java/ifc/io/_XMarkableStream.java230
-rw-r--r--qadevOOo/tests/java/ifc/io/_XObjectInputStream.java207
-rw-r--r--qadevOOo/tests/java/ifc/io/_XObjectOutputStream.java128
-rw-r--r--qadevOOo/tests/java/ifc/io/_XOutputStream.java207
-rw-r--r--qadevOOo/tests/java/ifc/io/_XPersistObject.java305
-rw-r--r--qadevOOo/tests/java/ifc/java/_XJavaThreadRegister_11.java103
-rw-r--r--qadevOOo/tests/java/ifc/java/_XJavaVM.java103
-rw-r--r--qadevOOo/tests/java/ifc/lang/_ServiceManager.java88
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XComponent.java191
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XEventListener.java95
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XInitialization.java118
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XMultiComponentFactory.java153
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XMultiServiceFactory.java199
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XServiceDisplayName.java92
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XServiceInfo.java130
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java201
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XTypeProvider.java126
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_LinguProperties.java95
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XDictionaryList.java328
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XHyphenator.java144
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XLinguServiceEventBroadcaster.java127
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XLinguServiceManager.java218
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XSearchableDictionaryList.java107
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XSpellChecker.java128
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java122
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XThesaurus.java105
-rw-r--r--qadevOOo/tests/java/ifc/loader/_XImplementationLoader.java220
-rw-r--r--qadevOOo/tests/java/ifc/presentation/_OutlineView.java70
-rw-r--r--qadevOOo/tests/java/ifc/presentation/_Presentation.java125
-rw-r--r--qadevOOo/tests/java/ifc/presentation/_PresentationView.java91
-rw-r--r--qadevOOo/tests/java/ifc/presentation/_XCustomPresentationSupplier.java91
-rw-r--r--qadevOOo/tests/java/ifc/presentation/_XPresentation.java116
-rw-r--r--qadevOOo/tests/java/ifc/presentation/_XPresentationSupplier.java91
-rw-r--r--qadevOOo/tests/java/ifc/reflection/_XIdlReflection.java139
-rw-r--r--qadevOOo/tests/java/ifc/reflection/_XProxyFactory.java130
-rw-r--r--qadevOOo/tests/java/ifc/reflection/_XTypeDescriptionEnumerationAccess.java128
-rw-r--r--qadevOOo/tests/java/ifc/registry/_XImplementationRegistration.java234
-rw-r--r--qadevOOo/tests/java/ifc/registry/_XSimpleRegistry.java401
-rw-r--r--qadevOOo/tests/java/ifc/script/_XEventAttacherManager.java531
-rw-r--r--qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java142
-rw-r--r--qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java144
-rw-r--r--qadevOOo/tests/java/ifc/script/_XTypeConverter.java155
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_DataSource.java205
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_DatasourceAdministrationDialog.java79
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_ErrorMessageDialog.java100
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_QueryDefinition.java89
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_RowSet.java172
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XBookmarksSupplier.java93
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XCompletedConnection.java117
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XQueryDefinitionsSupplier.java102
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XResultSetAccess.java102
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XRowSetApproveBroadcaster.java248
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_ResultSet.java83
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_RowSet.java90
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XCloseable.java127
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XColumnLocate.java118
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XDataSource.java147
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XDriver.java246
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XDriverManager.java194
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XIsolatedConnection.java156
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XParameters.java602
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XResultSet.java538
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XResultSetMetaDataSupplier.java102
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XResultSetUpdate.java296
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XRow.java576
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XRowSet.java226
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java726
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XWarningsSupplier.java161
-rw-r--r--qadevOOo/tests/java/ifc/sdbcx/_ResultSet.java94
-rw-r--r--qadevOOo/tests/java/ifc/sdbcx/_XColumnsSupplier.java113
-rw-r--r--qadevOOo/tests/java/ifc/sdbcx/_XCreateCatalog.java82
-rw-r--r--qadevOOo/tests/java/ifc/sdbcx/_XDataDefinitionSupplier.java211
-rw-r--r--qadevOOo/tests/java/ifc/sdbcx/_XDeleteRows.java127
-rw-r--r--qadevOOo/tests/java/ifc/sdbcx/_XDropCatalog.java82
-rw-r--r--qadevOOo/tests/java/ifc/sdbcx/_XRowLocate.java269
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_CellAreaLink.java82
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_DataPilotField.java79
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_DatabaseRange.java82
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_GlobalSheetSettings.java90
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_SheetCell.java72
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_SheetCellRange.java78
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_SheetCellRanges.java67
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_SheetFilterDescriptor.java86
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_SheetLink.java119
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_Spreadsheet.java98
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocument.java84
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java174
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_SpreadsheetViewSettings.java107
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_SubTotalDescriptor.java83
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_TableAutoFormat.java83
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_TableAutoFormatField.java164
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_TableValidation.java86
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XAreaLink.java192
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XAreaLinks.java140
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XArrayFormulaRange.java210
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XCellAddressable.java92
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XCellRangeAddressable.java90
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XCellRangeData.java108
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XCellRangeFormula.java105
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java279
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java136
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XConsolidationDescriptor.java297
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XDDELink.java144
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java462
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XDataPilotTable.java138
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XDataPilotTables.java190
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XDataPilotTablesSupplier.java92
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XDatabaseRange.java277
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XDatabaseRanges.java154
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XFunctionDescriptions.java163
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XHeaderFooterContent.java115
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XLabelRange.java142
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XLabelRanges.java130
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XNamedRange.java241
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java359
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java202
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XScenarios.java121
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XScenariosSupplier.java89
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java174
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor.java166
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetAnnotations.java123
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationsSupplier.java91
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java436
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetCellRange.java90
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetCellRangeContainer.java238
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetCellRanges.java122
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetCondition.java191
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetConditionalEntries.java170
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetConditionalEntry.java108
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetFilterDescriptor.java115
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetOperation.java137
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSheetPageBreak.java126
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSpreadsheet.java123
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument.java92
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSpreadsheetView.java125
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSpreadsheets.java217
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSubTotalDescriptor.java108
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XSubTotalField.java148
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XUsedAreaCursor.java171
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XViewFreezable.java111
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XViewPane.java166
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XViewSplitable.java169
-rw-r--r--qadevOOo/tests/java/ifc/style/_CharacterProperties.java425
-rw-r--r--qadevOOo/tests/java/ifc/style/_CharacterPropertiesAsian.java112
-rw-r--r--qadevOOo/tests/java/ifc/style/_CharacterPropertiesComplex.java87
-rw-r--r--qadevOOo/tests/java/ifc/style/_ParagraphProperties.java345
-rw-r--r--qadevOOo/tests/java/ifc/style/_ParagraphPropertiesAsian.java80
-rw-r--r--qadevOOo/tests/java/ifc/style/_ParagraphPropertiesComplex.java89
-rw-r--r--qadevOOo/tests/java/ifc/style/_Style.java82
-rw-r--r--qadevOOo/tests/java/ifc/style/_XStyle.java150
-rw-r--r--qadevOOo/tests/java/ifc/style/_XStyleFamiliesSupplier.java88
-rw-r--r--qadevOOo/tests/java/ifc/system/_XProxySettings.java337
-rw-r--r--qadevOOo/tests/java/ifc/system/_XSimpleMailClientSupplier.java109
-rw-r--r--qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java163
-rw-r--r--qadevOOo/tests/java/ifc/table/_CellProperties.java140
-rw-r--r--qadevOOo/tests/java/ifc/table/_TableColumn.java107
-rw-r--r--qadevOOo/tests/java/ifc/table/_TableRow.java81
-rw-r--r--qadevOOo/tests/java/ifc/table/_XAutoFormattable.java149
-rw-r--r--qadevOOo/tests/java/ifc/table/_XCell.java200
-rw-r--r--qadevOOo/tests/java/ifc/table/_XCellCursor.java280
-rw-r--r--qadevOOo/tests/java/ifc/table/_XCellRange.java177
-rw-r--r--qadevOOo/tests/java/ifc/table/_XColumnRowRange.java99
-rw-r--r--qadevOOo/tests/java/ifc/table/_XTableChart.java158
-rw-r--r--qadevOOo/tests/java/ifc/table/_XTableCharts.java127
-rw-r--r--qadevOOo/tests/java/ifc/table/_XTableChartsSupplier.java93
-rw-r--r--qadevOOo/tests/java/ifc/table/_XTableColumns.java426
-rw-r--r--qadevOOo/tests/java/ifc/table/_XTableRows.java138
-rw-r--r--qadevOOo/tests/java/ifc/task/_XInteractionHandler.java184
-rw-r--r--qadevOOo/tests/java/ifc/task/_XJobExecutor.java112
-rw-r--r--qadevOOo/tests/java/ifc/task/_XStatusIndicatorFactory.java111
-rw-r--r--qadevOOo/tests/java/ifc/text/_BaseFrame.java159
-rw-r--r--qadevOOo/tests/java/ifc/text/_BaseIndex.java231
-rw-r--r--qadevOOo/tests/java/ifc/text/_BaseIndexMark.java79
-rw-r--r--qadevOOo/tests/java/ifc/text/_CellProperties.java185
-rw-r--r--qadevOOo/tests/java/ifc/text/_CellRange.java138
-rw-r--r--qadevOOo/tests/java/ifc/text/_Defaults.java75
-rw-r--r--qadevOOo/tests/java/ifc/text/_DocumentIndex.java88
-rw-r--r--qadevOOo/tests/java/ifc/text/_DocumentIndexMark.java81
-rw-r--r--qadevOOo/tests/java/ifc/text/_Footnote.java90
-rw-r--r--qadevOOo/tests/java/ifc/text/_FootnoteSettings.java138
-rw-r--r--qadevOOo/tests/java/ifc/text/_LineNumberingProperties.java97
-rw-r--r--qadevOOo/tests/java/ifc/text/_NumberingRules.java82
-rw-r--r--qadevOOo/tests/java/ifc/text/_PrintSettings.java90
-rw-r--r--qadevOOo/tests/java/ifc/text/_Text.java69
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextColumns.java107
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextContent.java80
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextDocument.java82
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextFieldMaster.java80
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextFrame.java104
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextGraphicObject.java190
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextPortion.java90
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextSection.java168
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextTable.java145
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextTableRow.java86
-rw-r--r--qadevOOo/tests/java/ifc/text/_ViewSettings.java105
-rw-r--r--qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java174
-rw-r--r--qadevOOo/tests/java/ifc/text/_XAutoTextEntry.java111
-rw-r--r--qadevOOo/tests/java/ifc/text/_XAutoTextGroup.java341
-rw-r--r--qadevOOo/tests/java/ifc/text/_XChapterNumberingSupplier.java96
-rw-r--r--qadevOOo/tests/java/ifc/text/_XDefaultNumberingProvider.java107
-rw-r--r--qadevOOo/tests/java/ifc/text/_XDocumentIndex.java162
-rw-r--r--qadevOOo/tests/java/ifc/text/_XEndnotesSupplier.java114
-rw-r--r--qadevOOo/tests/java/ifc/text/_XFootnote.java149
-rw-r--r--qadevOOo/tests/java/ifc/text/_XFootnotesSupplier.java115
-rw-r--r--qadevOOo/tests/java/ifc/text/_XLineNumberingSupplier.java97
-rw-r--r--qadevOOo/tests/java/ifc/text/_XPageCursor.java204
-rw-r--r--qadevOOo/tests/java/ifc/text/_XPagePrintable.java180
-rw-r--r--qadevOOo/tests/java/ifc/text/_XParagraphCursor.java173
-rw-r--r--qadevOOo/tests/java/ifc/text/_XReferenceMarksSupplier.java99
-rw-r--r--qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java169
-rw-r--r--qadevOOo/tests/java/ifc/text/_XSentenceCursor.java160
-rw-r--r--qadevOOo/tests/java/ifc/text/_XSimpleText.java169
-rw-r--r--qadevOOo/tests/java/ifc/text/_XText.java201
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextColumns.java147
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextContent.java151
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextCursor.java276
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextDocument.java104
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextEmbeddedObjectsSupplier.java94
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextField.java99
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextFrame.java102
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextGraphicObjectsSupplier.java100
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextRange.java213
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java215
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextRangeMover.java130
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextSection.java111
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextTable.java214
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextTableCursor.java327
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextTablesSupplier.java99
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextViewCursorSupplier.java95
-rw-r--r--qadevOOo/tests/java/ifc/text/_XWordCursor.java166
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XCachedContentResultSetFactory.java147
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XCachedContentResultSetStubFactory.java145
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetFactory.java155
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetStubFactory.java224
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java282
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XContentIdentifierFactory.java110
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XContentProvider.java171
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XContentProviderFactory.java93
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XContentProviderManager.java311
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XDataContainer.java168
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XFileIdentifierConverter.java132
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XParameterizedContentProvider.java126
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XPropertyMatcherFactory.java104
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XPropertySetRegistryFactory.java92
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XRemoteContentProviderAcceptor.java132
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XRemoteContentProviderActivator.java111
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java574
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java124
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XSortedDynamicResultSetFactory.java192
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_FilePicker.java70
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java172
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XControlInformation.java225
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java171
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilePicker.java193
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerControlAccess.java237
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java264
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilePreview.java155
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java97
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java139
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFolderPicker.java147
-rw-r--r--qadevOOo/tests/java/ifc/uno/_XNamingService.java188
-rw-r--r--qadevOOo/tests/java/ifc/util/_PathSettings.java122
-rw-r--r--qadevOOo/tests/java/ifc/util/_SearchDescriptor.java87
-rw-r--r--qadevOOo/tests/java/ifc/util/_XCancellable.java98
-rw-r--r--qadevOOo/tests/java/ifc/util/_XCloneable.java145
-rw-r--r--qadevOOo/tests/java/ifc/util/_XFlushable.java144
-rw-r--r--qadevOOo/tests/java/ifc/util/_XIndent.java131
-rw-r--r--qadevOOo/tests/java/ifc/util/_XMergeable.java107
-rw-r--r--qadevOOo/tests/java/ifc/util/_XModeSelector.java137
-rw-r--r--qadevOOo/tests/java/ifc/util/_XModifyBroadcaster.java119
-rw-r--r--qadevOOo/tests/java/ifc/util/_XNumberFormatsSupplier.java131
-rw-r--r--qadevOOo/tests/java/ifc/util/_XRefreshable.java152
-rw-r--r--qadevOOo/tests/java/ifc/util/_XReplaceDescriptor.java109
-rw-r--r--qadevOOo/tests/java/ifc/util/_XReplaceable.java129
-rw-r--r--qadevOOo/tests/java/ifc/util/_XSearchDescriptor.java120
-rw-r--r--qadevOOo/tests/java/ifc/util/_XSearchable.java167
-rw-r--r--qadevOOo/tests/java/ifc/util/_XSortable.java184
-rw-r--r--qadevOOo/tests/java/ifc/util/_XTextSearch.java152
-rw-r--r--qadevOOo/tests/java/ifc/util/_XURLTransformer.java491
-rw-r--r--qadevOOo/tests/java/ifc/view/_XControlAccess.java141
-rw-r--r--qadevOOo/tests/java/ifc/view/_XPrintSettingsSupplier.java95
-rw-r--r--qadevOOo/tests/java/ifc/view/_XPrintable.java226
-rw-r--r--qadevOOo/tests/java/ifc/view/_XScreenCursor.java120
-rw-r--r--qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java236
-rw-r--r--qadevOOo/tests/java/ifc/view/_XViewSettingsSupplier.java95
-rw-r--r--qadevOOo/tests/java/ifc/xml/_UserDefinedAttributeSupplier.java100
-rw-r--r--qadevOOo/tests/java/ifc/xml/sax/_XDocumentHandler.java437
-rw-r--r--qadevOOo/tests/java/mod/_acceptor/Acceptor.java158
-rw-r--r--qadevOOo/tests/java/mod/_acceptor/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_adabas/ODriver.java152
-rw-r--r--qadevOOo/tests/java/mod/_ado/ODriver.java136
-rw-r--r--qadevOOo/tests/java/mod/_brdgfctr/BridgeFactory.java149
-rw-r--r--qadevOOo/tests/java/mod/_brdgfctr/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java218
-rw-r--r--qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java208
-rw-r--r--qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java215
-rw-r--r--qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java201
-rw-r--r--qadevOOo/tests/java/mod/_cmdmail/SimpleCommandMail.java103
-rw-r--r--qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java143
-rw-r--r--qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java163
-rw-r--r--qadevOOo/tests/java/mod/_cnt/PropertyMatcherFactory.java119
-rw-r--r--qadevOOo/tests/java/mod/_connectr/Connector.java155
-rw-r--r--qadevOOo/tests/java/mod/_connectr/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_corefl/CoreReflection.java119
-rw-r--r--qadevOOo/tests/java/mod/_corefl/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_cpld/DLLComponentLoader.java150
-rw-r--r--qadevOOo/tests/java/mod/_cpld/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java472
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/DBContentLoader.java140
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java444
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/OCommandDefinition.java123
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java170
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java216
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ODatasourceAdministrationDialog.java131
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java331
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/OInteractionHandler.java148
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java184
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/ORowSet.java596
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java145
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java494
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java471
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java146
-rw-r--r--qadevOOo/tests/java/mod/_defreg/NestedRegistry.java234
-rw-r--r--qadevOOo/tests/java/mod/_defreg/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_dtrans/generic.java110
-rw-r--r--qadevOOo/tests/java/mod/_dynamicloader/Dynamic.java133
-rw-r--r--qadevOOo/tests/java/mod/_file/calc/ODriver.java142
-rw-r--r--qadevOOo/tests/java/mod/_file/dbase/ODriver.java139
-rw-r--r--qadevOOo/tests/java/mod/_file/flat/ODriver.java137
-rw-r--r--qadevOOo/tests/java/mod/_fileacc/SimpleFileAccess.java118
-rw-r--r--qadevOOo/tests/java/mod/_fileacc/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_fop/FolderPicker.java135
-rw-r--r--qadevOOo/tests/java/mod/_forms/OButtonControl.java242
-rw-r--r--qadevOOo/tests/java/mod/_forms/OButtonModel.java178
-rw-r--r--qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java260
-rw-r--r--qadevOOo/tests/java/mod/_forms/OCheckBoxModel.java216
-rw-r--r--qadevOOo/tests/java/mod/_forms/OComboBoxControl.java263
-rw-r--r--qadevOOo/tests/java/mod/_forms/OComboBoxModel.java279
-rw-r--r--qadevOOo/tests/java/mod/_forms/OCurrencyControl.java269
-rw-r--r--qadevOOo/tests/java/mod/_forms/OCurrencyModel.java288
-rw-r--r--qadevOOo/tests/java/mod/_forms/ODatabaseForm.java715
-rw-r--r--qadevOOo/tests/java/mod/_forms/ODateControl.java261
-rw-r--r--qadevOOo/tests/java/mod/_forms/ODateModel.java315
-rw-r--r--qadevOOo/tests/java/mod/_forms/OEditControl.java277
-rw-r--r--qadevOOo/tests/java/mod/_forms/OEditModel.java303
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFileControlModel.java226
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFixedTextModel.java190
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFormattedControl.java258
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFormattedFieldWrapper.java274
-rw-r--r--qadevOOo/tests/java/mod/_forms/OFormsCollection.java201
-rw-r--r--qadevOOo/tests/java/mod/_forms/OGridControlModel.java319
-rw-r--r--qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java231
-rw-r--r--qadevOOo/tests/java/mod/_forms/OGroupBoxModel.java187
-rw-r--r--qadevOOo/tests/java/mod/_forms/OHiddenModel.java212
-rw-r--r--qadevOOo/tests/java/mod/_forms/OImageButtonControl.java236
-rw-r--r--qadevOOo/tests/java/mod/_forms/OImageButtonModel.java190
-rw-r--r--qadevOOo/tests/java/mod/_forms/OImageControlControl.java238
-rw-r--r--qadevOOo/tests/java/mod/_forms/OImageControlModel.java266
-rw-r--r--qadevOOo/tests/java/mod/_forms/OListBoxControl.java195
-rw-r--r--qadevOOo/tests/java/mod/_forms/OListBoxModel.java297
-rw-r--r--qadevOOo/tests/java/mod/_forms/ONumericControl.java261
-rw-r--r--qadevOOo/tests/java/mod/_forms/ONumericModel.java295
-rw-r--r--qadevOOo/tests/java/mod/_forms/OPatternControl.java261
-rw-r--r--qadevOOo/tests/java/mod/_forms/OPatternModel.java303
-rw-r--r--qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java240
-rw-r--r--qadevOOo/tests/java/mod/_forms/ORadioButtonModel.java301
-rw-r--r--qadevOOo/tests/java/mod/_forms/OTimeControl.java277
-rw-r--r--qadevOOo/tests/java/mod/_forms/OTimeModel.java312
-rw-r--r--qadevOOo/tests/java/mod/_forms/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_fps/FilePicker.java172
-rw-r--r--qadevOOo/tests/java/mod/_ftransl/DataFormatTranslator.java123
-rw-r--r--qadevOOo/tests/java/mod/_fwk/Desktop.java170
-rw-r--r--qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java158
-rw-r--r--qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java110
-rw-r--r--qadevOOo/tests/java/mod/_fwk/DocumentProperties.java163
-rw-r--r--qadevOOo/tests/java/mod/_fwk/Frame.java152
-rw-r--r--qadevOOo/tests/java/mod/_fwk/JobExecutor.java371
-rw-r--r--qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java111
-rw-r--r--qadevOOo/tests/java/mod/_fwk/ServiceHandler.java111
-rw-r--r--qadevOOo/tests/java/mod/_fwk/URLTransformer.java106
-rw-r--r--qadevOOo/tests/java/mod/_fwl/FilterFactory.java179
-rw-r--r--qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java134
-rw-r--r--qadevOOo/tests/java/mod/_fwl/PathSettings.java140
-rw-r--r--qadevOOo/tests/java/mod/_fwl/TypeDetection.java134
-rw-r--r--qadevOOo/tests/java/mod/_i18n/BreakIterator.java155
-rw-r--r--qadevOOo/tests/java/mod/_i18n/CalendarImpl.java112
-rw-r--r--qadevOOo/tests/java/mod/_i18n/ChapterCollator.java116
-rw-r--r--qadevOOo/tests/java/mod/_i18n/CharacterClassification.java119
-rw-r--r--qadevOOo/tests/java/mod/_i18n/Collator.java113
-rw-r--r--qadevOOo/tests/java/mod/_i18n/IndexEntrySupplier.java118
-rw-r--r--qadevOOo/tests/java/mod/_i18n/LocaleData.java117
-rw-r--r--qadevOOo/tests/java/mod/_i18n/NumberFormatCodeMapper.java123
-rw-r--r--qadevOOo/tests/java/mod/_i18n/TextSearch.java113
-rw-r--r--qadevOOo/tests/java/mod/_i18n/Transliteration.java113
-rw-r--r--qadevOOo/tests/java/mod/_impreg/ImplementationRegistration.java118
-rw-r--r--qadevOOo/tests/java/mod/_impreg/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_insp/Introspection.java113
-rw-r--r--qadevOOo/tests/java/mod/_insp/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_inv/Invocation.java138
-rw-r--r--qadevOOo/tests/java/mod/_inv/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_invadp/InvocationAdapterFactory.java107
-rw-r--r--qadevOOo/tests/java/mod/_invadp/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_javaloader/JavaComponentLoader.java134
-rw-r--r--qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java154
-rw-r--r--qadevOOo/tests/java/mod/_jen/JavaVirtualMachine.java109
-rw-r--r--qadevOOo/tests/java/mod/_jen/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_lng/DicList.java145
-rw-r--r--qadevOOo/tests/java/mod/_lng/LinguProps.java130
-rw-r--r--qadevOOo/tests/java/mod/_lng/LngSvcMgr.java124
-rw-r--r--qadevOOo/tests/java/mod/_lnn/Hyphenator.java143
-rw-r--r--qadevOOo/tests/java/mod/_lnn/SpellChecker.java133
-rw-r--r--qadevOOo/tests/java/mod/_lnn/Thesaurus.java130
-rw-r--r--qadevOOo/tests/java/mod/_mcnttype/MimeContentTypeFactory.java123
-rw-r--r--qadevOOo/tests/java/mod/_mozab/MozabDriver.java135
-rw-r--r--qadevOOo/tests/java/mod/_namingservice/NamingService.java134
-rw-r--r--qadevOOo/tests/java/mod/_namingservice/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_odbc/ODBCDriver.java132
-rw-r--r--qadevOOo/tests/java/mod/_proxyfac/ProxyFactory.java110
-rw-r--r--qadevOOo/tests/java/mod/_proxyfac/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java176
-rw-r--r--qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java177
-rw-r--r--qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java159
-rw-r--r--qadevOOo/tests/java/mod/_rdbtdp/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_remotebridge/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_remotebridge/various.java319
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java208
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java240
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java235
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java241
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java206
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java281
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java297
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java295
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java232
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java306
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java233
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java194
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java205
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java204
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java177
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java173
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java137
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java138
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java189
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java245
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java227
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java198
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java184
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java168
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellObj.java212
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java214
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java269
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java177
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java221
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java203
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScCellsObj.java198
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScChartObj.java306
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScChartsObj.java300
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java167
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java283
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java245
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java228
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java212
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java307
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java221
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java232
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java180
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java186
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java166
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java185
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java162
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java265
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java250
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java214
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java252
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java302
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java164
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java154
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java223
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java191
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java192
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java159
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java145
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java157
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java181
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java170
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java196
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java174
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java143
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java130
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java167
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java143
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java160
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java233
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java154
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java196
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java179
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java178
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScModelObj.java231
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java220
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java207
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java166
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScScenariosObj.java200
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java217
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java193
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java115
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java143
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java152
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java240
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScStyleObj.java295
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java168
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java191
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTabViewObj.java229
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java203
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java185
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java255
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java229
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableRowObj.java185
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java174
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java248
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java203
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java186
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java168
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLContentExporter.java242
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLContentImporter.java236
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLExporter.java249
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLImporter.java227
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java230
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java229
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java232
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java251
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java235
-rw-r--r--qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java248
-rw-r--r--qadevOOo/tests/java/mod/_sc/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccArea.java156
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccAxis.java155
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccDataPoint.java156
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccDataSeries.java156
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccDiagram.java155
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccFloor.java181
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccGrid.java157
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccLegend.java155
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccLegendEntry.java155
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java159
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccTitle.java155
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccWall.java180
-rw-r--r--qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java166
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartAxis.java158
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartData.java130
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java134
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartDocument.java188
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXChartView.java176
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXDataPoint.java190
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXDataRow.java197
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChXDiagram.java431
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartArea.java150
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartGrid.java150
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartLegend.java170
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartLine.java165
-rw-r--r--qadevOOo/tests/java/mod/_sch/ChartTitle.java148
-rw-r--r--qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java205
-rw-r--r--qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java213
-rw-r--r--qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java221
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java141
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdDrawPage.java238
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java159
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java215
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdLayer.java163
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdLayerManager.java195
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdMasterPage.java217
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java152
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java182
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java339
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java264
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdUnoPresView.java292
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java263
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java241
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java157
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXPresentation.java194
-rw-r--r--qadevOOo/tests/java/mod/_sd/SdXShape.java238
-rw-r--r--qadevOOo/tests/java/mod/_sd/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_sfx/AppDispatchProvider.java136
-rw-r--r--qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java129
-rw-r--r--qadevOOo/tests/java/mod/_sfx/FrameLoader.java140
-rw-r--r--qadevOOo/tests/java/mod/_sfx/SfxMacroLoader.java138
-rw-r--r--qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java165
-rw-r--r--qadevOOo/tests/java/mod/_simreg/SimpleRegistry.java199
-rw-r--r--qadevOOo/tests/java/mod/_simreg/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_sm/SmEditAccessible.java208
-rw-r--r--qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java209
-rw-r--r--qadevOOo/tests/java/mod/_sm/SmModel.java131
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLExporter.java229
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLImporter.java202
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java230
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java230
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java230
-rw-r--r--qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java216
-rw-r--r--qadevOOo/tests/java/mod/_smgr/OServiceManager.java200
-rw-r--r--qadevOOo/tests/java/mod/_smgr/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_smplmail/SimpleSystemMail.java153
-rw-r--r--qadevOOo/tests/java/mod/_srtrs/SortedDynamicResultSetFactory.java115
-rw-r--r--qadevOOo/tests/java/mod/_stm/DataInputStream.java229
-rw-r--r--qadevOOo/tests/java/mod/_stm/DataOutputStream.java214
-rw-r--r--qadevOOo/tests/java/mod/_stm/MarkableInputStream.java182
-rw-r--r--qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java243
-rw-r--r--qadevOOo/tests/java/mod/_stm/ObjectInputStream.java331
-rw-r--r--qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java352
-rw-r--r--qadevOOo/tests/java/mod/_stm/Pipe.java148
-rw-r--r--qadevOOo/tests/java/mod/_stm/Pump.java222
-rw-r--r--qadevOOo/tests/java/mod/_stm/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java270
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java249
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java276
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java253
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java288
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java294
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java296
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java194
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java217
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java220
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java268
-rw-r--r--qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java286
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java153
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java159
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java181
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java173
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java181
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java190
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java179
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleShape.java157
-rw-r--r--qadevOOo/tests/java/mod/_svx/GraphicExporter.java255
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxDrawPage.java237
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java286
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java290
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShape.java253
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java275
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java179
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java230
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeControl.java187
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java206
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java223
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java293
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java307
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java106
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoText.java194
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java180
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java183
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java175
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java193
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java186
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java188
-rw-r--r--qadevOOo/tests/java/mod/_svx/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java257
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java194
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java230
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java232
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java231
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java216
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java261
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java177
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java178
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java207
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java192
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java223
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java210
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java123
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java271
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java197
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXBodyText.java179
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXBookmark.java153
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXBookmarks.java150
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXCell.java167
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXCellRange.java200
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java139
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java178
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java192
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java166
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXDrawPage.java198
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java173
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java208
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java143
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnote.java200
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java171
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java208
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFootnotes.java166
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXFrames.java180
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java232
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java150
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXModule.java121
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java194
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXParagraph.java289
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java185
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java142
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXPropertySet.java116
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java128
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java174
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java196
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXShape.java164
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXStyle.java275
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java144
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java222
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTableCellText.java203
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTableColumns.java165
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTableRows.java159
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextColumns.java206
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextCursor.java321
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java155
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextDocument.java192
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java190
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java152
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextField.java200
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java171
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java171
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFrame.java182
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java189
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java222
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java196
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextPortion.java214
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java191
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextRange.java130
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextRanges.java160
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextSearch.java162
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextSection.java216
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextSections.java189
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTable.java251
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTableCursor.java158
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java158
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextTables.java188
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextView.java260
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java153
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXViewSettings.java143
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLContentExporter.java228
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLContentImporter.java211
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLExporter.java231
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLImporter.java203
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java232
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java222
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java241
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java251
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java236
-rw-r--r--qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java223
-rw-r--r--qadevOOo/tests/java/mod/_sw/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_sysdtrans/SystemClipboard.java92
-rw-r--r--qadevOOo/tests/java/mod/_sysdtrans/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_syssh/SystemShellExecute.java92
-rw-r--r--qadevOOo/tests/java/mod/_tcv/TypeConverter.java103
-rw-r--r--qadevOOo/tests/java/mod/_tcv/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java121
-rw-r--r--qadevOOo/tests/java/mod/_tdmgr/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_text/DefaultNumberingProvider.java115
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java282
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java279
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java285
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java180
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java181
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java268
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java241
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java269
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java260
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java214
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java196
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java207
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java195
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java341
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java211
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java304
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java297
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java205
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java221
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/TabController.java160
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java132
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/Toolkit.java162
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java179
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java125
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java188
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java122
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java185
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java121
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java224
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java96
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java186
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java120
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java189
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java121
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java261
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java133
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java185
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java121
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java185
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java120
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java133
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java176
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java121
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java192
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java121
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java175
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java121
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java185
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java120
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java185
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java121
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java186
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java120
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java186
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java120
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java131
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java176
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java120
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java133
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java185
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java121
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_ucb/UcbContentProviderProxyFactory.java109
-rw-r--r--qadevOOo/tests/java/mod/_ucb/UcbPropertiesManager.java100
-rw-r--r--qadevOOo/tests/java/mod/_ucb/UcbStore.java109
-rw-r--r--qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java120
-rw-r--r--qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java122
-rw-r--r--qadevOOo/tests/java/mod/_ucpfile/FileProvider.java112
-rw-r--r--qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java112
-rw-r--r--qadevOOo/tests/java/mod/_ucphier/HierarchyDataSource.java100
-rw-r--r--qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java115
-rw-r--r--qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java151
-rw-r--r--qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java103
-rw-r--r--qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java114
-rw-r--r--qadevOOo/tests/java/mod/_uui/UUIInteractionHandler.java114
-rw-r--r--qadevOOo/tests/java/mod/_uuresolver/UnoUrlResolver.java113
-rw-r--r--qadevOOo/tests/java/mod/_uuresolver/package.html6
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java230
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java237
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java232
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java236
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java221
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesImporter.java224
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java247
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java246
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java247
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java246
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java237
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java222
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java243
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java234
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java246
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java232
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java239
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java256
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java242
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java217
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java238
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java223
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java251
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java249
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java241
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java237
1109 files changed, 200027 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessible.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessible.java
new file mode 100644
index 000000000000..5481fa0638b7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessible.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessible.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.accessibility.XAccessible</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getAccessibleContext()</code></li>
+ * </ul> <p>
+ * @see com.sun.star.accessibility.XAccessible
+ */
+public class _XAccessible extends MultiMethodTest {
+
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessible" ;
+
+ public XAccessible oObj = null;
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if not null value returned.
+ */
+ public void _getAccessibleContext() {
+ XAccessibleContext ac = oObj.getAccessibleContext();
+ tRes.tested("getAccessibleContext()",ac != null);
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleAction.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleAction.java
new file mode 100644
index 000000000000..9b6f9b1d39eb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleAction.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleAction.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import lib.MultiMethodTest;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+
+public class _XAccessibleAction extends lib.MultiMethodTest {
+
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleAction";
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ public XAccessibleAction oObj = null;
+ public int count = 0;
+
+ /**
+ * calls the method and stores the result in the <br>
+ * variable count. Is OK if no excpetion occurs
+ */
+
+ public void _getAccessibleActionCount() {
+ count = oObj.getAccessibleActionCount();
+ tRes.tested("getAccessibleActionCount()",count > 0);
+ }
+
+ /**
+ * calls the method with invalid argument and check if the <br>
+ * expected Exception is thrown.<br>
+ * Calls the method afterwards the first valid parameter.<br>
+ * This is the last method called and the environment is disposed<br>
+ * afterwards.
+ */
+
+ public void _doAccessibleAction() {
+ requiredMethod("getAccessibleKeyBinding()");
+ boolean res = true;
+
+ log.println("Calling method with wrong argument");
+ try {
+ oObj.doAccessibleAction(count);
+ log.println("Exception expected -- FAILED");
+ res &= false;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Expected exception -- OK");
+ res &= true;
+ }
+
+ try {
+ boolean act = oObj.doAccessibleAction(0);
+ log.println("Did action: "+act);
+ res &= act ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Unexepected exception -- FAILED");
+ res &= false;
+ }
+
+ tRes.tested("doAccessibleAction()",res);
+ }
+
+ /**
+ * calls the method with invalid argument and check if the <br>
+ * expected Exception is thrown.<br>
+ * Calls the method afterwards all valid parameters.<br>
+ * Is ok if the exception is thrown and the resulting value
+ * for the calls with valid parameters aren't null.
+ */
+
+ public void _getAccessibleActionDescription() {
+ requiredMethod("getAccessibleActionCount()");
+ boolean res = true;
+
+ log.println("Calling method with wrong argument");
+ try {
+ oObj.getAccessibleActionDescription(count);
+ log.println("Exception expected -- FAILED");
+ res &= false;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Expected exception -- OK");
+ res &= true;
+ }
+
+ for (int i=0;i<count;i++) {
+ try {
+ String desc = oObj.getAccessibleActionDescription(i);
+ log.println("Found action: "+desc);
+ res &= desc!=null ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Unexepected exception -- FAILED");
+ res &= false;
+ }
+ }
+
+ tRes.tested("getAccessibleActionDescription()",res);
+ }
+
+ /**
+ * calls the method with invalid argument and check if the <br>
+ * expected Exception is thrown.<br>
+ * Calls the method afterwards all valid parameters.<br>
+ * Is ok if the exception is thrown and the resulting value
+ * for the calls with valid parameters aren't null.
+ */
+
+ public void _getAccessibleKeyBinding() {
+ requiredMethod("getAccessibleActionDescription()");
+ boolean res = true;
+
+ log.println("Calling method with wrong argument");
+ try {
+ oObj.getAccessibleKeyBinding(count);
+ log.println("Exception expected -- FAILED");
+ res &= false;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Expected exception -- OK");
+ res &= true;
+ }
+
+ for (int i=0;i<count;i++) {
+ try {
+ Object key = oObj.getAccessibleKeyBinding(i);
+ log.println("Found key: "+key.toString());
+ res &= key!=null ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ioe) {
+ log.println("Unexepected exception -- FAILED");
+ res &= false;
+ }
+ }
+
+ tRes.tested("getAccessibleKeyBinding()",res);
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java
new file mode 100644
index 000000000000..ef2c6bd670aa
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java
@@ -0,0 +1,524 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleComponent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.Size;
+import com.sun.star.uno.UnoRuntime;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import java.util.Vector;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>drafts.com.sun.star.accessibility.XAccessibleComponent</code>
+ * interface methods :
+ * <ul>
+ * <li><code> contains()</code></li>
+ * <li><code> getAccessibleAt()</code></li>
+ * <li><code> getBounds()</code></li>
+ * <li><code> getLocation()</code></li>
+ * <li><code> getLocationOnScreen()</code></li>
+ * <li><code> getSize()</code></li>
+ * <li><code> grabFocus()</code></li>
+ * <li><code> getAccessibleKeyBinding()</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ */
+public class _XAccessibleComponent extends MultiMethodTest {
+
+ public XAccessibleComponent oObj = null;
+
+ private Rectangle bounds = null ;
+
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleComponent" ;
+
+ /**
+ * Walkaround for current interface naming ('drafts' prefix)
+ * @return The class name to load
+ */
+ protected String getTestedClassName() {
+ System.out.println("########### YEAH");
+ return className;
+ }
+
+ /**
+ * First checks 4 inner bounds (upper, lower, left and right)
+ * of component bounding box to contain
+ * at least one point of the component. Second 4 outer bounds
+ * are checked to not contain any component points.<p>
+ *
+ * Has <b> OK </b> status if inner bounds contain component points
+ * and outer bounds don't contain any component points. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getBounds() </code> : to have size of a component.</li>
+ * </ul>
+ */
+ public void _contains() {
+ requiredMethod("getBounds()");
+
+ boolean result = true ;
+
+ int curX = 0;
+ //while (!oObj.contains(new Point(curX, bounds.Y)) && curX < bounds.Width+bounds.X) {
+ while (!oObj.contains(new Point(curX, 0)) && curX < bounds.Width) {
+ curX++;
+ };
+ //if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
+ if (curX < bounds.Width) {
+ log.println("Upper bound of box contains point ("
+ + curX + ",0) - OK");
+ } else {
+ log.println
+ ("Upper bound of box contains no component points - FAILED");
+ result = false;
+ }
+
+ curX = 0;
+ //while (!oObj.contains(new Point(curX, bounds.Y+bounds.Height - 1))
+ while (!oObj.contains(new Point(curX, bounds.Height - 1))
+ && curX < bounds.Width) {
+
+ log.println("Contains returns false for ("+curX+","+bounds.Height+")");
+ curX++;
+ };
+ //if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
+ if (curX < bounds.Width) {
+ log.println("Lower bound of box contains point ("
+ + curX + "," + (bounds.Height - 1) + ") - OK");
+ } else {
+ log.println
+ ("Lower bound of box contains no component points - FAILED");
+ result = false;
+ }
+
+ int curY = 0;
+ //while (!oObj.contains(new Point(bounds.X, curY)) && curY < bounds.Height+bounds.Y) {
+ while (!oObj.contains(new Point(0, curY)) && curY < bounds.Height) {
+ curY++;
+ };
+ //if ((bounds.Y <= curY) && (curY < bounds.Height+bounds.Y)) {
+ if (curY < bounds.Height) {
+ log.println("Left bound of box contains point (0,"
+ + curY + ") - OK");
+ } else {
+ log.println
+ ("Left bound of box contains no component points - FAILED");
+ result = false;
+ }
+
+ curY = 0;
+ //while (!oObj.contains(new Point(bounds.X+bounds.Width - 1, curY))
+ // && curY < bounds.Height+bounds.Y) {
+ while (!oObj.contains(new Point(bounds.Width - 1, curY)) && curY < bounds.Height) {
+ curY++;
+ };
+ //if ((bounds.Y <= curY) && (curY < bounds.Height + bounds.Y)) {
+ if (curY < bounds.Height) {
+ log.println("Right bound of box contains point ("
+ + (bounds.Width - 1) + "," + curY + ") - OK");
+ } else {
+ log.println
+ ("Right bound of box contains no component points - FAILED");
+ result = false;
+ }
+
+ boolean locRes = true;
+ for (int x = -1; x <= bounds.Width; x++) {
+ locRes &= !oObj.contains(new Point(x, -1));
+ locRes &= !oObj.contains(new Point(x, bounds.Height+bounds.Y));
+ }
+ if (locRes) {
+ log.println("Outer upper and lower bounds contain no component "
+ + "points - OK");
+ } else {
+ log.println("Outer upper and lower bounds CONTAIN some component "
+ + "points - FAILED");
+ result = false;
+ }
+
+ locRes = true;
+ for (int y = -1; y <= bounds.Height; y++) {
+ locRes &= !oObj.contains(new Point(-1, y));
+ locRes &= !oObj.contains(new Point(bounds.X+bounds.Width, y));
+ }
+ if (locRes) {
+ log.println("Outer left and right bounds contain no component "
+ + "points - OK");
+ } else {
+ log.println("Outer left and right bounds CONTAIN some component "
+ + "points - FAILED");
+ result = false;
+ }
+
+ tRes.tested("contains()", result) ;
+ }
+
+ /**
+ * Iterates through all children which implement
+ * <code>XAccessibleComponent</code> (if they exist) determines their
+ * boundaries and tries to get each child by <code>getAccessibleAt</code>
+ * passing point which belongs to the child.
+ * Also the point is checked which doesn't belong to child boundary
+ * box. <p>
+ *
+ * Has <b> OK </b> status if in the first cases the right children
+ * are returned, and in the second <code>null</code> or
+ * another child is returned.
+ */
+ public void _getAccessibleAt() {
+
+ boolean result = true ;
+ XAccessibleComponent[] children = getChildrenComponents();
+
+ if (children.length > 0) {
+ for (int i = 0; i < children.length; i++) {
+ Rectangle chBnd = children[i].getBounds();
+ if (chBnd.X == -1) continue;
+ log.println("Checking child with bounds " +
+ "(" + chBnd.X + "," + chBnd.Y + "),("
+ + chBnd.Width + "," + chBnd.Height + "): "
+ + util.AccessibilityTools.accessibleToString(children[i]));
+
+ log.println("finding the point which lies on the component");
+ int curX = 0;
+ int curY = 0;
+ while (!children[i].contains(new Point(curX, curY))
+ && curX < chBnd.Width) {
+ curX++;
+ curY++;
+ };
+
+ if (curX==chBnd.Width) {
+ log.println("Couldn't find a point with contains");
+ continue;
+ }
+
+ // trying the point laying on child
+ XAccessible xAcc = oObj.getAccessibleAt
+ (new Point(chBnd.X , chBnd.Y));
+ if (xAcc == null) {
+ log.println("The child not found at point ("
+ + (chBnd.X ) + "," + chBnd.Y + ") - FAILED");
+ result = false;
+ } else {
+ XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface
+ (XAccessible.class, children[i]);
+ log.println("Child found at point ("
+ + (chBnd.X ) + "," + chBnd.Y + ") - OK");
+ boolean res = util.AccessibilityTools.equals(xAccCh, xAcc);
+ if (!res) {
+ int expIndex = xAccCh.getAccessibleContext().getAccessibleIndexInParent();
+ int gotIndex = xAcc.getAccessibleContext().getAccessibleIndexInParent();
+ if (expIndex < gotIndex) {
+ log.println("The children found is not the same");
+ log.println("The expected child " +
+ xAccCh.getAccessibleContext().getAccessibleName());
+ log.print("is hidden behind the found Child ");
+ log.println(xAcc.getAccessibleContext().getAccessibleName()+" - OK");
+ } else {
+ log.println("The children found is not the same - FAILED");
+ log.println("Expected: "
+ +xAccCh.getAccessibleContext().getAccessibleName());
+ log.println("Found: "
+ +xAcc.getAccessibleContext().getAccessibleName());
+ result = false ;
+ }
+ }
+ }
+
+ // trying the point NOT laying on child
+ xAcc = oObj.getAccessibleAt
+ (new Point(chBnd.X - 1, chBnd.Y - 1));
+ if (xAcc == null) {
+ log.println("No children found at point ("
+ + (chBnd.X - 1) + "," + (chBnd.Y - 1) + ") - OK");
+ result &= true;
+ } else {
+ XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface
+ (XAccessible.class, children[i]);
+ boolean res = util.AccessibilityTools.equals(xAccCh, xAcc);
+ if (res) {
+ log.println("The same child found outside "
+ + "its bounds - FAILED");
+ result = false ;
+ }
+ }
+ }
+ } else {
+ log.println("There are no children supporting "
+ + "XAccessibleComponent");
+ }
+
+ tRes.tested("getAccessibleAt()", result) ;
+ }
+
+ /**
+ * Retrieves the component bounds and stores it. <p>
+ *
+ * Has <b> OK </b> status if boundary position (x,y) is not negative
+ * and size (Width, Height) is greater than 0.
+ */
+ public void _getBounds() {
+ boolean result = true ;
+
+ bounds = oObj.getBounds() ;
+ result &= bounds != null
+ && bounds.X >=0 && bounds.Y >=0
+ && bounds.Width >0 && bounds.Height >0;
+
+ log.println("Bounds = " + (bounds != null
+ ? "(" + bounds.X + "," + bounds.Y + "),("
+ + bounds.Width + "," + bounds.Height + ")" : "null"));
+
+ tRes.tested("getBounds()", result) ;
+ }
+
+ /**
+ * Gets the location. <p>
+ *
+ * Has <b> OK </b> status if the location is the same as location
+ * of boundary obtained by <code>getBounds()</code> method.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getBounds() </code> : to have bounds </li>
+ * </ul>
+ */
+ public void _getLocation() {
+ requiredMethod("getBounds()");
+
+ boolean result = true ;
+ Point loc = oObj.getLocation() ;
+
+ result &= loc.X == bounds.X && loc.Y == bounds.Y ;
+
+ tRes.tested("getLocation()", result) ;
+ }
+
+ /**
+ * Get the screen location of the component and its parent
+ * (if it exists and supports <code>XAccessibleComponent</code>). <p>
+ *
+ * Has <b> OK </b> status if component screen location equals
+ * to screen location of its parent plus location of the component
+ * relative to the parent. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getBounds() </code> : to have location of the component
+ * relative to its parent</li>
+ * </ul>
+ */
+ public void _getLocationOnScreen() {
+ requiredMethod("getBounds()");
+
+ XAccessibleComponent parent = getParentComponent();
+
+ boolean result = true ;
+ Point loc = oObj.getLocationOnScreen();
+ log.println("Location is (" + loc.X + "," + loc.Y + ")");
+
+ if (parent != null) {
+ Point parLoc = parent.getLocationOnScreen();
+ log.println("Parent location is ("
+ + parLoc.X + "," + parLoc.Y + ")");
+
+ result &= parLoc.X + bounds.X == loc.X;
+ result &= parLoc.Y + bounds.Y == loc.Y;
+ }
+
+ tRes.tested("getLocationOnScreen()", result) ;
+ }
+
+ /**
+ * Obtains the size of the component. <p>
+ *
+ * Has <b> OK </b> status if the size is the same as in bounds. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getBounds() </code> </li>
+ * </ul>
+ */
+ public void _getSize() {
+ requiredMethod("getBounds()");
+
+ boolean result = true ;
+ Size size = oObj.getSize() ;
+
+ result &= size.Width == bounds.Width;
+ result &= size.Height == bounds.Height;
+
+ tRes.tested("getSize()", result) ;
+ }
+
+ /**
+ * Just calls the method. <p>
+ *
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _grabFocus() {
+
+ boolean result = true ;
+ oObj.grabFocus() ;
+
+ tRes.tested("grabFocus()", result) ;
+ }
+
+ /**
+ * Retrieves all children (not more than 50) of the current
+ * component which support <code>XAccessibleComponent</code>.
+ *
+ * @return The array of children. Empty array returned if
+ * such children were not found or some error occured.
+ */
+ private XAccessibleComponent[] getChildrenComponents() {
+ XAccessible xAcc = (XAccessible) UnoRuntime.queryInterface
+ (XAccessible.class, oObj) ;
+ if (xAcc == null) {
+ log.println("Component doesn't support XAccessible.");
+ return new XAccessibleComponent[0];
+ }
+ XAccessibleContext xAccCon = xAcc.getAccessibleContext();
+ int cnt = xAccCon.getAccessibleChildCount();
+
+ // for cases when too many children exist checking only first 50
+ if (cnt > 50) cnt = 50 ;
+
+ Vector childComp = new Vector();
+ for (int i = 0; i < cnt; i++) {
+ try {
+ XAccessible child = xAccCon.getAccessibleChild(i);
+ XAccessibleContext xAccConCh = child.getAccessibleContext();
+ XAccessibleComponent xChAccComp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class,
+ xAccConCh);
+ if (xChAccComp != null) {
+ childComp.add(xChAccComp) ;
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {}
+ }
+
+ return (XAccessibleComponent[]) childComp.toArray
+ (new XAccessibleComponent[childComp.size()]);
+ }
+
+ /**
+ * Gets the parent of the current component which support
+ * <code>XAccessibleComponent</code>.
+ *
+ * @return The parent or <code>null</code> if the component
+ * has no parent or some errors occured.
+ */
+ private XAccessibleComponent getParentComponent() {
+ XAccessible xAcc = (XAccessible) UnoRuntime.queryInterface
+ (XAccessible.class, oObj) ;
+ if (xAcc == null) {
+ log.println("Component doesn't support XAccessible.");
+ return null;
+ }
+
+ XAccessibleContext xAccCon = xAcc.getAccessibleContext();
+ XAccessible xAccPar = xAccCon.getAccessibleParent();
+
+ if (xAccPar == null) {
+ log.println("Component has no accessible parent.");
+ return null;
+ }
+ XAccessibleContext xAccConPar = xAccPar.getAccessibleContext();
+ XAccessibleComponent parent = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, xAccConPar);
+ if (parent == null) {
+ log.println
+ ("Accessible parent doesn't support XAccessibleComponent");
+ return null;
+ }
+
+ return parent;
+ }
+
+ /**
+ * Just calls the method.
+ */
+ public void _getForeground() {
+ int forColor = oObj.getForeground();
+ log.println("getForeground(): " + forColor);
+ tRes.tested("getForeground()", true);
+ }
+
+ /**
+ * Just calls the method.
+ */
+ public void _getBackground() {
+ int backColor = oObj.getBackground();
+ log.println("getBackground(): " + backColor);
+ tRes.tested("getBackground()", true);
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleContext.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleContext.java
new file mode 100644
index 000000000000..2d3eb0551f57
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleContext.java
@@ -0,0 +1,294 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleContext.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import com.sun.star.lang.Locale;
+import drafts.com.sun.star.accessibility.IllegalAccessibleComponentStateException;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleRelationSet;
+import drafts.com.sun.star.accessibility.XAccessibleStateSet;
+import drafts.com.sun.star.accessibility.AccessibleRelationType;
+import lib.MultiMethodTest;
+import util.AccessibilityTools;
+
+/**
+ * Testing <code>drafts.com.sun.star.accessibility.XAccessibleContext</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getAccessibleChildCount()</code></li>
+ * <li><code> getAccessibleChild()</code></li>
+ * <li><code> getAccessibleParent()</code></li>
+ * <li><code> getAccessibleIndexInParent()</code></li>
+ * <li><code> getAccessibleRole()</code></li>
+ * <li><code> getAccessibleDescription()</code></li>
+ * <li><code> getAccessibleName()</code></li>
+ * <li><code> getAccessibleRelationSet()</code></li>
+ * <li><code> getAccessibleStateSet()</code></li>
+ * <li><code> getLocale()</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ */
+public class _XAccessibleContext extends MultiMethodTest {
+
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleContext" ;
+
+ public XAccessibleContext oObj = null;
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ private int childCount = 0;
+ private XAccessible parent = null ;
+
+ /**
+ * Calls the method and stores the number of children. <p>
+ * Has <b> OK </b> status if non-negative number rutrned.
+ */
+ public void _getAccessibleChildCount() {
+ childCount = oObj.getAccessibleChildCount();
+ log.println("" + childCount + " children found.");
+ tRes.tested("getAccessibleChildCount()", childCount > -1);
+ }
+
+ /**
+ * Tries to get every child and checks its parent. <p>
+ *
+ * Has <b> OK </b> status if parent of every child
+ * and the tested component are the same objects.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getAccessibleChildCount() </code> : to have a number of
+ * children </li>
+ * </ul>
+ */
+ public void _getAccessibleChild() {
+ requiredMethod("getAccessibleChildCount()") ;
+ boolean bOK = true;
+ int counter = childCount;
+ if (childCount > 500) counter = 500;
+ for (int i = 0; i < counter; i++) {
+ try {
+ XAccessible ch = oObj.getAccessibleChild(i) ;
+ XAccessibleContext chAC = ch.getAccessibleContext();
+
+ log.println(" Child " + i + ": " +
+ chAC.getAccessibleDescription()) ;
+
+ if (!AccessibilityTools.equals
+ (chAC.getAccessibleParent().getAccessibleContext(), oObj)){
+
+ log.println("Role:");
+ log.println("Getting: "+chAC.getAccessibleParent().getAccessibleContext().getAccessibleRole());
+ log.println("Expected: "+oObj.getAccessibleRole());
+
+ log.println("ImplementationName:");
+ log.println("Getting: "+util.utils.getImplName(chAC.getAccessibleParent().getAccessibleContext()));
+ log.println("Expected: "+util.utils.getImplName(oObj));
+
+ log.println("The parent of child and component "+
+ "itself differ.");
+ log.println("Getting(Description): "
+ +chAC.getAccessibleParent().getAccessibleContext().getAccessibleDescription());
+ log.println("Expected(Description): "
+ +oObj.getAccessibleDescription());
+
+ bOK = false;
+ } else {
+ log.println("Getting the expected Child -- OK");
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ bOK = false;
+ }
+ }
+
+ tRes.tested("getAccessibleChild()", bOK);
+ }
+
+ /**
+ * Just gets the parent. <p>
+ *
+ * Has <b> OK </b> status if parent is not null.
+ */
+ public void _getAccessibleParent() {
+ // assume that the component is not ROOT
+ parent = oObj.getAccessibleParent();
+ tRes.tested("getAccessibleParent()", parent != null);
+ }
+
+ /**
+ * Retrieves the index of tested component in its parent.
+ * Then gets the parent's child by this index and compares
+ * it with tested component.<p>
+ *
+ * Has <b> OK </b> status if the parent's child and the tested
+ * component are the same objects.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getAccessibleParent() </code> : to have a parent </li>
+ * </ul>
+ */
+ public void _getAccessibleIndexInParent() {
+ requiredMethod("getAccessibleParent()");
+
+ boolean bOK = true;
+ int idx = oObj.getAccessibleIndexInParent();
+
+ XAccessibleContext parentAC = parent.getAccessibleContext() ;
+ try {
+ bOK &= AccessibilityTools.equals(
+ parentAC.getAccessibleChild(idx).getAccessibleContext(),oObj);
+ if (!bOK) {
+ log.println("Expected: "+util.utils.getImplName(oObj));
+ log.println("Getting: "+util.utils.getImplName(
+ parentAC.getAccessibleChild(idx).getAccessibleContext()));
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ bOK = false;
+ }
+ tRes.tested("getAccessibleIndexInParent()", bOK);
+ }
+
+ /**
+ * Get the accessible role of component. <p>
+ *
+ * Has <b> OK </b> status if non-negative number rutrned.
+ */
+ public void _getAccessibleRole() {
+ short role = oObj.getAccessibleRole();
+ log.println("The role is " + role);
+ tRes.tested("getAccessibleRole()", role > -1);
+ }
+
+ /**
+ * Get the accessible name of the component. <p>
+ *
+ * Has <b> OK </b> status if the name has non-zero length.
+ */
+ public void _getAccessibleName() {
+ String name = oObj.getAccessibleName();
+ log.println("The name is '" + name + "'");
+ tRes.tested("getAccessibleName()",
+ name != null );
+ }
+
+ /**
+ * Get the accessible description of the component. <p>
+ *
+ * Has <b> OK </b> status if the description has non-zero length.
+ */
+ public void _getAccessibleDescription() {
+ String descr = oObj.getAccessibleDescription();
+ log.println("The description is '" + descr + "'");
+ tRes.tested("getAccessibleDescription()",
+ descr != null );
+ }
+
+ /**
+ * Just gets the set. <p>
+ *
+ * Has <b> OK </b> status if the set is not null.
+ */
+ public void _getAccessibleRelationSet() {
+ XAccessibleRelationSet set = oObj.getAccessibleRelationSet();
+ tRes.tested("getAccessibleRelationSet()", true);
+ }
+
+ /**
+ * Just gets the set. <p>
+ *
+ * Has <b> OK </b> status if the set is not null.
+ */
+ public void _getAccessibleStateSet() {
+ XAccessibleStateSet set = oObj.getAccessibleStateSet();
+ tRes.tested("getAccessibleStateSet()", set != null);
+ }
+
+ /**
+ * Gets the locale. <p>
+ *
+ * Has <b> OK </b> status if <code>Country</code> and
+ * <code>Language</code> fields of locale structure
+ * are not empty.
+ */
+ public void _getLocale() {
+ Locale loc = null ;
+ try {
+ loc = oObj.getLocale();
+ log.println("The locale is " + loc.Language + "," + loc.Country);
+ } catch (IllegalAccessibleComponentStateException e) {
+ e.printStackTrace(log);
+ }
+
+ tRes.tested("getLocale()", loc != null &&
+ loc.Language.length() > 0 && loc.Country.length() > 0);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEditableText.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEditableText.java
new file mode 100644
index 000000000000..3b42c494da8d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEditableText.java
@@ -0,0 +1,582 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleEditableText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import lib.MultiMethodTest;
+import drafts.com.sun.star.accessibility.XAccessibleEditableText;
+import com.sun.star.beans.PropertyValue;
+import util.ValueComparer;
+import util.ValueChanger;
+
+/**
+ * Testing <code>com.sun.star.accessibility.XAccessibleEditableText</code>
+ * interface methods :
+ * <ul>
+ * <li><code> cutText()</code></li>
+ * <li><code> pasteText()</code></li>
+ * <li><code> deleteText()</code></li>
+ * <li><code> insertText()</code></li>
+ * <li><code> replaceText()</code></li>
+ * <li><code> setAttributes()</code></li>
+ * <li><code> setText()</code></li>
+ * </ul> <p>
+ *
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'XAccessibleEditableText.hasAttr'</code>
+ * (of type <code>Boolean</code>):
+ * Indicates whether or not the text has changeable attributes.
+ * E.g. text within writer document have attributes which can
+ * be changed, while the text within edit field has fixed
+ * attributes. <p>
+ * If the relation is <code>false</code> then the component
+ * has fixed text attributes. </li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleEditableText
+ */
+public class _XAccessibleEditableText extends MultiMethodTest {
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleEditableText" ;
+
+ public XAccessibleEditableText oObj = null;
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ String pasteText = null;
+
+ String initialText = "";
+
+ /**
+ * Indicates whether or not the text has changeable attributes.
+ * E.g. text within writer document have attributes which can
+ * be changed, while the text within edit field has fixed
+ * attributes.
+ */
+ private boolean changeableAttr = true;
+
+ /**
+ * Retrieves object relation. Stores initial component text
+ * for restoding it in <code>after</code>.
+ */
+ protected void before() {
+ Boolean b = (Boolean)
+ tEnv.getObjRelation("XAccessibleEditableText.hasAttr");
+ if (b != null) {
+ changeableAttr = b.booleanValue();
+ }
+
+ initialText = oObj.getText();
+ }
+
+ /**
+ * Calls the method with the wrong indexes and with the correct indexes.
+ * Stores cutted text in the variable <code>pasteText</code>.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct indexes.
+ */
+ public void _cutText() {
+ boolean res = true;
+ boolean locRes = true;
+ String curText = null;
+
+ String oldText = oObj.getText();
+ log.println("Text: '" + oldText + "'");
+ int length = oObj.getCharacterCount();
+ log.println("Character count: " + length);
+
+ try {
+ log.print("cutText(-1," + (length-1) + "): ");
+ locRes = oObj.cutText(-1, length - 1);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(oldText);
+ }
+
+ try {
+ log.print("cutText(0," + (length+1) + "): ");
+ locRes = oObj.cutText(0, length + 1);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(oldText);
+ }
+
+ try {
+ pasteText = oldText;
+ log.print("cutText(0," + length + "): ");
+ locRes = oObj.cutText(0, length);
+ log.println(locRes);
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.length() == 0 && locRes;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("cutText()", res);
+ }
+
+ /**
+ * Calls the method with the wrong indexes and with the correct indexes.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct indexes and if cutted text was
+ * pasted.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>cutText()</code> </li>
+ * </ul>
+ */
+ public void _pasteText() {
+ requiredMethod("cutText()");
+ boolean res = true;
+ boolean locRes = true;
+ String curText = null;
+
+ String text = oObj.getText();
+ log.println("Text: '" + text + "'");
+ int length = oObj.getCharacterCount();
+ log.println("Character count: " + length);
+
+ try {
+ log.print("pasteText(-1): ");
+ locRes = oObj.pasteText(-1);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(text);
+ }
+
+ try {
+ log.print("pasteText(" + (length+1) + "): ");
+ locRes = oObj.pasteText(length + 1);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(text);
+ }
+
+ try {
+ log.print("pasteText(" + (length) + "): ");
+ locRes = oObj.pasteText(length);
+ log.println(locRes);
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(text + pasteText) && locRes;
+ log.println("Expected text: '" + text + pasteText + "'");
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("pasteText()", res);
+ }
+
+ /**
+ * Calls the method with the wrong indexes and with the correct indexes,
+ * checks text after method call.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct indexes and if deleted string
+ * was really deleted from the text.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>insertText()</code> </li>
+ * </ul>
+ */
+ public void _deleteText() {
+ executeMethod("insertText()");
+ boolean res = true;
+ boolean locRes = true;
+ String curText = null;
+
+ String text = oObj.getText();
+ log.println("Text: '" + text + "'");
+ int length = oObj.getCharacterCount();
+ log.println("Character count: " + length);
+
+ try {
+ log.print("deleteText(-1," + length + "): ");
+ locRes = oObj.deleteText(-1, length);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(text);
+ }
+
+ try {
+ log.print("deleteText(0," + (length+1) + "): ");
+ locRes = oObj.deleteText(0, length + 1);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(text);
+ }
+
+ try {
+ if (length >= 1) {
+ log.print("deleteText(" + (length-1) + "," + (length) + "): ");
+ locRes = oObj.deleteText(length - 1, length);
+ log.println(locRes);
+ String expStr = expStr = text.substring(0, length - 1);
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(expStr);
+ log.println("Expected text: '" + expStr + "'");
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("deleteText()", res);
+ }
+
+ /**
+ * Calls the method with the wrong indexes and with the correct indexes,
+ * checks text after method call.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct indexes and if inserted string
+ * was really inserted into the text.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>pasteText()</code> </li>
+ * </ul>
+ */
+ public void _insertText() {
+ executeMethod("pasteText()");
+ boolean res = true;
+ boolean locRes = true;
+ String curText = null;
+
+ String text = oObj.getText();
+ log.println("Text: '" + text + "'");
+ int length = oObj.getCharacterCount();
+ log.println("Character count: " + length);
+
+ final String insStr = "Inserted string";
+
+ try {
+ log.print("insertText(insStr, -1): ");
+ locRes = oObj.insertText(insStr, -1);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(text);
+ }
+
+ try {
+ log.print("insertText(insStr," + (length+1) + "): ");
+ locRes = oObj.insertText(insStr, length+1);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(text);
+ }
+
+ try {
+ log.print("insertText(insStr," + length + "): ");
+ locRes = oObj.insertText(insStr, length);
+ log.println(locRes);
+ curText = oObj.getText();
+ res &= curText.equals(text + insStr);
+ log.println("Current text: '" + curText + "'");
+ log.println("Expected text: '" + text + insStr + "'");
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("insertText()", res);
+ }
+
+ /**
+ * Calls the method with the wrong indexes and with the correct indexes,
+ * checks text after method call.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct indexes and if part of text
+ * was really replaced by the specified replacement string.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>deleteText()</code> </li>
+ * </ul>
+ */
+ public void _replaceText() {
+ executeMethod("deleteText()");
+ boolean res = true;
+ boolean locRes = true;
+ String curText = null;
+
+ final String sReplacement = "String for replace";
+ String oldText = oObj.getText();
+ int startIndx = oldText.length();
+ oObj.setText(oldText + " part of string for replace");
+
+ String text = oObj.getText();
+ log.println("Text: '" + text + "'");
+ int length = oObj.getCharacterCount();
+ log.println("Character count: " + length);
+
+ try {
+ log.print("replaceText(-1," + length + "): ");
+ locRes = oObj.replaceText(-1, length, sReplacement);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(text);
+ }
+
+ try {
+ log.print("replaceText(0," + (length+1) + "): ");
+ locRes = oObj.replaceText(0, length + 1, sReplacement);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ res &= curText.equals(text);
+ }
+
+ try {
+ log.print("replaceText(" + startIndx + "," + length + "): ");
+ locRes = oObj.replaceText(startIndx, length, sReplacement);
+ log.println(locRes);
+ curText = oObj.getText();
+ log.println("Current text: '" + curText + "'");
+ log.println("Expected text: '" + oldText + sReplacement + "'");
+ res &= curText.equals(oldText + sReplacement);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("replaceText()", res);
+ }
+
+ /**
+ * Calls the method with the wrong indexes and with the correct indexes,
+ * checks attributes after method call.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct indexes and if attributes
+ * of text was changed.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>replaceText()</code> </li>
+ * </ul>
+ */
+ public void _setAttributes() {
+ executeMethod("replaceText()");
+ boolean res = true;
+ boolean locRes = true;
+
+ String text = oObj.getText();
+ log.println("Text: '" + text + "'");
+ int length = oObj.getCharacterCount();
+ log.println("Length: " + length);
+
+ PropertyValue[] attrs = null;
+
+ try {
+ attrs = oObj.getCharacterAttributes(0);
+ log.print("setAttributes(-1," + (length - 1) + "):");
+ locRes = oObj.setAttributes(-1, length - 1, attrs);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("setAttributes(0," + (length+1) + "):");
+ locRes = oObj.setAttributes(0, length + 1, attrs);
+ log.println(locRes);
+ log.println("exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ //change old attributes set
+ for(int i = 0; i < attrs.length; i++) {
+ if (attrs[i].Name.equals("CharColor")) {
+ attrs[i].Value = new Integer(-2);
+ }
+ }
+
+ try {
+ log.print("setAttributes(0," + length + "):");
+ locRes = oObj.setAttributes(0, length, attrs);
+ log.println(locRes);
+ res &= (changeableAttr && locRes)
+ || (!changeableAttr && !locRes);
+ if (changeableAttr) {
+ log.print("checking that new attributes was set...");
+ PropertyValue[] newAttrs = oObj.getCharacterAttributes(0);
+ locRes = ValueComparer.equalValue(attrs, newAttrs);
+ log.println(locRes);
+ res &= locRes;
+ } else {
+ log.println("Text attributes can't be changed.");
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("setAttributes()", res);
+ }
+
+ /**
+ * Calls the method with different parameters and checks text.
+ */
+ public void _setText() {
+ executeMethod("setAttributes()");
+ boolean res = true;
+ boolean locRes = true;
+
+ String oldText = oObj.getText();
+ log.println("Current text: '" + oldText + "'");
+
+ String newText = "New text";
+ log.print("setText('" + newText + "'): ");
+ locRes = oObj.setText(newText);
+ log.println(locRes);
+ String newCurText = oObj.getText();
+ log.println("getText(): '" + newCurText + "'");
+ res &= locRes && newCurText.equals(newText);
+
+ newText = "";
+ log.print("setText('" + newText + "'): ");
+ locRes = oObj.setText(newText);
+ log.println(locRes);
+ newCurText = oObj.getText();
+ log.println("getText(): '" + newCurText + "'");
+ res &= locRes && newCurText.equals(newText);
+
+ log.print("setText('" + oldText + "'): ");
+ locRes = oObj.setText(oldText);
+ log.println(locRes);
+ newCurText = oObj.getText();
+ log.println("getText(): '" + newCurText + "'");
+ res &= locRes && newCurText.equals(oldText);
+
+ tRes.tested("setText()", res);
+ }
+
+ /**
+ * Restores initial component text.
+ */
+ protected void after() {
+ oObj.setText(initialText);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
new file mode 100644
index 000000000000..5aa9e04d11ae
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
@@ -0,0 +1,239 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleEventBroadcaster.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import com.sun.star.lang.EventObject;
+import drafts.com.sun.star.accessibility.AccessibleEventObject;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster;
+import drafts.com.sun.star.accessibility.XAccessibleEventListener;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>
+ * drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster</code>
+ * interface methods :
+ * <ul>
+ * <li><code> addEventListener()</code></li>
+ * <li><code> removeEventListener()</code></li>
+ * </ul> <p>
+ *
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'EventProducer'</code> (of type
+ * <code>ifc.accessibility._XAccessibleEventBroadcaster.EventProducer</code>):
+ * this must be an implementation of the interface which could perform
+ * some actions for generating any kind of <code>AccessibleEvent</code></li>
+ * <ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ */
+public class _XAccessibleEventBroadcaster extends MultiMethodTest {
+
+ public static interface EventProducer {
+ void fireEvent();
+ }
+
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster" ;
+
+ public XAccessibleEventBroadcaster oObj = null;
+ public String EventMsg = "";
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ /**
+ * Listener implementation which registers listener calls.
+ */
+ private class EvListener implements XAccessibleEventListener {
+ public AccessibleEventObject notifiedEvent = null ;
+ public void notifyEvent(AccessibleEventObject ev) {
+ log.println("Listener, Event : " + ev.EventId);
+ System.out.println("EventID: " + ev.EventId);
+ Object old=ev.OldValue;
+ if (old instanceof drafts.com.sun.star.accessibility.XAccessible) {
+ System.out.println("Old: "+((XAccessible)old).getAccessibleContext().getAccessibleName());
+ }
+
+ Object nev=ev.NewValue;
+ if (nev instanceof drafts.com.sun.star.accessibility.XAccessible) {
+ System.out.println("New: "+((XAccessible)nev).getAccessibleContext().getAccessibleName());
+ }
+ notifiedEvent = ev;
+ }
+
+ public void disposing(EventObject ev) {}
+ }
+
+ /**
+ * Retrieves relation.
+ * @throws StatusException If the relation is not found.
+ */
+ public void before() {
+ prod = (EventProducer) tEnv.getObjRelation("EventProducer") ;
+ if (prod == null) {
+ throw new StatusException(Status.failed("Relation missed."));
+ }
+ EventMsg = (String) tEnv.getObjRelation("EventMsg");
+ }
+
+ EventProducer prod = null ;
+ EvListener list = new EvListener();
+
+ /**
+ * Adds two listeners and fires event by mean of object relation. <p>
+ * Has <b> OK </b> status if both listeners were called
+ */
+ public void _addEventListener() {
+ log.println("adding two listeners");
+ oObj.addEventListener(list);
+ boolean isTransient = chkTransient(tEnv.getTestObject());
+ log.println("fire event");
+ prod.fireEvent() ;
+
+ try {
+ Thread.sleep(1500);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ boolean works = true;
+
+ if (list.notifiedEvent == null) {
+ if (!isTransient) {
+ log.println("listener wasn't called");
+ works = false;
+ } else {
+ log.println("Object is Transient, listener isn't expected to be called");
+ }
+ oObj.removeEventListener(list);
+ }
+
+ if (EventMsg != null) {
+ log.println(EventMsg);
+ tRes.tested("addEventListener()", Status.skipped(true) );
+ return;
+ }
+
+ tRes.tested("addEventListener()", works );
+ }
+
+ /**
+ * Removes one of two listeners added before and and fires event
+ * by mean of object relation. <p>
+ *
+ * Has <b> OK </b> status if the removed listener wasn't called. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>addEventListener()</code> : to have added listeners </li>
+ * </ul>
+ */
+ public void _removeEventListener() {
+ requiredMethod("addEventListener()");
+
+ list.notifiedEvent = null;
+
+ log.println("remove first listener");
+ oObj.removeEventListener(list);
+
+ log.println("fire event");
+ prod.fireEvent() ;
+
+ try {
+ Thread.sleep(500);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ if (list.notifiedEvent == null) {
+ log.println("listener wasn't called -- OK");
+ }
+
+ tRes.tested("removeEventListener()", list.notifiedEvent == null);
+
+ }
+
+ protected static boolean chkTransient(Object Testcase) {
+ boolean ret = false;
+ XAccessibleContext accCon = (XAccessibleContext)
+ UnoRuntime.queryInterface(XAccessibleContext.class,Testcase);
+ if (accCon.getAccessibleStateSet().contains(
+ drafts.com.sun.star.accessibility.AccessibleStateType.TRANSIENT)){
+ if (!accCon.getAccessibleParent().getAccessibleContext().getAccessibleStateSet().contains(
+ drafts.com.sun.star.accessibility.AccessibleStateType.MANAGES_DESCENDANT)) {
+ throw new lib.StatusException(lib.Status.failed("Parent doesn't manage descendents"));
+ }
+ ret=true;
+ }
+ return ret;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleExtendedComponent.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleExtendedComponent.java
new file mode 100644
index 000000000000..52e3934ea7bd
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleExtendedComponent.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleExtendedComponent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import lib.MultiMethodTest;
+import drafts.com.sun.star.accessibility.XAccessibleExtendedComponent;
+import drafts.com.sun.star.accessibility.XAccessibleStateSet;
+import drafts.com.sun.star.accessibility.AccessibleStateType;
+import com.sun.star.awt.XFont;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+ * Testing <code>com.sun.star.accessibility.XAccessibleExtendedComponent</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getForeground()</code></li>
+ * <li><code> getBackground()</code></li>
+ * <li><code> getFont()</code></li>
+ * <li><code> isEnabled()</code></li>
+ * <li><code> getTitledBorderText()</code></li>
+ * <li><code> getToolTipText()</code></li>
+ * </ul> <p>
+ * @see com.sun.star.accessibility.XAccessibleExtendedComponent
+ */
+public class _XAccessibleExtendedComponent extends MultiMethodTest {
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleExtendedComponent" ;
+
+ public XAccessibleExtendedComponent oObj = null;
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ /**
+ * Just calls the method.
+ * deprecated from version srx644g 29.10.02 on
+ *
+ public void _getForeground() {
+ int forColor = oObj.getForeground();
+ log.println("getForeground(): " + forColor);
+ tRes.tested("getForeground()", true);
+ }
+
+ /**
+ * Just calls the method.
+ * deprecated from version srx644g 29.10.02 on
+ *
+ public void _getBackground() {
+ int backColor = oObj.getBackground();
+ log.println("getBackground(): " + backColor);
+ tRes.tested("getBackground()", true);
+ }
+
+ /**
+ * Just calls the method.
+ */
+ public void _getFont() {
+ XFont font = oObj.getFont();
+ log.println("getFont(): " + font);
+ tRes.tested("getFont()", true);
+ }
+
+ /**
+ * Calls the method and compares returned value with value that was
+ * returned by the method
+ * <code>XAccessibleStateSet.contains(AccessibleStateType.ENABLED)</code>.
+ * Has OK status if returned values are equal.
+ * deprecated from version srx644g 29.10.02 on
+ *
+ public void _isEnabled() {
+ boolean isEnabled = oObj.isEnabled();
+ log.println("isEnabled(): " + isEnabled);
+
+ boolean res = true;
+
+ XAccessibleStateSet accStateSet = (XAccessibleStateSet)
+ UnoRuntime.queryInterface(XAccessibleStateSet.class, oObj);
+
+ if (accStateSet != null) {
+ res = accStateSet.contains(AccessibleStateType.ENABLED)==isEnabled;
+ }
+
+ tRes.tested("isEnabled()", res);
+ }
+
+ /**
+ * Calls the method and checks returned value.
+ * Has OK status if returned value isn't null.
+ */
+ public void _getTitledBorderText() {
+ String titleBorderText = oObj.getTitledBorderText();
+ log.println("getTitledBorderText(): '" + titleBorderText + "'");
+ tRes.tested("getTitledBorderText()", titleBorderText != null);
+ }
+
+ /**
+ * Calls the method and checks returned value.
+ * Has OK status if returned value isn't null.
+ */
+ public void _getToolTipText() {
+ String toolTipText = oObj.getToolTipText();
+ log.println("getToolTipText(): '" + toolTipText + "'");
+ tRes.tested("getToolTipText()", toolTipText != null);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleImage.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleImage.java
new file mode 100644
index 000000000000..ab1a2b7668a8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleImage.java
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleImage.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import lib.MultiMethodTest;
+import drafts.com.sun.star.accessibility.XAccessibleImage;
+
+/**
+ * Testing <code>com.sun.star.accessibility.XAccessibleImage</code>
+ * interface methods :
+ * <ul>
+ * <li><code>getAccessibleImageDescription()</code></li>
+ * <li><code>getAccessibleImageHeight()</code></li>
+ * <li><code>getAccessibleImageWidth()</code></li>
+ * </ul> <p>
+ * @see com.sun.star.accessibility.XAccessibleImage
+ */
+public class _XAccessibleImage extends MultiMethodTest {
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleImage";
+
+ public XAccessibleImage oObj = null;
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ /**
+ * Just calls the method.
+ */
+ public void _getAccessibleImageDescription() {
+ String descr = oObj.getAccessibleImageDescription();
+ log.println("getAccessibleImageDescription(): '" + descr + "'");
+ tRes.tested("getAccessibleImageDescription()", descr != null);
+ }
+
+ /**
+ * Just calls the method.
+ */
+ public void _getAccessibleImageHeight() {
+ int height = oObj.getAccessibleImageHeight();
+ log.println("getAccessibleImageHeight(): " + height);
+ tRes.tested("getAccessibleImageHeight()", true);
+ }
+
+ /**
+ * Just calls the method.
+ */
+ public void _getAccessibleImageWidth() {
+ int width = oObj.getAccessibleImageWidth();
+ log.println("getAccessibleImageWidth(): " + width);
+ tRes.tested("getAccessibleImageWidth()", true);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java
new file mode 100644
index 000000000000..3be48cedfd4e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java
@@ -0,0 +1,462 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleSelection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import lib.MultiMethodTest;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.uno.UnoRuntime;
+import lib.Status;
+import lib.StatusException;
+import drafts.com.sun.star.accessibility.XAccessible;
+
+/**
+ * Testing <code>com.sun.star.accessibility.XAccessibleSelection</code>
+ * interface methods :
+ * <ul>
+ * <li><code>selectAccessibleChild()</code></li>
+ * <li><code>isAccessibleChildSelected()</code></li>
+ * <li><code>clearAccessibleSelection()</code></li>
+ * <li><code>selectAllAccessible()</code></li>
+ * <li><code>getSelectedAccessibleChildCount()</code></li>
+ * <li><code>getSelectedAccessibleChild()</code></li>
+ * <li><code>deselectSelectedAccessibleChild()</code></li>
+ * </ul> <p>
+ *
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'XAccessibleSelection.multiSelection'</code>
+ * (of type <code>Boolean</code>) <b> optional </b>:
+ * Indicates whether or not mutiply children could be selected.
+ * If the relation is <code>false</code> then more than 1 child
+ * couldn't be selected. </li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.accessibility.XAccessibleSelection
+ */
+public class _XAccessibleSelection extends MultiMethodTest {
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleSelection";
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ public XAccessibleSelection oObj = null;
+
+ XAccessibleContext xAC = null;
+ int childCount;
+ protected boolean multiSelection = true;
+
+ /**
+ * Retrieves the interface <code>XAccessibleContext</code>
+ * and object relation.
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility.XAccessibleContext
+ */
+ protected void before() {
+ xAC = (XAccessibleContext)
+ UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
+ if (xAC == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't query XAccessibleContext. Test must be modified"));
+ }
+
+ Boolean b = (Boolean) tEnv.getObjRelation
+ ("XAccessibleSelection.multiSelection");
+ if (b != null) {
+ multiSelection = b.booleanValue();
+ }
+
+ childCount = xAC.getAccessibleChildCount();
+ log.println("Child count: " + childCount);
+ }
+
+ /**
+ * Selects accessible child with index some wrong indexes
+ * and with legal index.
+ * Has OK status if exception was thrown for wrong indexes
+ * and if exception wasn't thrown for correct index.
+ */
+ public void _selectAccessibleChild() {
+ boolean res = true;
+
+ try {
+ log.println("Try to select child with index " + childCount);
+ oObj.selectAccessibleChild(childCount);
+ log.println("Exception was expected");
+ res = false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res = true;
+ }
+
+ try {
+ log.println("Try to select child with index -1");
+ oObj.selectAccessibleChild(-1);
+ log.println("Exception was expected");
+ res = false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ if (childCount > 0) {
+ try {
+ log.println("Select child with index " + (childCount-1));
+ oObj.selectAccessibleChild(childCount - 1);
+ res &= true;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+ }
+
+ tRes.tested("selectAccessibleChild()", res);
+ }
+
+ /**
+ * Calls the method with the wrong index and with the correct index.
+ * Has OK status if exception was thrown for wrong index and
+ * if exception wasn't thrown for the correct index.
+ */
+ public void _isAccessibleChildSelected() {
+ executeMethod("selectAccessibleChild()");
+ boolean res = true;
+ boolean isSelected = false;
+
+
+ try {
+ log.print("isAccessibleChildSelected(-1)? ");
+ isSelected = oObj.isAccessibleChildSelected(-1);
+ log.println(res);
+ log.println("Exception was expected");
+ res = false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res = true;
+ }
+
+ try {
+ log.print("isAccessibleChildSelected(" + childCount + ")? ");
+ isSelected = oObj.isAccessibleChildSelected(childCount);
+ log.println(isSelected);
+ log.println("Exception was expected");
+ res = false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ if (childCount > 0) {
+ try {
+ log.print("isAccessibleChildSelected(" + (childCount-1)+ ")? ");
+ isSelected = oObj.isAccessibleChildSelected(childCount - 1);
+ log.println(isSelected);
+ res &= isSelected;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+ }
+
+ tRes.tested("isAccessibleChildSelected()", res);
+ }
+
+ /**
+ * Calls the method.
+ * Has OK status if the method <code>isAccessibleChildSelected()</code>
+ * returned <code>false</code>.
+ */
+ public void _clearAccessibleSelection() {
+ executeMethod("isAccessibleChildSelected()");
+ boolean res = true;
+
+ log.println("clearAccessibleSelection");
+ oObj.clearAccessibleSelection();
+
+ // clearAccessibleSelection() call is oneway so we need
+ // some waiting
+ shortWait();
+
+ if (childCount > 0) {
+ try {
+ log.print("isAccessibleChildSelected(" +(childCount-1)+")? ");
+ boolean isSel = oObj.isAccessibleChildSelected(childCount - 1);
+ log.println(isSel);
+ res = !isSel;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+ }
+
+ tRes.tested("clearAccessibleSelection()", res);
+ }
+
+ /**
+ * Calls the method.
+ * Has OK status if the method <code>isAccessibleChildSelected()</code>
+ * returns <code>true</code> for first and for last accessible child
+ * or if multiselection is not allowed.
+ */
+ public void _selectAllAccessible() {
+ executeMethod("clearAccessibleSelection()");
+
+ log.println("selectAllAccessible...");
+ oObj.selectAllAccessible();
+
+ // selectAllAccessible() call is oneway so we need
+ // some waiting
+ shortWait();
+
+ boolean res = true;
+ boolean isSelected = true;
+
+ if (childCount > 0 && multiSelection) {
+ try {
+ log.print("isAccessibleChildSelected(1)? ");
+ isSelected = oObj.isAccessibleChildSelected(1);
+ log.println(isSelected);
+ res = isSelected;
+
+ log.print("isAccessibleChildSelected(" + (childCount-1) + ")? ");
+ isSelected = oObj.isAccessibleChildSelected(childCount-1);
+ log.println(isSelected);
+ res &= isSelected;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+ }
+
+ tRes.tested("selectAllAccessible()", res);
+ }
+
+ /**
+ * Calls the method. Clears accessible selection and calls the method again.
+ * <p>
+ * Has OK status if the method returns number equal to number of accessible
+ * child count after first call if multiselection allowed, or
+ * 1 returned if multiselection not allowed.
+ * And if the method returns a zero after clearing selection.
+ */
+ public void _getSelectedAccessibleChildCount() {
+ requiredMethod("selectAllAccessible()");
+
+ log.println("getSelectedAccessibleChildCount: ");
+ int sCount = chkSelectable(tEnv.getTestObject());
+ log.println("Found "+sCount+" selectable Childs");
+ int selectedCount = oObj.getSelectedAccessibleChildCount();
+ log.println("After selecting all accessible "+selectedCount+" are selected");
+
+ boolean res = true;
+ if (multiSelection) {
+ res &= selectedCount == sCount;
+ } else {
+ res &= selectedCount == 1;
+ }
+
+ log.println("clearAccessibleSelection...");
+ oObj.clearAccessibleSelection();
+ log.print("getSelectedAccessibleChildCount: ");
+ selectedCount = oObj.getSelectedAccessibleChildCount();
+ log.println(selectedCount);
+ res &= selectedCount == 0;
+
+ tRes.tested("getSelectedAccessibleChildCount()", res);
+ }
+
+ /**
+ * Calls the method with wrong and correct indexes.
+ * Has OK status if exception was thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if the method have returned a not null for the correct index.
+ */
+ public void _getSelectedAccessibleChild() {
+ executeMethod("getSelectedAccessibleChildCount()");
+
+ boolean res = true;
+ int selectedCount = oObj.getSelectedAccessibleChildCount();
+ log.println("getSelectedAccessibleChildCount: " + selectedCount);
+
+ try {
+ log.println("getSelectedAccessibleChild(-1)");
+ oObj.getSelectedAccessibleChild(-1);
+ log.println("Exception was expected");
+ res = false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res = true;
+ }
+
+ try {
+ log.println("getSelectedAccessibleChild("+selectedCount+")");
+ oObj.getSelectedAccessibleChild(selectedCount);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ if (childCount > 0) {
+ try {
+ log.println("selectAccessibleChild(" + (childCount-1) + ")");
+ oObj.selectAccessibleChild(childCount - 1);
+ log.println("getSelectedAccessibleChild(0)");
+ XAccessible selChild = oObj.getSelectedAccessibleChild(0);
+ res &= selChild != null;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+ }
+
+ tRes.tested("getSelectedAccessibleChild()", res);
+ }
+
+ /**
+ * Calls the method with wrong and with correct indexes.
+ * Has OK status if exceptions were thrown for the calls with
+ * the wrong indexes, if exception wasn't thrown for the call
+ * with correct index and if number of selected child was
+ * decreased after the correct call.
+ */
+ public void _deselectSelectedAccessibleChild() {
+ executeMethod("getSelectedAccessibleChild()");
+
+ boolean res = true;
+ int selCount = oObj.getSelectedAccessibleChildCount();
+ log.println("getSelectedAccessibleChildCount():" + selCount);
+
+ try {
+ log.println("deselectSelectedAccessibleChild(-1)");
+ oObj.deselectSelectedAccessibleChild(-1);
+ log.println("Exception was expected");
+ res = false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.println("deselectSelectedAccessibleChild(" +(childCount+1) + ")");
+ oObj.deselectSelectedAccessibleChild(childCount + 1);
+ log.println("Exception was expected");
+ res = false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+ log.println("Selecting all accessible");
+ oObj.selectAllAccessible();
+ selCount = oObj.getSelectedAccessibleChildCount();
+ log.println("getSelectedAccessibleChildCount():" + selCount);
+
+ if (childCount > 0 && selCount > 0) {
+ try {
+ log.println("deselectSelectedAccessibleChild(" +(selCount-1) + ")");
+ oObj.deselectSelectedAccessibleChild(selCount-1);
+ int newSelCount = oObj.getSelectedAccessibleChildCount();
+ log.println("getSelectedAccessibleChildCount():" + newSelCount);
+ res &= (selCount > newSelCount);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+ }
+
+ tRes.tested("deselectSelectedAccessibleChild()", res);
+ }
+
+ protected static int chkSelectable(Object Testcase) {
+ int ret = 0;
+ XAccessibleContext accCon = (XAccessibleContext)
+ UnoRuntime.queryInterface(XAccessibleContext.class,Testcase);
+ int cc= accCon.getAccessibleChildCount();
+ if (cc > 500) return cc;
+ for (int i=0;i<cc;i++) {
+ try {
+ if (accCon.getAccessibleChild(i).getAccessibleContext().getAccessibleStateSet().contains(
+ drafts.com.sun.star.accessibility.AccessibleStateType.SELECTABLE)){
+ ret = ret + 1;
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iab) {}
+ }
+ return ret;
+ }
+
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ }
+ catch (InterruptedException ex) {}
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleTable.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleTable.java
new file mode 100644
index 000000000000..7d7c645fe33c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleTable.java
@@ -0,0 +1,1050 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleTable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import lib.MultiMethodTest;
+import drafts.com.sun.star.accessibility.XAccessibleTable;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+ * Testing <code>com.sun.star.accessibility.XAccessibleTable</code>
+ * interface methods :
+ * <ul>
+ * <li><code>getAccessibleRowCount()</code></li>
+ * <li><code>getAccessibleColumnCount()</code></li>
+ * <li><code>getAccessibleRowDescription()</code></li>
+ * <li><code>getAccessibleColumnDescription()</code></li>
+ * <li><code>getAccessibleRowExtentAt()</code></li>
+ * <li><code>getAccessibleColumnExtentAt()</code></li>
+ * <li><code>getAccessibleRowHeaders()</code></li>
+ * <li><code>getAccessibleColumnHeaders()</code></li>
+ * <li><code>getSelectedAccessibleRows()</code></li>
+ * <li><code>getSelectedAccessibleColumns()</code></li>
+ * <li><code>isAccessibleRowSelected()</code></li>
+ * <li><code>isAccessibleColumnSelected()</code></li>
+ * <li><code>getAccessibleCellAt()</code></li>
+ * <li><code>getAccessibleCaption()</code></li>
+ * <li><code>getAccessibleSummary()</code></li>
+ * <li><code>isAccessibleSelected()</code></li>
+ * <li><code>getAccessibleIndex()</code></li>
+ * <li><code>getAccessibleRow()</code></li>
+ * <li><code>getAccessibleColumn()</code></li>
+ * </ul> <p>
+ * @see com.sun.star.accessibility.XAccessibleTable
+ */
+public class _XAccessibleTable extends MultiMethodTest {
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleTable";
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ public XAccessibleTable oObj = null;
+ XAccessibleSelection xASel = null;
+ XAccessibleContext xACont = null;
+
+ protected void before() {
+ xASel = (XAccessibleSelection)
+ UnoRuntime.queryInterface(XAccessibleSelection.class, oObj);
+ if (xASel == null) {
+ log.println("The component doesn't implement the interface " +
+ "XAccessibleSelection.");
+ log.println("This interface is required for more detailed tests.");
+ }
+
+ xACont = (XAccessibleContext)
+ UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
+ }
+
+ int rowCount = 0;
+
+ /**
+ * Calls the method and stores the returned value to the variable
+ * <code>rowCount</code>.
+ */
+ public void _getAccessibleRowCount() {
+ rowCount = oObj.getAccessibleRowCount();
+ log.println("Accessible row count: " + rowCount);
+ tRes.tested("getAccessibleRowCount()", true);
+ }
+
+ int colCount = 0;
+
+ /**
+ * Calls the method and stores the returned value to the variable
+ * <code>colCount</code>.
+ */
+ public void _getAccessibleColumnCount() {
+ colCount = oObj.getAccessibleColumnCount();
+ log.println("Accessible column count: " + colCount);
+ tRes.tested("getAccessibleColumnCount()", true);
+ }
+
+ /**
+ * Calls the method with the wrong indexes and with the correct index,
+ * checks a returned value.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value isn't <code>null</code>.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleRowCount()</code> </li>
+ * </ul>
+ */
+ public void _getAccessibleRowDescription() {
+ requiredMethod("getAccessibleRowCount()");
+ boolean res = true;
+
+ try {
+ log.print("getAccessibleRowDescription(-1): ");
+ String descr = oObj.getAccessibleRowDescription(-1);
+ log.println("'" + descr + "'");
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleRowDescription(" + rowCount + "): ");
+ String descr = oObj.getAccessibleRowDescription(rowCount);
+ log.println("'" + descr + "'");
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleRowDescription(" + (rowCount - 1) + "): ");
+ String descr =
+ oObj.getAccessibleRowDescription(rowCount - 1);
+ res &= descr != null;
+ log.println("'" + descr + "'");
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getAccessibleRowDescription()", res);
+ }
+
+ /**
+ * Calls the method with the wrong indexes and with the correct index,
+ * checks a returned value.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value isn't <code>null</code>.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleColumnCount()</code> </li>
+ * </ul>
+ */
+ public void _getAccessibleColumnDescription() {
+ requiredMethod("getAccessibleColumnCount()");
+ boolean res = true;
+
+ try {
+ log.print("getAccessibleColumnDescription(-1): ");
+ String descr = oObj.getAccessibleColumnDescription(-1);
+ log.println("'" + descr + "'");
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleColumnDescription(" + colCount + "): ");
+ String descr = oObj.getAccessibleColumnDescription(colCount);
+ log.println("'" + descr + "'");
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleColumnDescription(" + (colCount - 1) + "): ");
+ String descr =
+ oObj.getAccessibleColumnDescription(colCount - 1);
+ res &= descr != null;
+ log.println("'" + descr + "'");
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getAccessibleColumnDescription()", res);
+ }
+
+
+ /**
+ * Calls the method with the wrong parameters and with the correct
+ * parameters, checks a returned value.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value is greater than or is equal to 1.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleColumnCount()</code> </li>
+ * <li> <code>getAccessibleRowCount()</code> </li>
+ * </ul>
+ */
+ public void _getAccessibleRowExtentAt() {
+ requiredMethod("getAccessibleRowCount()");
+ requiredMethod("getAccessibleColumnCount()");
+ boolean res = true;
+
+ try {
+ log.print("getAccessibleRowExtentAt(-1," + (colCount-1) + "):");
+ int ext = oObj.getAccessibleRowExtentAt(-1, colCount - 1);
+ log.println(ext);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleRowExtentAt(" + (rowCount-1) + ",-1):");
+ int ext = oObj.getAccessibleRowExtentAt(rowCount - 1, -1);
+ log.println(ext);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleRowExtentAt(0," + colCount + "):");
+ int ext = oObj.getAccessibleRowExtentAt(0, colCount);
+ log.println(ext);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleRowExtentAt(" + rowCount + ",0):");
+ int ext = oObj.getAccessibleRowExtentAt(rowCount, 0);
+ log.println(ext);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleRowExtentAt(" +
+ (rowCount-1) + "," + (colCount-1) + "):");
+ int ext = oObj.getAccessibleRowExtentAt(rowCount-1, colCount - 1);
+ log.println(ext);
+ res &= ext >= 1;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getAccessibleRowExtentAt()", res);
+ }
+
+ /**
+ * Calls the method with the wrong parameters and with the correct
+ * parameters, checks a returned value.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value is greater than or is equal to 1.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleColumnCount()</code> </li>
+ * <li> <code>getAccessibleRowCount()</code> </li>
+ * </ul>
+ */
+ public void _getAccessibleColumnExtentAt() {
+ requiredMethod("getAccessibleRowCount()");
+ requiredMethod("getAccessibleColumnCount()");
+ boolean res = true;
+
+ try {
+ log.print("getAccessibleColumnExtentAt(-1," + (colCount-1) + "):");
+ int ext = oObj.getAccessibleColumnExtentAt(-1, colCount - 1);
+ log.println(ext);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleColumnExtentAt(" + (rowCount-1) + ",-1):");
+ int ext = oObj.getAccessibleColumnExtentAt(rowCount - 1, -1);
+ log.println(ext);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleColumnExtentAt(0," + colCount + "):");
+ int ext = oObj.getAccessibleColumnExtentAt(0, colCount);
+ log.println(ext);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleColumnExtentAt(" + rowCount + ",0):");
+ int ext = oObj.getAccessibleColumnExtentAt(rowCount, 0);
+ log.println(ext);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleColumnExtentAt(" +
+ (rowCount-1) + "," + (colCount-1) + "):");
+ int ext = oObj.getAccessibleColumnExtentAt(rowCount-1,colCount - 1);
+ log.println(ext);
+ res &= ext >= 1;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getAccessibleColumnExtentAt()", res);
+ }
+
+ /**
+ * Calls the method and checks a returned value.
+ * Has OK status if returned value isn't <code>null</code>.
+ */
+ public void _getAccessibleRowHeaders() {
+ XAccessibleTable rowHeaders = oObj.getAccessibleRowHeaders();
+ log.println("getAccessibleRowHeaders(): " + rowHeaders);
+ tRes.tested("getAccessibleRowHeaders()", true);
+ }
+
+ /**
+ * Calls the method and checks a returned value.
+ * Has OK status if returned value isn't <code>null</code>.
+ */
+ public void _getAccessibleColumnHeaders() {
+ XAccessibleTable colHeaders = oObj.getAccessibleColumnHeaders();
+ log.println("getAccessibleColumnHeaders(): " + colHeaders);
+ tRes.tested("getAccessibleColumnHeaders()", true);
+ }
+
+ /**
+ * If the interface <code>XAccessibleSelection</code> is supported by
+ * the component than selects all accessible childs.
+ * Calls the method and checks a returned sequence.
+ * Has OK status if a returned sequince is in ascending order.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleRowCount()</code> </li>
+ * </ul>
+ */
+ public void _getSelectedAccessibleRows() {
+ requiredMethod("getAccessibleRowCount()");
+ boolean res = true;
+ boolean locRes = true;
+ int selRows[] = null;
+
+ if (xASel != null) {
+ log.println("XAccessibleSelection.selectAllAccessible()");
+ xASel.selectAllAccessible();
+ }
+
+ log.println("getSelectedAccessibleRows()");
+ selRows = oObj.getSelectedAccessibleRows();
+ log.println("Length of the returned sequince: " + selRows.length);
+ if (xASel != null) {
+ res &= selRows.length == rowCount;
+ } else {
+ res &= selRows.length == 0;
+ }
+
+ if (selRows.length > 0) {
+ log.println("Checking that returned sequence is" +
+ " in ascending order");
+ }
+
+ for(int i = 1; i < selRows.length; i++) {
+ locRes &= selRows[i] >= selRows[i - 1];
+ res &= locRes;
+ if (!locRes) {
+ log.println("Element #" + i + ":" + selRows[i] +
+ " is less than element #" + (i-1) + ": " +
+ selRows[i-1]);
+ break;
+ }
+ }
+
+ tRes.tested("getSelectedAccessibleRows()", res);
+ }
+
+ /**
+ * If the interface <code>XAccessibleSelection</code> is supported by
+ * the component than selects all accessible childs.
+ * Calls the method and checks a returned sequence.
+ * Has OK status if a returned sequince is in ascending order.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleColumnCount()</code> </li>
+ * </ul>
+ */
+ public void _getSelectedAccessibleColumns() {
+ requiredMethod("getAccessibleColumnCount()");
+ boolean res = true;
+ boolean locRes = true;
+ int selCols[] = null;
+
+ if (xASel != null) {
+ log.println("XAccessibleSelection.selectAllAccessible()");
+ xASel.selectAllAccessible();
+ }
+
+ log.println("getSelectedAccessibleColumns()");
+ selCols = oObj.getSelectedAccessibleColumns();
+ log.println("Length of the returned sequince: " + selCols.length);
+
+ if (xASel != null) {
+ res &= selCols.length == colCount;
+ } else {
+ res &= selCols.length == 0;
+ }
+
+ if (selCols.length > 0) {
+ log.println("Checking that returned sequence is" +
+ " in ascending order");
+ }
+
+ for(int i = 1; i < selCols.length; i++) {
+ locRes &= selCols[i] >= selCols[i - 1];
+ res &= locRes;
+ if (!locRes) {
+ log.println("Element #" + i + ":" + selCols[i] +
+ " is less than element #" + (i-1) + ": " +
+ selCols[i-1]);
+ break;
+ }
+ }
+
+ tRes.tested("getSelectedAccessibleColumns()", res);
+ }
+
+ /**
+ * Calls the method with invalid indexes.
+ * If the interface <code>XAccessibleSelection</code> is supported by
+ * the component than selects all accessible childs.
+ * Calls the method for every row and checks returned values.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleRowCount()</code> </li>
+ * </ul>
+ */
+ public void _isAccessibleRowSelected() {
+ requiredMethod("getAccessibleRowCount()");
+ boolean res = true;
+ boolean locRes = true;
+
+ try {
+ log.print("isAccessibleRowSelected(-1): ");
+ locRes = oObj.isAccessibleRowSelected(-1);
+ log.println(locRes);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("isAccessibleRowSelected(" + rowCount + "): ");
+ locRes = oObj.isAccessibleRowSelected(rowCount);
+ log.println(locRes);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ if (xASel != null) {
+ log.println("XAccessibleSelection.selectAllAccessible()");
+ xASel.selectAllAccessible();
+ }
+
+ try {
+ log.println("Checking of every row selection...");
+ for(int i = 0; i < rowCount; i++) {
+ boolean isSel = oObj.isAccessibleRowSelected(i);
+ locRes = (xASel == null) ? !isSel : isSel;
+ res &= locRes;
+ if (!locRes) {
+ log.println("isAccessibleRowSelected(" + i + "): " + isSel);
+ break;
+ }
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("isAccessibleRowSelected()", res);
+ }
+
+ /**
+ * Calls the method with invalid indexes.
+ * If the interface <code>XAccessibleSelection</code> is supported by
+ * the component than selects all accessible childs.
+ * Calls the method for every column and checks returned values.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleRowCount()</code> </li>
+ * </ul>
+ */
+ public void _isAccessibleColumnSelected() {
+ requiredMethod("getAccessibleColumnCount()");
+ boolean res = true;
+ boolean locRes = true;
+
+ try {
+ log.print("isAccessibleColumnSelected(-1): ");
+ locRes = oObj.isAccessibleColumnSelected(-1);
+ log.println(locRes);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("isAccessibleColumnSelected(" + colCount + "): ");
+ locRes = oObj.isAccessibleColumnSelected(colCount);
+ log.println(locRes);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ if (xASel != null) {
+ log.println("XAccessibleSelection.selectAllAccessible()");
+ xASel.selectAllAccessible();
+ }
+
+ try {
+ log.println("Checking of every column selection...");
+ for(int i = 0; i < colCount; i++) {
+ boolean isSel = oObj.isAccessibleColumnSelected(i);
+ locRes = (xASel == null) ? !isSel : isSel;
+ res &= locRes;
+ if (!locRes) {
+ log.println("isAccessibleColumnSelected(" + i + "): " + isSel);
+ break;
+ }
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("isAccessibleColumnSelected()", res);
+ }
+
+ XAccessible xCellAc = null;
+
+ /**
+ * Calls the method with the wrong parameters and with the correct
+ * parameter, checks a returned value and stores it to the variable
+ * <code>xCellAc</code>.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value isn't null.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleColumnCount()</code> </li>
+ * <li> <code>getAccessibleRowCount()</code> </li>
+ * </ul>
+ */
+ public void _getAccessibleCellAt() {
+ requiredMethod("getAccessibleRowCount()");
+ requiredMethod("getAccessibleColumnCount()");
+ boolean res = true;
+
+ try {
+ log.print("getAccessibleCellAt(-1," + (colCount-1) + "):");
+ xCellAc = oObj.getAccessibleCellAt(-1, colCount - 1);
+ log.println(xCellAc);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleCellAt(" + (rowCount-1) + ",-1):");
+ xCellAc = oObj.getAccessibleCellAt(rowCount - 1, -1);
+ log.println(xCellAc);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleCellAt(0, " + colCount + "):");
+ xCellAc = oObj.getAccessibleCellAt(0, colCount);
+ log.println(xCellAc);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleCellAt(" + rowCount + ",0):");
+ XAccessible xCellAc = oObj.getAccessibleCellAt(rowCount, 0);
+ log.println(xCellAc);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleCellAt(" + (rowCount-1) + "," +
+ (colCount-1) + "): ");
+ xCellAc = oObj.getAccessibleCellAt(
+ rowCount - 1, colCount - 1);
+ log.println(xCellAc);
+ res &= xCellAc != null;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getAccessibleCellAt()", res);
+ }
+
+ /**
+ * Just calls the method.
+ */
+ public void _getAccessibleCaption() {
+ XAccessible caption = oObj.getAccessibleCaption();
+ log.println("getAccessibleCaption(): " + caption);
+ tRes.tested("getAccessibleCaption()", true);
+ }
+
+ /**
+ * Just calls the method.
+ */
+ public void _getAccessibleSummary() {
+ XAccessible summary = oObj.getAccessibleSummary();
+ log.println("getAccessibleSummary(): " + summary);
+ tRes.tested("getAccessibleSummary()", true);
+ }
+
+ /**
+ * Calls the method with the wrong parameters and with the correct
+ * parameter, checks a returned value.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleColumnCount()</code> </li>
+ * <li> <code>getAccessibleRowCount()</code> </li>
+ * </ul>
+ */
+ public void _isAccessibleSelected() {
+ requiredMethod("getAccessibleRowCount()");
+ requiredMethod("getAccessibleColumnCount()");
+ boolean res = true;
+ boolean locRes = true;
+
+ try {
+ log.print("isAccessibleSelected(-1," + (colCount-1) + "):");
+ locRes = oObj.isAccessibleSelected(-1, colCount - 1);
+ log.println(locRes);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("isAccessibleSelected(" + (rowCount-1) + ",-1):");
+ locRes = oObj.isAccessibleSelected(rowCount - 1, -1);
+ log.println(locRes);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("isAccessibleSelected(0, " + colCount + "):");
+ locRes = oObj.isAccessibleSelected(0, colCount);
+ log.println(locRes);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("isAccessibleSelected(" + rowCount + ",0):");
+ locRes = oObj.isAccessibleSelected(rowCount, 0);
+ log.println(locRes);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ if (xASel != null) {
+ log.println("XAccessibleSelection.selectAllAccessible()");
+ xASel.selectAllAccessible();
+ }
+
+ try {
+ log.print("isAccessibleSelected(" + (rowCount-1) + "," +
+ (colCount-1) + "): ");
+ boolean isSel = oObj.isAccessibleSelected(
+ rowCount - 1, colCount - 1);
+ log.println(isSel);
+ locRes = (xASel == null) ? !isSel : isSel ;
+ res &= locRes;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("isAccessibleSelected()", res);
+ }
+
+ /**
+ * Calls the method with the wrong parameters and with the correct
+ * parameter, checks a returned value.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value is equal to value returned by calling
+ * <code>XAccessibleContext::getAccessibleIndexInParent</code> for the cell.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleCellAt()</code> </li>
+ * </ul>
+ */
+ public void _getAccessibleIndex() {
+ executeMethod("getAccessibleCellAt()");
+ boolean res = true;
+
+ try {
+ log.print("getAccessibleIndex(-1," + (colCount-1) + "):");
+ int indx = oObj.getAccessibleIndex(-1, colCount - 1);
+ log.println(indx);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleIndex(" + (rowCount-1) + ",-1):");
+ int indx = oObj.getAccessibleIndex(rowCount - 1, -1);
+ log.println(indx);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleIndex(0," + colCount + "):");
+ int indx = oObj.getAccessibleIndex(0, colCount);
+ log.println(indx);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleIndex(" + rowCount + ",0):");
+ int indx = oObj.getAccessibleIndex(rowCount, 0);
+ log.println(indx);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleIndex(" + (rowCount-1) + "," +
+ (colCount-1) + "): ");
+ int indx = oObj.getAccessibleIndex(
+ rowCount - 1, colCount - 1);
+ log.println(indx);
+ if (xCellAc != null) {
+ XAccessibleContext xAC = xCellAc.getAccessibleContext();
+ int expIndx = xAC.getAccessibleIndexInParent();
+ log.println("Expected index: " + expIndx);
+ res &= expIndx == indx;
+ } else {
+ res &= true;
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getAccessibleIndex()", res);
+ }
+
+ /**
+ * Receives an accessible child count using the interface
+ * <code>XAccessibleContext</code>.
+ * Calls the method with the wrong parameters and with the correct
+ * parameter, checks a returned value.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value is greater than zero and is less than
+ * accessible row count.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleRowCount()</code> </li>
+ * </ul>
+ */
+ public void _getAccessibleRow() {
+ requiredMethod("getAccessibleRowCount()");
+ boolean res = true;
+
+ if (xACont != null) {
+ int childCount = xACont.getAccessibleChildCount();
+ log.println("accessible child count: " + childCount);
+
+ try {
+ log.print("getAccessibleRow(" + childCount + "): ");
+ int rowIndx = oObj.getAccessibleRow(childCount);
+ log.println(rowIndx);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleRow(" + (childCount-1) + "): ");
+ int rowIndx = oObj.getAccessibleRow(childCount - 1);
+ log.println(rowIndx);
+ res &= (rowIndx >= 0 && rowIndx <= rowCount);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+ }
+
+ try {
+ log.print("getAccessibleRow(-1): ");
+ int rowIndx = oObj.getAccessibleRow(-1);
+ log.println(rowIndx);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleRow(0): ");
+ int rowIndx = oObj.getAccessibleRow(0);
+ log.println(rowIndx);
+ res &= (rowIndx >= 0 && rowIndx <= rowCount);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getAccessibleRow()", res);
+ }
+
+ /**
+ * Receives an accessible child count using the interface
+ * <code>XAccessibleContext</code>.
+ * Calls the method with the wrong parameters and with the correct
+ * parameter, checks a returned value.
+ * Has OK status if exceptions were thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value is greater than zero and is less than
+ * accessible column count.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getAccessibleColumnCount()</code> </li>
+ * </ul>
+ */
+ public void _getAccessibleColumn() {
+ requiredMethod("getAccessibleColumnCount()");
+ boolean res = true;
+
+ if (xACont != null) {
+ int childCount = xACont.getAccessibleChildCount();
+ log.println("accessible child count: " + childCount);
+
+ try {
+ log.print("getAccessibleColumn(" + childCount + "): ");
+ int colIndx = oObj.getAccessibleColumn(childCount);
+ log.println(colIndx);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleColumn(" + (childCount-1) + "): ");
+ int colIndx = oObj.getAccessibleColumn(childCount - 1);
+ log.println(colIndx);
+ res &= (colIndx >= 0 && colIndx <= colCount);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+ }
+
+ try {
+ log.print("getAccessibleColumn(-1): ");
+ int colIndx = oObj.getAccessibleColumn(-1);
+ log.println(colIndx);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getAccessibleColumn(0): ");
+ int colIndx = oObj.getAccessibleColumn(0);
+ log.println(colIndx);
+ res &= (colIndx >= 0 && colIndx <= rowCount);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getAccessibleColumn()", res);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java
new file mode 100644
index 000000000000..acc609ab1ecb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java
@@ -0,0 +1,1024 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+import drafts.com.sun.star.accessibility.XAccessibleText;
+import lib.MultiMethodTest;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.Point;
+import drafts.com.sun.star.accessibility.AccessibleTextType;
+
+/**
+ * Testing <code>com.sun.star.accessibility.XAccessibleText</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getCaretPosition()</code></li>
+ * <li><code> setCaretPosition()</code></li>
+ * <li><code> getCharacter()</code></li>
+ * <li><code> getCharacterAttributes()</code></li>
+ * <li><code> getCharacterBounds()</code></li>
+ * <li><code> getCharacterCount()</code></li>
+ * <li><code> getIndexAtPoint()</code></li>
+ * <li><code> getSelectedText()</code></li>
+ * <li><code> getSelectionStart()</code></li>
+ * <li><code> getSelectionEnd()</code></li>
+ * <li><code> setSelection()</code></li>
+ * <li><code> getText()</code></li>
+ * <li><code> getTextRange()</code></li>
+ * <li><code> getTextAtIndex()</code></li>
+ * <li><code> getTextBeforeIndex()</code></li>
+ * <li><code> getTextBehindIndex()</code></li>
+ * <li><code> copyText()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'XAccessibleText.Text'</code> (of type <code>String</code>)
+ * <b> optional </b> :
+ * the string presentation of component's text. If the relation
+ * is not specified, then text from method <code>getText()</code>
+ * is used.
+ * </li>
+ * </ul> <p>
+ * @see com.sun.star.accessibility.XAccessibleText
+ */
+public class _XAccessibleText extends MultiMethodTest {
+
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleText" ;
+
+ public XAccessibleText oObj = null;
+
+ // temporary while accessibility package is in drafts.com.sun.star
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ String text = null;
+ String editOnly = null;
+
+ /**
+ * Retrieves a string representation of the component's text.
+ * The length of retrieved string must be greater than zero.
+ */
+ protected void before() {
+ text = (String)tEnv.getObjRelation("XAccessibleText.Text");
+ if (text == null) {
+ text = oObj.getText();
+// throw new StatusException(Status.failed(
+// "Couldn't get relation 'XAccessibleText.Text'"));
+ }
+ if (text.length() == 0) {
+ throw new StatusException(Status.failed(
+ "The length of text must be greater than zero"));
+ }
+
+ editOnly = (String)tEnv.getObjRelation("EditOnly");
+
+ log.println("Text is '" + text + "'");
+ }
+
+ /**
+ * Calls the method and checks returned value.
+ * Has OK status if returned value is equal to <code>chCount - 1</code>.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>setCaretPosition()</code> </li>
+ * </ul>
+ */
+ public void _getCaretPosition() {
+ requiredMethod("getCharacterCount()");
+
+ if (editOnly != null) {
+ log.println(editOnly);
+ throw new StatusException(Status.skipped(true));
+ }
+
+ boolean res = true;
+ boolean sc = true;
+ try {
+ oObj.setCaretPosition(chCount - 1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ie) {
+
+ }
+ int carPos = oObj.getCaretPosition();
+ log.println("getCaretPosition: " + carPos);
+ if (sc) {
+ res = carPos == (chCount - 1);
+ } else {
+ log.println("Object is read only and Caret position couldn't be set");
+ res = carPos == -1;
+ }
+ tRes.tested("getCaretPosition()", res);
+ }
+
+ /**
+ * Calls the method with the wrong index and with the correct index
+ * <code>chCount - 1</code>.
+ * Has OK status if exception was thrown for wrong index and
+ * if exception wasn't thrown for the correct index.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterCount()</code> </li>
+ * </ul>
+ */
+ public void _setCaretPosition() {
+ requiredMethod("getCharacterCount()");
+ boolean res = true;
+
+ try {
+ log.print("setCaretPosition(-1):");
+ oObj.setCaretPosition(-1);
+ res &= false;
+ log.println("exception was expected");
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("setCaretPosition(chCount+1):");
+ oObj.setCaretPosition(chCount+1);
+ res &= false;
+ log.println("exception was expected");
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("expected exception");
+ res &= true;
+ }
+
+ try {
+ log.println("setCaretPosition(chCount - 1)");
+ oObj.setCaretPosition(chCount - 1);
+ res &= true;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("setCaretPosition()", res);
+ }
+
+ /**
+ * Calls the method with the wrong index and with the correct indexes.
+ * Checks every character in the text.
+ * Has OK status if exception was thrown for wrong index,
+ * if exception wasn't thrown for the correct index and
+ * if every character is equal to corresponding character in the text.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterCount()</code> </li>
+ * </ul>
+ */
+ public void _getCharacter() {
+ requiredMethod("getCharacterCount()");
+ boolean res = true;
+
+ try {
+ log.println("getCharacter(-1)");
+ oObj.getCharacter(-1);
+ log.println("Exception was expected");
+ res = false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res = true;
+ }
+
+ try {
+ log.println("getCharacter(chCount)");
+ oObj.getCharacter(chCount);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.println("Checking of every character in the text...");
+ boolean isEqCh = true;
+ for(int i = 0; i < chCount; i++) {
+ char ch = oObj.getCharacter(i);
+ isEqCh = ch == text.charAt(i);
+ res &= isEqCh;
+ if (!isEqCh) {
+ log.println("At the position " + i +
+ "was expected character: " + text.charAt(i));
+ log.println("but was returned: " + ch);
+ break;
+ }
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getCharacter()", res);
+ }
+
+ /**
+ * Calls the method with the wrong indexes and with the correct index,
+ * checks a returned value.
+ * Has OK status if exception was thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value isn't <code>null</code>.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterCount()</code> </li>
+ * </ul>
+ */
+ public void _getCharacterAttributes() {
+ requiredMethod("getCharacterCount()");
+ boolean res = true;
+
+ try {
+ log.println("getCharacterAttributes(-1)");
+ oObj.getCharacterAttributes(-1);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.println("getCharacterAttributes(chCount)");
+ oObj.getCharacterAttributes(chCount);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.println("getCharacterAttributes(chCount-1)");
+ PropertyValue[] props = oObj.getCharacterAttributes(chCount - 1);
+ res &= props != null;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getCharacterAttributes()", res);
+ }
+
+ Rectangle chBounds = null;
+
+ /**
+ * Calls the method with the wrong indexes and with the correct index.
+ * checks and stores a returned value.
+ * Has OK status if exception was thrown for the wrong indexes,
+ * if exception wasn't thrown for the correct index and
+ * if returned value isn't <code>null</code>.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterCount()</code> </li>
+ * </ul>
+ */
+ public void _getCharacterBounds() {
+ requiredMethod("getCharacterCount()");
+ boolean res = true;
+
+ try {
+ log.println("getCharacterBounds(-1)");
+ oObj.getCharacterBounds(-1);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.println("getCharacterBounds(chCount)");
+ oObj.getCharacterBounds(chCount);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.println("getCharacterBounds(chCount-1)");
+ chBounds = oObj.getCharacterBounds(chCount-1);
+ res &= chBounds != null;
+ log.println("rect: " + chBounds.X + ", " + chBounds.Y + ", " +
+ chBounds.Width + ", " + chBounds.Height);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getCharacterBounds()", res);
+ }
+
+ int chCount = 0;
+
+ /**
+ * Calls the method and stores a returned value to the variable
+ * <code>chCount</code>.
+ * Has OK status if a returned value is equal to the text length.
+ */
+ public void _getCharacterCount() {
+ chCount = oObj.getCharacterCount();
+ log.println("Character count:" + chCount);
+ boolean res = chCount == text.length();
+ tRes.tested("getCharacterCount()", res);
+ }
+
+ /**
+ * Calls the method for an invalid point and for the point of rectangle
+ * returned by the method <code>getCharacterBounds()</code>.
+ * Has OK status if returned value is equal to <code>-1</code> for an
+ * invalid point and if returned value is equal to <code>chCount-1</code>
+ * for a valid point.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterBounds()</code> </li>
+ * </ul>
+ */
+ public void _getIndexAtPoint() {
+ requiredMethod("getCharacterBounds()");
+
+ boolean res = true;
+ log.print("getIndexAtPoint(-1, -1):");
+ Point pt = new Point(-1, -1);
+ int index = oObj.getIndexAtPoint(pt);
+ log.println(index);
+ res &= index == -1;
+
+ pt = new Point(chBounds.X , chBounds.Y );
+ log.print("getIndexAtPoint(" + pt.X + ", " + pt.Y + "):");
+ index = oObj.getIndexAtPoint(pt);
+ log.println(index);
+ res &= index == (chCount - 1);
+
+ tRes.tested("getIndexAtPoint()", res);
+ }
+
+ /**
+ * Checks a returned values after different calls of the method
+ * <code>setSelection()</code>.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>setSelection()</code> </li>
+ * </ul>
+ */
+ public void _getSelectedText() {
+ if (editOnly != null) {
+ log.println(editOnly);
+ throw new StatusException(Status.skipped(true));
+ }
+
+ requiredMethod("setSelection()");
+ boolean res = true;
+
+ try {
+ log.println("setSelection(0, 0)");
+ oObj.setSelection(0, 0);
+ log.print("getSelectedText():");
+ String txt = oObj.getSelectedText();
+ log.println("'" + txt + "'");
+ res &= txt.length() == 0;
+
+ log.println("setSelection(0, chCount)");
+ oObj.setSelection(0, chCount);
+ log.print("getSelectedText():");
+ txt = oObj.getSelectedText();
+ log.println("'" + txt + "'");
+ res &= txt.equals(text);
+
+ if (chCount > 2) {
+ log.println("setSelection(1, chCount-1)");
+ oObj.setSelection(1, chCount - 1);
+ log.print("getSelectedText():");
+ txt = oObj.getSelectedText();
+ log.println("'" + txt + "'");
+ res &= txt.equals(text.substring(1, chCount - 1));
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getSelectedText()", res);
+ }
+
+ /**
+ * Checks a returned values after different calls of the method
+ * <code>setSelection()</code>.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>setSelection()</code> </li>
+ * </ul>
+ */
+ public void _getSelectionStart() {
+ if (editOnly != null) {
+ log.println(editOnly);
+ throw new StatusException(Status.skipped(true));
+ }
+
+ requiredMethod("setSelection()");
+ boolean res = true;
+
+ try {
+ log.println("setSelection(0, chCount)");
+ oObj.setSelection(0, chCount);
+ int start = oObj.getSelectionStart();
+ log.println("getSelectionStart():" + start);
+ res &= start == 0;
+
+ if (chCount > 2) {
+ log.println("setSelection(1, chCount-1)");
+ oObj.setSelection(1, chCount - 1);
+ start = oObj.getSelectionStart();
+ log.println("getSelectionStart():" + start);
+ res &= start == 1;
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getSelectionStart()", res);
+ }
+
+ /**
+ * Checks a returned values after different calls of the method
+ * <code>setSelection()</code>.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>setSelection()</code> </li>
+ * </ul>
+ */
+ public void _getSelectionEnd() {
+ if (editOnly != null) {
+ log.println(editOnly);
+ throw new StatusException(Status.skipped(true));
+ }
+
+ requiredMethod("setSelection()");
+ boolean res = true;
+
+ try {
+ log.println("setSelection(0, chCount)");
+ oObj.setSelection(0, chCount);
+ int end = oObj.getSelectionEnd();
+ log.println("getSelectionEnd():" + end);
+ res &= end == chCount;
+
+ if (chCount > 2) {
+ log.println("setSelection(1, chCount-1)");
+ oObj.setSelection(1, chCount - 1);
+ end = oObj.getSelectionEnd();
+ log.println("getSelectionEnd():" + end);
+ res &= end == chCount - 1;
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getSelectionEnd()", res);
+ }
+
+ /**
+ * Calls the method with invalid parameters an with valid parameters.
+ * Has OK status if exception was thrown for invalid parameters,
+ * if exception wasn't thrown for valid parameters.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterCount()</code> </li>
+ * </ul>
+ */
+ public void _setSelection() {
+ requiredMethod("getCharacterCount()");
+ boolean res = true;
+ boolean locRes = true;
+
+ if (editOnly != null) {
+ log.println(editOnly);
+ throw new StatusException(Status.skipped(true));
+ }
+
+ try {
+ log.print("setSelection(-1, chCount-1):");
+ locRes = oObj.setSelection(-1, chCount - 1);
+ log.println(locRes + " excepion was expected");
+ res &= !locRes;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("setSelection(0, chCount+1):");
+ locRes = oObj.setSelection(0, chCount + 1);
+ log.println(locRes + " excepion was expected");
+ res &= !locRes;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ if (chCount > 2) {
+ log.print("setSelection(1, chCount-1):");
+ locRes = oObj.setSelection(1, chCount - 1);
+ log.println(locRes);
+ res &= locRes;
+
+ log.print("setSelection(chCount-1, 1):");
+ locRes = oObj.setSelection(chCount - 1, 1);
+ log.println(locRes);
+ res &= locRes;
+ }
+
+ log.print("setSelection(0, chCount-1):");
+ locRes = oObj.setSelection(0, chCount-1);
+ log.println(locRes);
+ res &= locRes;
+
+ log.print("setSelection(chCount-1, 0):");
+ locRes = oObj.setSelection(chCount-1, 0);
+ log.println(locRes);
+ res &= locRes;
+
+ log.print("setSelection(0, 0):");
+ locRes = oObj.setSelection(0, 0);
+ log.println(locRes);
+ res &= locRes;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("setSelection()", res);
+ }
+
+ /**
+ * Calls the method and checks returned value.
+ * Has OK status if returned string is equal to string
+ * received from relation.
+ */
+ public void _getText() {
+ String txt = oObj.getText();
+ log.println("getText: " + txt);
+ boolean res = txt.equals(text);
+ tRes.tested("getText()", res);
+ }
+
+ /**
+ * Calls the method with invalid parameters an with valid parameters,
+ * checks returned values.
+ * Has OK status if exception was thrown for invalid parameters,
+ * if exception wasn't thrown for valid parameters and if returned values
+ * are equal to corresponding substrings of the text received by relation.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterCount()</code> </li>
+ * </ul>
+ */
+ public void _getTextRange() {
+ requiredMethod("getCharacterCount()");
+ boolean res = true;
+ boolean locRes = true;
+
+ try {
+ if (chCount > 3) {
+ log.print("getTextRange(1, chCount - 2): ");
+ String txtRange = oObj.getTextRange(1, chCount - 2);
+ log.println(txtRange);
+ locRes = txtRange.equals(text.substring(1, chCount - 2));
+ res &= locRes;
+ if (!locRes) {
+ log.println("Was expected: " +
+ text.substring(1, chCount - 2));
+ }
+ }
+
+ log.print("getTextRange(0, chCount-1): ");
+ String txtRange = oObj.getTextRange(0, chCount-1);
+ log.println(txtRange);
+ locRes = txtRange.equals(text.substring(0, chCount - 1));
+ res &= locRes;
+ if (!locRes) {
+ log.println("Was expected: " +
+ text.substring(0, chCount - 1));
+ }
+
+ log.print("getTextRange(chCount, 0): ");
+ txtRange = oObj.getTextRange(chCount, 0);
+ log.println(txtRange);
+ res &= txtRange.equals(text);
+
+ log.print("getTextRange(0, 0): ");
+ txtRange = oObj.getTextRange(0, 0);
+ log.println(txtRange);
+ locRes = txtRange.equals("");
+ res &= locRes;
+ if (!locRes) {
+ log.println("Empty string was expected");
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ try {
+ log.print("getTextRange(-1, chCount - 1): ");
+ String txtRange = oObj.getTextRange(-1, chCount - 1);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getTextRange(0, chCount + 1): ");
+ String txtRange = oObj.getTextRange(0, chCount + 1);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getTextRange(chCount+1, -1): ");
+ String txtRange = oObj.getTextRange(chCount+1, -1);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ tRes.tested("getTextRange()", res);
+ }
+
+ /**
+ * Calls the method with invalid parameters an with valid parameters,
+ * checks returned values.
+ * Has OK status if exception was thrown for invalid parameters,
+ * if exception wasn't thrown for valid parameters and if returned values
+ * are equal to corresponding substrings of the text received by relation.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterCount()</code> </li>
+ * </ul>
+ */
+ public void _getTextAtIndex() {
+ requiredMethod("getCharacterCount()");
+ boolean res = true;
+
+ try {
+ log.print("getTextAtIndex(-1, AccessibleTextType.PARAGRAPH):");
+ String txt = oObj.getTextAtIndex(-1, AccessibleTextType.PARAGRAPH);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getTextAtIndex(chCount+1," +
+ " AccessibleTextType.PARAGRAPH):");
+ String txt = oObj.getTextAtIndex(chCount + 1,
+ AccessibleTextType.PARAGRAPH);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getTextAtIndex(chCount," +
+ " AccessibleTextType.PARAGRAPH):");
+ String txt = oObj.getTextAtIndex(chCount,
+ AccessibleTextType.PARAGRAPH);
+ log.println("'" + txt + "'");
+ res &= txt.length() == 0;
+
+ log.print("getTextAtIndex(1," +
+ " AccessibleTextType.PARAGRAPH):");
+ txt = oObj.getTextAtIndex(1,
+ AccessibleTextType.PARAGRAPH);
+ log.println("'" + txt + "'");
+ res &= txt.equals(text);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getTextAtIndex()", res);
+ }
+
+ /**
+ * Calls the method with invalid parameters an with valid parameters,
+ * checks returned values.
+ * Has OK status if exception was thrown for invalid parameters,
+ * if exception wasn't thrown for valid parameters and if returned values
+ * are equal to corresponding substrings of the text received by relation.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterCount()</code> </li>
+ * </ul>
+ */
+ public void _getTextBeforeIndex() {
+ requiredMethod("getCharacterCount()");
+ boolean res = true;
+
+ try {
+ log.print("getTextBeforeIndex(-1, AccessibleTextType.PARAGRAPH):");
+ String txt = oObj.getTextBeforeIndex(-1,
+ AccessibleTextType.PARAGRAPH);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getTextBeforeIndex(chCount+1, " +
+ "AccessibleTextType.PARAGRAPH):");
+ String txt = oObj.getTextBeforeIndex(chCount + 1,
+ AccessibleTextType.PARAGRAPH);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getTextBeforeIndex(chCount," +
+ " AccessibleTextType.PARAGRAPH):");
+ String txt = oObj.getTextBeforeIndex(chCount,
+ AccessibleTextType.PARAGRAPH);
+ log.println("'" + txt + "'");
+ res &= txt.length() == chCount ;
+
+ log.print("getTextBeforeIndex(1," +
+ " AccessibleTextType.PARAGRAPH):");
+ txt = oObj.getTextBeforeIndex(1,
+ AccessibleTextType.PARAGRAPH);
+ log.println("'" + txt + "'");
+ res &= txt.length() == 0;
+
+ log.print("getTextBeforeIndex(chCount-1," +
+ " AccessibleTextType.CHARACTER):");
+ txt = oObj.getTextBeforeIndex(chCount - 1,
+ AccessibleTextType.CHARACTER);
+ log.println("'" + txt + "'");
+ res &= txt.equals(text.substring(chCount - 2, chCount - 1));
+
+ if (chCount > 2) {
+ log.print("getTextBeforeIndex(2," +
+ " AccessibleTextType.CHARACTER):");
+ txt = oObj.getTextBeforeIndex(2,
+ AccessibleTextType.CHARACTER);
+ log.println("'" + txt + "'");
+ res &= txt.equals(text.substring(1, 2));
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getTextBeforeIndex()", res);
+ }
+
+ /**
+ * Calls the method with invalid parameters an with valid parameters,
+ * checks returned values.
+ * Has OK status if exception was thrown for invalid parameters,
+ * if exception wasn't thrown for valid parameters and if returned values
+ * are equal to corresponding substrings of the text received by relation.
+ * The following method tests are to be executed before:
+ * <ul>
+ * <li> <code>getCharacterCount()</code> </li>
+ * </ul>
+ */
+ public void _getTextBehindIndex() {
+ requiredMethod("getCharacterCount()");
+ boolean res = true;
+
+ try {
+ log.print("getTextBehindIndex(-1, AccessibleTextType.PARAGRAPH):");
+ String txt = oObj.getTextBehindIndex(-1,
+ AccessibleTextType.PARAGRAPH);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getTextBehindIndex(chCount+1, " +
+ "AccessibleTextType.PARAGRAPH):");
+ String txt = oObj.getTextBehindIndex(chCount + 1,
+ AccessibleTextType.PARAGRAPH);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("getTextBehindIndex(chCount," +
+ " AccessibleTextType.PARAGRAPH):");
+ String txt = oObj.getTextBehindIndex(chCount,
+ AccessibleTextType.PARAGRAPH);
+ log.println("'" + txt + "'");
+ res &= txt.length() == 0;
+
+ log.print("getTextBehindIndex(chCount-1," +
+ " AccessibleTextType.PARAGRAPH):");
+ txt = oObj.getTextBehindIndex(chCount - 1,
+ AccessibleTextType.PARAGRAPH);
+ log.println("'" + txt + "'");
+ res &= txt.length() == 0;
+
+ log.print("getTextBehindIndex(1," +
+ " AccessibleTextType.CHARACTER):");
+ txt = oObj.getTextBehindIndex(1,
+ AccessibleTextType.CHARACTER);
+ log.println("'" + txt + "'");
+ res &= txt.equals(text.substring(2, 3));
+
+ if (chCount > 2) {
+ log.print("getTextBehindIndex(chCount-2," +
+ " AccessibleTextType.CHARACTER):");
+ txt = oObj.getTextBehindIndex(chCount - 2,
+ AccessibleTextType.CHARACTER);
+ log.println("'" + txt + "'");
+ res &= txt.equals(text.substring(chCount - 1, chCount));
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("getTextBehindIndex()", res);
+ }
+
+ /**
+ * Calls the method with invalid parameters an with valid parameter,
+ * checks returned values.
+ * Has OK status if exception was thrown for invalid parameters,
+ * if exception wasn't thrown for valid parameter and if returned value for
+ * valid parameter is equal to <code>true</code>.
+ */
+ public void _copyText() {
+ boolean res = true;
+ boolean locRes = true;
+
+ if (editOnly != null) {
+ log.println(editOnly);
+ throw new StatusException(Status.skipped(true));
+ }
+
+ try {
+ log.print("copyText(-1,chCount):");
+ oObj.copyText(-1, chCount);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("copyText(0,chCount+1):");
+ oObj.copyText(0, chCount + 1);
+ log.println("Exception was expected");
+ res &= false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+
+ try {
+ log.print("copyText(0,chCount):");
+ locRes = oObj.copyText(0, chCount);
+ log.println(locRes);
+ res &= locRes;
+
+ String cbText = null;
+ try {
+ cbText =
+ util.SysUtils.getSysClipboardText(tParam.getMSF());
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't access system clipboard :");
+ e.printStackTrace(log);
+ }
+ log.println("Clipboard: '" + cbText + "'");
+ res &= text.equals(cbText);
+
+ if (chCount > 2) {
+ log.print("copyText(1,chCount-1):");
+ locRes = oObj.copyText(1, chCount - 1);
+ log.println(locRes);
+ res &= locRes;
+
+ try {
+ cbText = util.SysUtils.getSysClipboardText(tParam.getMSF());
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't access system clipboard :");
+ e.printStackTrace(log);
+ }
+
+ log.println("Clipboard: '" + cbText + "'");
+ res &= text.substring(1, chCount - 1).equals(cbText);
+ }
+
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res &= false;
+ }
+
+ tRes.tested("copyText()", res);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java
new file mode 100644
index 000000000000..de2aad841771
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java
@@ -0,0 +1,355 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAccessibleValue.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.accessibility;
+
+
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>drafts.com.sun.star.accessibility.XAccessibleValue</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getCurrentValue()</code></li>
+ * <li><code> setCurrentValue()</code></li>
+ * <li><code> getMaximumValue()</code></li>
+ * <li><code> getMinimumValue()</code></li>
+ * </ul> <p>
+ *
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'XAccessibleValue.anotherFromGroup'</code>
+ * (of type <code>XAccessibleValue</code>) <b> optional </b>:
+ * another component from the group(e.g. radio button group)</li>
+ * </ul><p>
+ * @see drafts.com.sun.star.accessibility.XAccessibleValue
+ */
+public class _XAccessibleValue extends MultiMethodTest {
+
+ public XAccessibleValue oObj = null;
+
+ private double minVal = 0;
+ private double maxVal = 0;
+ private double curVal = 0;
+ private Object val = null;
+ XAccessibleValue anotherFromGroup = null;
+
+ private static final String className =
+ "drafts.com.sun.star.accessibility.XAccessibleValue" ;
+
+ /**
+ * Walkaround for current interface naming ('drafts' prefix)
+ * @return The class name to load
+ */
+ protected String getTestedClassName() {
+ return className;
+ }
+
+ protected void before() {
+ anotherFromGroup = (XAccessibleValue)tEnv.getObjRelation(
+ "XAccessibleValue.anotherFromGroup");
+ }
+
+ /**
+ * Gets current value and stores it as double. <p>
+ *
+ * Has <b> OK </b> status if the current value is between Min and Max
+ * values. <p>
+ *
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getMaximumValue </code> </li>
+ * <li> <code> getMinimumValue </code> </li>
+ * </ul>
+ */
+ public void _getCurrentValue() {
+ executeMethod("getMaximumValue()");
+ executeMethod("getMinimumValue()");
+
+ boolean result = true;
+
+ double curVal ;
+ val = oObj.getCurrentValue() ;
+ if (util.utils.isVoid(val)) {
+ val = new Integer(0);
+ curVal = 0;
+ } else {
+ curVal = getDoubleValue(val);
+ }
+
+ if (curVal < minVal || maxVal < curVal) {
+ log.println("" + (curVal - minVal) + "," + (maxVal - curVal));
+ log.println("Current value " + curVal + " is not in range ["
+ + minVal + "," + maxVal + "]");
+ result = false;
+ }
+
+ tRes.tested("getCurrentValue()", result) ;
+ }
+
+ /**
+ * Performs testing for following cases :
+ * <ul>
+ * <li> Creates new value in valid range and sets it. </li>
+ * <li> Sets maximum and minimum values. </li>
+ * <li> Sets Min - 1, and Max + 1 values </li>
+ * </ul> <p>
+ *
+ * Has <b> OK </b> status if for the first case the value returned
+ * is the same as was set and the method <code>setCurrentValue</code>
+ * returns <code>true</code>.
+ *
+ * In the second if Max and Min values are set and method
+ * <code>setCurrentValue</code> returns <code>true</code>.
+ *
+ * In the third case invalid values are truncated to Min and Max
+ * values accordingly. <p>
+ *
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getCurrentValue() </code> </li>
+ * </ul>
+ */
+ public void _setCurrentValue() {
+ executeMethod("getCurrentValue()");
+
+ boolean result = true ;
+
+ if (anotherFromGroup == null) {
+ double newVal = curVal + 1;
+ if (newVal > maxVal) newVal -= 2;
+ if (newVal < minVal) newVal += 1;
+
+ log.println("New value is " + newVal);
+
+ Object setVal = getObjectValue(newVal, val.getClass());
+
+ result &= oObj.setCurrentValue(setVal);
+
+ if (!result) {
+ log.println("The value can't be set");
+ throw new StatusException(Status.skipped(true));
+ }
+
+ double resVal = getDoubleValue(oObj.getCurrentValue());
+ log.println("Res value is " + resVal);
+
+ result &= Math.abs(newVal - resVal) < 0.00001;
+
+ log.println("Checking min/max values");
+ result &= oObj.setCurrentValue(getObjectValue(minVal, val.getClass()));
+ resVal = getDoubleValue(oObj.getCurrentValue());
+ log.println("Result min value is " + resVal);
+ result &= Math.abs(minVal - resVal) < 0.00001;
+
+ result &= oObj.setCurrentValue(getObjectValue(maxVal, val.getClass()));
+ resVal = getDoubleValue(oObj.getCurrentValue());
+ log.println("Result max value is " + resVal);
+ result &= Math.abs(maxVal - resVal) < 0.00001;
+
+ log.println("Checking truncating of min/max values");
+ oObj.setCurrentValue(getObjectValue(minVal - 1, val.getClass()));
+ resVal = getDoubleValue(oObj.getCurrentValue());
+ log.println("Result min value is " + resVal);
+ result &= Math.abs(minVal - resVal) < 0.00001;
+
+ oObj.setCurrentValue(getObjectValue(maxVal + 1, val.getClass()));
+ resVal = getDoubleValue(oObj.getCurrentValue());
+ log.println("Result max value is " + resVal);
+ result &= Math.abs(maxVal - resVal) < 0.00001;
+ } else {
+ int curValBase = getIntegerValue(val);
+ Object valAnotherFromGroup = anotherFromGroup.getCurrentValue();
+ int curValAnother = getIntegerValue(valAnotherFromGroup);
+ log.println("Current value of base component: " + curValBase);
+ log.println("Current value of another component from group: " +
+ curValAnother);
+ log.println("Set value of base component to " + curValAnother);
+ oObj.setCurrentValue(valAnotherFromGroup);
+ log.println("Checking of values...");
+ int newValBase = getIntegerValue(oObj.getCurrentValue());
+ int newValAnother = getIntegerValue(
+ anotherFromGroup.getCurrentValue());
+ log.println("New value of base component: " + newValBase);
+ log.println("Expected value of base component: " + curValAnother);
+ log.println("New value of another component from group: " +
+ newValAnother);
+ log.println("Expected value of another component from group: " +
+ curValBase);
+
+ result = (newValBase == curValAnother) &&
+ (newValAnother == curValBase);
+ }
+
+ tRes.tested("setCurrentValue()", result);
+ }
+
+ /**
+ * Gets and stores maximal value. <p>
+ *
+ * Has <b> OK </b> status if non empty value returned and
+ * Max value is greater than Min value.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMinimumValue() </code> : to compare with </li>
+ * </ul>
+ */
+ public void _getMaximumValue() {
+ requiredMethod("getMinimumValue()");
+
+ boolean result = true ;
+
+ Object val = oObj.getMaximumValue();
+ if (util.utils.isVoid(val)) {
+ maxVal = Double.MAX_VALUE ;
+ result = false;
+ } else {
+ maxVal = getDoubleValue(val);
+ }
+ log.println("Max is " + val.getClass()+ " = " + maxVal);
+
+ result &= maxVal >= minVal;
+
+ tRes.tested("getMaximumValue()", result) ;
+ }
+
+ /**
+ * Gets and stores minimal value. <p>
+ *
+ * Has <b> OK </b> status if non empty value returned. <p>
+ *
+ */
+ public void _getMinimumValue() {
+ boolean result = true ;
+
+ Object val = oObj.getMinimumValue() ;
+ if (util.utils.isVoid(val)) {
+ minVal = - Double.MAX_VALUE ;
+ result = false;
+ } else {
+ minVal = getDoubleValue(val);
+ }
+ log.println("Min is " + val.getClass()+ " = " + minVal);
+
+ tRes.tested("getMinimumValue()", result) ;
+ }
+
+ private int getIntegerValue(Object val) {
+ if (val instanceof Integer) {
+ return ((Integer) val).intValue();
+ } else {
+ throw new StatusException
+ (Status.failed("Unexpected value type: " + val.getClass()));
+ }
+ }
+
+ private double getDoubleValue(Object val) {
+ if (val instanceof Integer) {
+ return ((Integer) val).doubleValue();
+ }
+ else if (val instanceof Short) {
+ return ((Short) val).doubleValue();
+ }
+ else if (val instanceof Float) {
+ return ((Float) val).doubleValue();
+ }
+ else if (val instanceof Double) {
+ return ((Double) val).doubleValue();
+ }
+ else if (util.utils.isVoid(val)) {
+ return Double.NaN;
+ }
+ else {
+ throw new StatusException
+ (Status.failed("Undetected value type: " + val.getClass()));
+ }
+ }
+
+ private Object getObjectValue(double val, Class clazz) {
+ if (clazz.equals(Integer.class)) {
+ return new Integer((int)val);
+ }
+ else if (clazz.equals(Short.class)) {
+ return new Short((short)val);
+ }
+ else if (clazz.equals(Float.class)) {
+ return new Float((float)val);
+ }
+ else if (clazz.equals(Double.class)) {
+ return new Double(val);
+ }
+ else {
+ throw new StatusException
+ (Status.failed("Unexpected class: " + clazz));
+ }
+ }
+
+ /**
+ * Disposes test environment.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java
new file mode 100644
index 000000000000..2af0b4db19ec
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlButtonModel.java
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlButtonModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/*
+* Testing <code>com.sun.star.awt.UnoControlButtonModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> DefaultButton</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> Printable</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* @see com.sun.star.awt.UnoControlButtonModel
+*/
+public class _UnoControlButtonModel extends MultiPropertyTest {
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester BoolTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Boolean(true)))
+ return new Boolean(false);
+ else
+ return new Boolean(true);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("BackgroundColor", ColorTester) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextColor", ColorTester) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Tabstop() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("Tabstop", BoolTester) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _PushButtonType() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("PushButtonType",
+ new Short((short)0), new Short((short)1));
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlCheckBoxModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlCheckBoxModel.java
new file mode 100644
index 000000000000..0e38257d57fb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlCheckBoxModel.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlCheckBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlCheckBoxModel</code>
+* service properties :
+* <ul>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> Printable</code></li>
+* <li><code> State</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> TriState</code></li>
+* </ul>
+* @see com.sun.star.awt.UnoControlCheckBoxModel
+*/
+public class _UnoControlCheckBoxModel extends MultiPropertyTest {
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ if (utils.isVoid(old)) return new Boolean(true) ;
+ else return null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ if (utils.isVoid(old)) return new Integer(12345) ;
+ else return null ;
+ }
+ }) ;
+ }
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java
new file mode 100644
index 000000000000..0b95442ea36c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlComboBoxModel.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlComboBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/*
+* Testing <code>com.sun.star.awt.UnoControlComboBoxModel</code>
+* service properties :
+* <ul>
+* <li><code> Autocomplete</code></li>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Dropdown</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> LineCount</code></li>
+* <li><code> MaxTextLen</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> StringItemList</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* @see com.sun.star.awt.UnoControlComboBoxModel
+*/
+public class _UnoControlComboBoxModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ public void _Text() {
+ try {
+ oObj.setPropertyValue("MaxTextLen",new Short((short)0));
+ } catch (com.sun.star.beans.UnknownPropertyException ue) {
+ } catch (com.sun.star.beans.PropertyVetoException pe) {
+ } catch (com.sun.star.lang.IllegalArgumentException ie) {
+ } catch (com.sun.star.lang.WrappedTargetException we) {
+ }
+ testProperty("Text");
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+
+} //EOF UnoControlComboBoxModel
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlContainerModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlContainerModel.java
new file mode 100644
index 000000000000..b5344d489761
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlContainerModel.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlContainerModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/*
+* Testing <code>com.sun.star.awt.UnoControlButtonModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Printable</code></li>
+* <li><code> Text</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* </ul>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.awt.UnoControlContainerModel
+*/
+public class _UnoControlContainerModel extends MultiPropertyTest {
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("BackgroundColor", ColorTester) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlCurrencyFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlCurrencyFieldModel.java
new file mode 100644
index 000000000000..033275b6400c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlCurrencyFieldModel.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlCurrencyFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlCurrencyFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> CurrencySymbol</code></li>
+* <li><code> DecimalAccuracy</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> ShowThousandsSeparator</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> Value</code></li>
+* <li><code> ValueMax</code></li>
+* <li><code> ValueMin</code></li>
+* <li><code> ValueStep</code></li>
+* </ul>
+* @see com.sun.star.awt.UnoControlCurrencyFieldModel
+*/
+public class _UnoControlCurrencyFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Integer(6543) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Integer(123) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Value() {
+ testProperty("Value", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Double(777) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlDateFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlDateFieldModel.java
new file mode 100644
index 000000000000..55085afc96fe
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlDateFieldModel.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlDateFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/*
+* Testing <code>com.sun.star.awt.UnoControlDateFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> Date</code></li>
+* <li><code> DateMax</code></li>
+* <li><code> DateMin</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> DateFormat</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlDateFieldModel
+*/
+public class _UnoControlDateFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Integer(6543) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Date() {
+ testProperty("Date", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Integer(6543) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return utils.isVoid(old) ? new Integer(123) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+
+ public void _DateShowCentury() {
+ boolean res = false;
+ try {
+ util.dbg.printPropertyInfo(oObj,"DateShowCentury",log);
+ Object oDsc = oObj.getPropertyValue("DateShowCentury");
+ Boolean dsc = null;
+ if (util.utils.isVoid(oDsc)) {
+ log.println("Property is void, set it to true");
+ dsc = new Boolean(true);
+ } else {
+ dsc = (Boolean) oDsc;
+ dsc = new Boolean(!dsc.booleanValue());
+ log.println("Setting property to "+dsc);
+ }
+ oObj.setPropertyValue("DateShowCentury",dsc);
+ Boolean getdsc = (Boolean) oObj.getPropertyValue("DateShowCentury");
+ log.println("Getting value "+getdsc);
+ res = dsc.equals(getdsc);
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ log.println("Don't know the Property 'DateShowCentury'");
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ log.println("WrappedTargetException while getting Property 'DateShowCentury'");
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ log.println("IllegalArgumentException while getting Property 'DateShowCentury'");
+ } catch (com.sun.star.beans.PropertyVetoException pve) {
+ log.println("PropertyVetoException while getting Property 'DateShowCentury'");
+ }
+ tRes.tested("DateShowCentury",res);
+
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlDialogElement.java b/qadevOOo/tests/java/ifc/awt/_UnoControlDialogElement.java
new file mode 100644
index 000000000000..32a430865454
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlDialogElement.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlDialogElement.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+
+public class _UnoControlDialogElement extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlDialogModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlDialogModel.java
new file mode 100644
index 000000000000..7731d2f2f144
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlDialogModel.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlDialogModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlDialogModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Title</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> Sizeable</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlDialogModel
+*/
+public class _UnoControlDialogModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlEditModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlEditModel.java
new file mode 100644
index 000000000000..407382990e3e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlEditModel.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlEditModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlEditModel</code>
+* service properties :
+* <ul>
+* <li><code> Align</code></li>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> EchoChar</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> HardLineBreaks</code></li>
+* <li><code> HScroll</code></li>
+* <li><code> MaxTextLen</code></li>
+* <li><code> MultiLine</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> VScroll</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlEditModel
+*/
+public class _UnoControlEditModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlFileControlModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlFileControlModel.java
new file mode 100644
index 000000000000..811f5117efb1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlFileControlModel.java
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlFileControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlFileControlModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> FontEmphsisMark</code></li>
+* <li><code> FontRelief</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Printable</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> TextLineColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlFileControlModel
+*/
+public class _UnoControlFileControlModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlFixedLineModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlFixedLineModel.java
new file mode 100644
index 000000000000..12f3412e92d6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlFixedLineModel.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlFixedLineModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlFixedLineModel</code>
+* service properties :
+* <ul>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> Label</code></li>
+* <li><code> Orientation</code></li>
+* <li><code> Printable</code></li>
+* <li><code> TextColor</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlFixedLineModel
+*/
+public class _UnoControlFixedLineModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlFixedTextModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlFixedTextModel.java
new file mode 100644
index 000000000000..60da6cb9da23
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlFixedTextModel.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlFixedTextModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlFixedTextModel</code>
+* service properties :
+* <ul>
+* <li><code> Align</code></li>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> MultiLine</code></li>
+* <li><code> Printable</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlFixedTextModel
+*/
+public class _UnoControlFixedTextModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlFormattedFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlFormattedFieldModel.java
new file mode 100644
index 000000000000..5bcb26bd2299
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlFormattedFieldModel.java
@@ -0,0 +1,259 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlFormattedFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlFormattedFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> Align</code></li>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> EffectiveDefault</code></li>
+* <li><code> EffectiveMax</code></li>
+* <li><code> EffectiveMin</code></li>
+* <li><code> EffectiveValue</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> FormatKey</code></li>
+* <li><code> FormatsSupplier</code></li>
+* <li><code> MaxTextLen</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlFormattedFieldModel
+*/
+public class _UnoControlFormattedFieldModel extends MultiPropertyTest {
+
+ /**
+ * Redefined method must return a valid service name, that differs from
+ * name exists.
+ *
+ */
+ protected PropertyTester ControlTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue,
+ "com.sun.star.form.control.FormattedField"))
+ return "com.sun.star.awt.UnoControlFormattedField";
+ else
+ return "com.sun.star.form.control.FormattedField";
+ }
+ };
+
+ /**
+ * This property must contain a valid service name.
+ */
+ public void _DefaultControl() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("DefaultControl", ControlTester) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Integer(123) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Integer(123) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _EffectiveDefault() {
+ testProperty("EffectiveDefault", new Double(5.8),new Double(2.3)) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _EffectiveValue() {
+ testProperty("EffectiveValue", new Double(5.8),new Double(2.3)) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _EffectiveMax() {
+ testProperty("EffectiveMax", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Double(123.8) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _FormatsSupplier() {
+ testProperty("FormatsSupplier", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ Object newValue = null;
+ try {
+ newValue = tParam.getMSF().createInstance(
+ "com.sun.star.util.NumberFormatsSupplier");
+ } catch (com.sun.star.uno.Exception e) {}
+ return newValue;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _EffectiveMin() {
+ testProperty("EffectiveMin", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Double(0.1) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _FormatKey() {
+ testProperty("FormatKey", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Integer(0) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _StrictFromat() {
+ testProperty("StrictFromat", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Boolean(true) :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? new Boolean(true) :
+ null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Text() {
+ testProperty("Text", new PropertyTester() {
+ protected Object getNewValue(String p, Object v) {
+ return utils.isVoid(v) ? "UnoControlFormattedFieldModel" :
+ super.getNewValue(p,v) ;
+ }
+ }) ;
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlGroupBoxModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlGroupBoxModel.java
new file mode 100644
index 000000000000..c0aa627ae6c5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlGroupBoxModel.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlGroupBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlGroupBoxModel</code>
+* service properties :
+* <ul>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> Printable</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlGroupBoxModel
+*/
+public class _UnoControlGroupBoxModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlImageControlModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlImageControlModel.java
new file mode 100644
index 000000000000..d70654e35bb4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlImageControlModel.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlImageControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlImageControlModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor </code></li>
+* <li><code> Border </code></li>
+* <li><code> DefaultControl </code></li>
+* <li><code> Enabled </code></li>
+* <li><code> ImageURL </code></li>
+* <li><code> Printable </code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlImageControlModel
+*/
+public class _UnoControlImageControlModel extends MultiPropertyTest {
+
+ /**
+ * Custom <code>PropertyTester</code> used in <code>ImageURL</code> test.
+ */
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg");
+ else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ } ;
+
+ /**
+ * Test changes one image URL onto another.
+ */
+ public void _ImageURL() {
+ testProperty("ImageURL", URLTester) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return utils.isVoid(oldValue) ? new Integer(8945) :
+ super.getNewValue(propName, oldValue) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlListBoxModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlListBoxModel.java
new file mode 100644
index 000000000000..a0ffd7bd2db2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlListBoxModel.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlListBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlListBoxModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Dropdown</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> LineCount</code></li>
+* <li><code> MultiSelection</code></li>
+* <li><code> Printable</code></li>
+* <li><code> SelectedItems</code></li>
+* <li><code> StringItemList</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Almost all properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlListBoxModel
+*/
+public class _UnoControlListBoxModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlModel.java
new file mode 100644
index 000000000000..f9e4f2a06a28
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlModel.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+
+public class _UnoControlModel extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlNumericFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlNumericFieldModel.java
new file mode 100644
index 000000000000..212cfd7863d3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlNumericFieldModel.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlNumericFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlNumericFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DecimalAccuracy</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> ShowThousandsSeparator</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> Value</code></li>
+* <li><code> ValueMax</code></li>
+* <li><code> ValueMin</code></li>
+* <li><code> ValueStep</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlNumericFieldModel
+*/
+public class _UnoControlNumericFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Value() {
+ testProperty("Value", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Double(234.89) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlPatternFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlPatternFieldModel.java
new file mode 100644
index 000000000000..465d4ea6e3e8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlPatternFieldModel.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlPatternFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlPatternFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> EditMask</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> LiteralMask</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> Text</code></li>
+* <li><code> TextColor</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlPatternFieldModel
+*/
+public class _UnoControlPatternFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlProgressBarModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlProgressBarModel.java
new file mode 100644
index 000000000000..1ad6d3177dbd
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlProgressBarModel.java
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlProgressBarModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlProgressBarModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FillColor</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ProgressValue</code></li>
+* <li><code> ProgressValueMax</code></li>
+* <li><code> ProgressValueMin</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlProgressBarModel
+*/
+public class _UnoControlProgressBarModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _FillColor() {
+ testProperty("FillColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _ProgressValue() {
+ testProperty("ProgressValue", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(10) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlRadioButtonModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlRadioButtonModel.java
new file mode 100644
index 000000000000..6758fd48ce6c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlRadioButtonModel.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlRadioButtonModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlRadioButtonModel</code>
+* service properties :
+* <ul>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Label</code></li>
+* <li><code> Printable</code></li>
+* <li><code> State</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlRadioButtonModel
+*/
+public class _UnoControlRadioButtonModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester ColorTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (util.ValueComparer.equalValue(oldValue, new Integer(17)))
+ return new Integer(25);
+ else
+ return new Integer(17);
+ }
+ };
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextLineColor() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextLineColor", ColorTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlScrollBarModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlScrollBarModel.java
new file mode 100644
index 000000000000..a9e2d84dd7d5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlScrollBarModel.java
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlScrollBarModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlScrollBarModel</code>
+* service properties :
+* <ul>
+* <li><code> BlockIncrement</code></li>
+* <li><code> Border</code></li>
+* <li><code> DefaultControl</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> LineIncrement</code></li>
+* <li><code> Orientation</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ScrollValue</code></li>
+* <li><code> ScrollValueMax</code></li>
+* <li><code> VisibleSize</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlScrollBarModel
+*/
+public class _UnoControlScrollBarModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _ScrollValue() {
+ testProperty("ScrollValue", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(10) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _VisibleSize() {
+ testProperty("VisibleSize", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(10) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_UnoControlTimeFieldModel.java b/qadevOOo/tests/java/ifc/awt/_UnoControlTimeFieldModel.java
new file mode 100644
index 000000000000..499c6b78a61a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_UnoControlTimeFieldModel.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UnoControlTimeFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+
+/**
+* Testing <code>com.sun.star.awt.UnoControlTimeFieldModel</code>
+* service properties :
+* <ul>
+* <li><code> BackgroundColor</code></li>
+* <li><code> Border</code></li>
+* <li><code> HelpText</code></li>
+* <li><code> HelpURL</code></li>
+* <li><code> FontEmphasisMark</code></li>
+* <li><code> FontRelief</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> TimeFormat</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> Printable</code></li>
+* <li><code> ReadOnly</code></li>
+* <li><code> Spin</code></li>
+* <li><code> StrictFormat</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* <li><code> TextLineColor</code></li>
+* <li><code> Time</code></li>
+* <li><code> TimeFormat</code></li>
+* <li><code> TimeMax</code></li>
+* <li><code> TimeMin</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.awt.UnoControlTimeFieldModel
+*/
+public class _UnoControlTimeFieldModel extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _BackgroundColor() {
+ testProperty("BackgroundColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(1234) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _TextLineColor() {
+ testProperty("TextLineColor", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) : null ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Time() {
+ testProperty("Time", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Boolean(true) : null ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XButton.java b/qadevOOo/tests/java/ifc/awt/_XButton.java
new file mode 100644
index 000000000000..708957627b81
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XButton.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XButton.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XButton;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XButton</code>
+* interface methods :
+* <ul>
+* <li><code> addActionListener()</code></li>
+* <li><code> removeActionListener()</code></li>
+* <li><code> setLabel()</code></li>
+* <li><code> setActionCommand()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XButton
+*/
+public class _XButton extends MultiMethodTest {
+
+ public XButton oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestActionListener implements com.sun.star.awt.XActionListener {
+ public boolean disposingCalled = false ;
+ public boolean actionPerformedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void actionPerformed(com.sun.star.awt.ActionEvent e) {
+ actionPerformedCalled = true ;
+ }
+
+ }
+
+ TestActionListener listener = new TestActionListener() ;
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addActionListener() {
+
+ boolean result = true ;
+ oObj.addActionListener(listener) ;
+
+ tRes.tested("addActionListener()", result) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeActionListener() {
+
+ boolean result = true ;
+ oObj.removeActionListener(listener) ;
+
+ tRes.tested("removeActionListener()", result) ;
+ }
+
+ /**
+ * Just sets some text for label. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _setLabel() {
+
+ boolean result = true ;
+ oObj.setLabel("XButton Label") ;
+
+ tRes.tested("setLabel()", result) ;
+ }
+
+ /**
+ * Just sets some command for button. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _setActionCommand() {
+
+ boolean result = true ;
+ oObj.setActionCommand("XButtonComand") ;
+
+ tRes.tested("setActionCommand()", result) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XCheckBox.java b/qadevOOo/tests/java/ifc/awt/_XCheckBox.java
new file mode 100644
index 000000000000..3c582947c7bc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XCheckBox.java
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCheckBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XCheckBox;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XCheckBox</code>
+* interface methods :
+* <ul>
+* <li><code> addItemListener()</code></li>
+* <li><code> removeItemListener()</code></li>
+* <li><code> getState()</code></li>
+* <li><code> setState()</code></li>
+* <li><code> setLabel()</code></li>
+* <li><code> enableTriState()</code></li>
+* </ul> <p>
+*
+* @see com.sun.star.awt.XCheckBox
+*/
+public class _XCheckBox extends MultiMethodTest {
+
+ public XCheckBox oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestItemListener implements com.sun.star.awt.XItemListener {
+ public boolean disposingCalled = false ;
+ public boolean itemStateChangedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true ;
+ }
+
+ }
+ TestItemListener listener = new TestItemListener() ;
+ short state = -1 ;
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addItemListener() {
+
+ boolean result = true ;
+ oObj.addItemListener(listener) ;
+ tRes.tested("addItemListener()", result) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeItemListener() {
+
+ boolean result = true ;
+ oObj.removeItemListener(listener) ;
+
+ tRes.tested("removeItemListener()", result) ;
+ }
+
+ /**
+ * Just retrieves current state and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurs.
+ */
+ public void _getState() {
+
+ boolean result = true ;
+ state = oObj.getState() ;
+
+ tRes.tested("getState()", result) ;
+ }
+
+ /**
+ * Sets a new value and then checks get value. <p>
+ * Has <b>OK</b> status if set and get values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getState </code> </li>
+ * </ul>
+ */
+ public void _setState() {
+ requiredMethod("getState()") ;
+
+ boolean result = true ;
+ short newState = state == 0 ? (short)1 : (short)0 ;
+ oObj.setState(newState) ;
+ result = newState == oObj.getState() ;
+
+ tRes.tested("setState()", result) ;
+ }
+
+ /**
+ * Just sets some text for label. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurs.
+ */
+ public void _setLabel() {
+
+ boolean result = true ;
+ oObj.setLabel("XCheckBox test") ;
+
+ tRes.tested("setLabel()", result) ;
+ }
+
+ /**
+ * Just enables tristate. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurs.
+ */
+ public void _enableTriState() {
+
+ boolean result = true ;
+ oObj.enableTriState(true) ;
+
+ tRes.tested("enableTriState()", result) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XComboBox.java b/qadevOOo/tests/java/ifc/awt/_XComboBox.java
new file mode 100644
index 000000000000..4457628a1f6c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XComboBox.java
@@ -0,0 +1,324 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XComboBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XComboBox;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.awt.XComboBox</code>
+* interface methods :
+* <ul>
+* <li><code> addItemListener()</code></li>
+* <li><code> removeItemListener()</code></li>
+* <li><code> addActionListener()</code></li>
+* <li><code> removeActionListener()</code></li>
+* <li><code> addItem()</code></li>
+* <li><code> addItems()</code></li>
+* <li><code> removeItems()</code></li>
+* <li><code> getItemCount()</code></li>
+* <li><code> getItem()</code></li>
+* <li><code> getItems()</code></li>
+* <li><code> getDropDownLineCount()</code></li>
+* <li><code> setDropDownLineCount()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XComboBox
+*/
+public class _XComboBox extends MultiMethodTest {
+
+ public XComboBox oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestActionListener implements com.sun.star.awt.XActionListener {
+ public boolean disposingCalled = false ;
+ public boolean actionPerformedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void actionPerformed(com.sun.star.awt.ActionEvent e) {
+ actionPerformedCalled = true ;
+ }
+
+ }
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestItemListener implements com.sun.star.awt.XItemListener {
+ public boolean disposingCalled = false ;
+ public boolean itemStateChangedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true ;
+ }
+
+ }
+ private TestActionListener actionListener = new TestActionListener() ;
+ private TestItemListener itemListener = new TestItemListener() ;
+ short lineCount = 0 ;
+ short itemCount = 0 ;
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addItemListener() {
+
+ boolean result = true ;
+ oObj.addItemListener(itemListener) ;
+
+ tRes.tested("addItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeItemListener() {
+ requiredMethod("addItemListener()") ;
+
+ boolean result = true ;
+ oObj.removeItemListener(itemListener) ;
+
+ tRes.tested("removeItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addActionListener() {
+
+ boolean result = true ;
+ oObj.addActionListener(actionListener) ;
+
+ tRes.tested("addActionListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeActionListener() {
+ requiredMethod("addActionListener()") ;
+
+ boolean result = true ;
+ oObj.removeActionListener(actionListener) ;
+
+ tRes.tested("removeActionListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * Adds one item to the last position and check the number of
+ * items after addition. <p>
+ * Has <b>OK</b> status if the number of items increased by 1.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getItemCount </code> </li>
+ * </ul>
+ */
+ public void _addItem() {
+ requiredMethod("getItemCount()") ;
+
+ boolean result = true ;
+ oObj.addItem("Item1", itemCount) ;
+ result = oObj.getItemCount() == itemCount + 1 ;
+
+ tRes.tested("addItem()", result) ;
+ }
+
+ /**
+ * Adds one two items to the last position and check the number of
+ * items after addition. <p>
+ * Has <b>OK</b> status if the number of items increased by 2.<p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItem </code> </li>
+ * </ul>
+ */
+ public void _addItems() {
+ executeMethod("addItem()") ;
+
+ boolean result = true ;
+ short oldCnt = oObj.getItemCount() ;
+ oObj.addItems(new String[] {"Item2", "Item3"}, oldCnt) ;
+ result = oObj.getItemCount() == oldCnt + 2 ;
+
+ tRes.tested("addItems()", result) ;
+ }
+
+ /**
+ * Gets the current number of items and tries to remove them all
+ * then checks number of items. <p>
+ * Has <b>OK</b> status if no items remains. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getItems </code> </li>
+ * <li> <code> getItem </code> </li>
+ * </ul>
+ */
+ public void _removeItems() {
+ executeMethod("getItems()") ;
+ executeMethod("getItem()") ;
+
+ boolean result = true ;
+ short oldCnt = oObj.getItemCount() ;
+ oObj.removeItems((short)0, oldCnt) ;
+ result = oObj.getItemCount() == 0 ;
+
+ tRes.tested("removeItems()", result) ;
+ }
+
+ /**
+ * Just retrieves current number of items and stores it. <p>
+ * Has <b>OK</b> status if the count is not less than 0.
+ */
+ public void _getItemCount() {
+
+ boolean result = true ;
+ itemCount = oObj.getItemCount() ;
+
+ tRes.tested("getItemCount()", itemCount >= 0) ;
+ }
+
+ /**
+ * After <code>addItem</code> and <code>addItems</code> methods
+ * test the following items must exist {..., "Item1", "Item2", "Item3"}
+ * Retrieves the item from the position which was ititially the last.<p>
+ * Has <b>OK</b> status if the "Item1" was retrieved. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _getItem() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ String item = oObj.getItem(itemCount) ;
+ result = "Item1".equals(item) ;
+
+ tRes.tested("getItem()", result) ;
+ }
+
+ /**
+ * After <code>addItem</code> and <code>addItems</code> methods
+ * test the following items must exist {..., "Item1", "Item2", "Item3"}
+ * Retrieves all items. <p>
+ * Has <b>OK</b> status if the last three items retrieved are
+ * "Item1", "Item2" and "Item3". <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _getItems() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ String[] items = oObj.getItems() ;
+ for (int i = itemCount; i < (itemCount + 3); i++) {
+ result &= ("Item" + (i+1)).equals(items[i]) ;
+ }
+
+ tRes.tested("getItems()", result) ;
+ }
+
+ /**
+ * Gets line count and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getDropDownLineCount() {
+
+ boolean result = true ;
+ lineCount = oObj.getDropDownLineCount() ;
+
+ tRes.tested("getDropDownLineCount()", result) ;
+ }
+
+ /**
+ * Sets a new value and then checks get value. <p>
+ * Has <b>OK</b> status if set and get values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDropDownLineCount </code> </li>
+ * </ul>
+ */
+ public void _setDropDownLineCount() {
+ requiredMethod("getDropDownLineCount()") ;
+
+ boolean result = true ;
+ oObj.setDropDownLineCount((short)(lineCount + 1)) ;
+ result = oObj.getDropDownLineCount() == lineCount + 1 ;
+
+ tRes.tested("setDropDownLineCount()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XControl.java b/qadevOOo/tests/java/ifc/awt/_XControl.java
new file mode 100644
index 000000000000..97e871fa9082
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XControl.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XView;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XControl</code>
+* interface methods:
+* <ul>
+* <li><code> setContext() </code></li>
+* <li><code> getContext() </code></li>
+* <li><code> createPeer() </code></li>
+* <li><code> getPeer() </code></li>
+* <li><code> setModel() </code></li>
+* <li><code> getModel() </code></li>
+* <li><code> setDesignMode() </code></li>
+* <li><code> isDesignMode() </code></li>
+* <li><code> isTransparent() </code></li>
+* <li><code> getView() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CONTEXT'</code> (of type <code>XInterface</code>):
+* used as a parameter to setContext() and for testing getContext().</li>
+* <li> <code>'WINPEER'</code> (of type <code>XWindowPeer</code>):
+* used as a parameter to createPeer() and for testing getPeer()</li>
+* <li> <code>'TOOLKIT'</code> (of type <code>XToolkit</code>):
+* used as a parameter to createPeer()</li>
+* <li> <code>'MODEL'</code> (of type <code>XControlModel</code>):
+* used as a parameter to setModel() and for testing getModel()</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XControl
+*/
+public class _XControl extends MultiMethodTest {
+ public XControl oObj = null;
+ public XControlModel aModel = null;
+ public boolean desMode;
+
+ /**
+ * After test calls the method, the Context is set to a corresponding
+ * object relation.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _setContext() {
+ XInterface cont = (XInterface) tEnv.getObjRelation("CONTEXT");
+ oObj.setContext(cont);
+ tRes.tested("setContext()",true);
+ }
+
+ /**
+ * After test calls the method, the Context is gotten and compared
+ * with object relation 'CONTEXT'.<p>
+ * Has <b> OK </b> status if get value is equals to value set before.<p>
+ * The following method tests are to be completed successfully before:
+ * <ul>
+ * <li> <code> setContext() </code> : set Context to a corresponding
+ * object relation</li>
+ * </ul>
+ */
+ public void _getContext() {
+ requiredMethod("setContext()");
+ XInterface cont = (XInterface) tEnv.getObjRelation("CONTEXT");
+ Object get = oObj.getContext();
+ boolean res = get.equals(cont);
+ if (!res) {
+ log.println("!!! Error: getting: "+get.toString());
+ log.println("!!! expected: "+cont.toString());
+ }
+ tRes.tested("getContext()",res);
+ }
+
+
+ /**
+ * The objects needed to create peer are obtained
+ * from corresponding object relations, then the peer is created.
+ * <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _createPeer() {
+ XWindowPeer the_win = (XWindowPeer) tEnv.getObjRelation("WINPEER");
+ XToolkit the_kit = (XToolkit) tEnv.getObjRelation("TOOLKIT");
+ oObj.createPeer(the_kit,the_win);
+ tRes.tested("createPeer()",true);
+ }
+
+ /**
+ * Test calls the method. Then the the object ralation 'WINPEER' is
+ * obtained, and compared with the peer, gotten from (XControl) oObj
+ * variable.<p>
+ * Has <b> OK </b> status if peer gotten equals to peer obtained from
+ * object relation 'WINPEER'<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createPeer() </code> : create peer using 'TOOLKIT'
+ * and 'WINPEER' object relations</li>
+ * </ul>
+ */
+ public void _getPeer() {
+ requiredMethod("createPeer()");
+ boolean res = false;
+ XWindowPeer the_win = (XWindowPeer) tEnv.getObjRelation("WINPEER");
+ XWindowPeer get = oObj.getPeer();
+ if (get == null) {
+ log.println("The method 'getPeer' returns NULL");
+ } else {
+ res = true;
+ }
+ tRes.tested("getPeer()",res);
+ }
+
+
+ /**
+ * At first current model is obtained and saved to variable aModel.
+ * Then object relation 'MODEL' is gotten and test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setModel() {
+ aModel = oObj.getModel();
+ XControlModel the_model = (XControlModel) tEnv.getObjRelation("MODEL");
+ oObj.setModel(the_model);
+ tRes.tested("setModel()",true);
+ }
+
+ /**
+ * Test calls the method, then object relation 'MODEL' is gotten and
+ * compared with object returned by the method. Then previously saved
+ * value of model (aModel) restored to (XControl) oObj<p>
+ * Has <b> OK </b> status if models set and get are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setModel() </code> : setting model from corresponding
+ * object relation </li>
+ * </ul>
+ */
+ public void _getModel() {
+ requiredMethod("setModel()");
+ XControlModel the_model = (XControlModel) tEnv.getObjRelation("MODEL");
+ XControlModel get = oObj.getModel();
+ boolean res = (get.equals(the_model));
+ if (!res) {
+ log.println("getting: "+get.toString());
+ log.println("expected: "+the_model.toString());
+ }
+ if (aModel != null) {
+ oObj.setModel(aModel);
+ }
+ tRes.tested("getModel()",res);
+ }
+
+ /**
+ * Test calls the method. Then mode is checked using isDesignMode().<p>
+ * Has <b> OK </b> status if mode is swithed.
+ */
+ public void _setDesignMode() {
+ desMode = oObj.isDesignMode();
+ oObj.setDesignMode(!desMode);
+ tRes.tested("setDesignMode()",oObj.isDesignMode() == !desMode);
+ }
+
+ /**
+ * The mode is changed and result is checked.<p>
+ * Has <b> OK </b> status if the mode changed successfully.
+ */
+ public void _isDesignMode() {
+ requiredMethod("setDesignMode()");
+ oObj.setDesignMode(desMode);
+ tRes.tested("isDesignMode()", oObj.isDesignMode() == desMode);
+ }
+
+ /**
+ * Test calls the method.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _isTransparent() {
+ boolean isT = oObj.isTransparent();
+ tRes.tested("isTransparent()",true );
+ }
+
+ /**
+ * Test calls the method.<p>
+ * Has <b> OK </b> status if the method returns not null. <p>
+ */
+ public void _getView() {
+ XView the_view = oObj.getView();
+ tRes.tested("getView()", the_view != null);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XControlContainer.java b/qadevOOo/tests/java/ifc/awt/_XControlContainer.java
new file mode 100644
index 000000000000..cfb9b451b80c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XControlContainer.java
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XControlContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XControlContainer</code>
+* interface methods:
+* <ul>
+* <li><code> setStatusText() </code></li>
+* <li><code> addControl() </code></li>
+* <li><code> removeControl() </code></li>
+* <li><code> getControl() </code></li>
+* <li><code> getControls() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CONTROL1'</code> (of type <code>XControl</code>):
+* used as a parameter to addControl(), getControl() and removeControl()</li>
+* <li> <code>'CONTROL2'</code> (of type <code>XControl</code>):
+* used as a parameter to addControl(), getControl() and removeControl()</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XControlContainer
+*/
+public class _XControlContainer extends MultiMethodTest {
+ public XControlContainer oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setStatusText() {
+ oObj.setStatusText("testing XControlContainer::setStatusText(String)");
+ tRes.tested("setStatusText()",true);
+ }
+
+ /**
+ * Test calls the method twice - two controls gotten from object relations
+ * 'CONTROL1' and 'CONTROL2' added to container.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _addControl() {
+ oObj.addControl("CONTROL1", (XControl)tEnv.getObjRelation("CONTROL1"));
+ oObj.addControl("CONTROL2", (XControl)tEnv.getObjRelation("CONTROL2"));
+ tRes.tested("addControl()",true);
+ }
+
+ /**
+ * Test calls the method with object relation 'CONTROL1' as a
+ * parameter. Then control gotten from container is checked, and if returned
+ * value is null then another control 'CONTROL2' is removed from container,
+ * otherwise returned value of method test is 'false'.<p>
+ * Has <b> OK </b> status if control is removed successfully.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addControl() </code> : adds control to a container </li>
+ * <li> <code> getControl() </code> : gets control from container </li>
+ * <li> <code> getControls() </code> : gets controls from container</li>
+ * </ul>
+ */
+ public void _removeControl() {
+ boolean result = true;
+
+ requiredMethod("addControl()");
+ requiredMethod("getControl()");
+ requiredMethod("getControls()");
+ oObj.removeControl( (XControl) tEnv.getObjRelation("CONTROL1") );
+ XControl ctrl = oObj.getControl("CONTROL1");
+ if (ctrl != null) {
+ result = false;
+ log.println("'removeControl()' fails; Control still exists");
+ } else {
+ oObj.removeControl( (XControl) tEnv.getObjRelation("CONTROL2") );
+ }
+ tRes.tested("removeControl()", result);
+ }
+
+ /**
+ * Test calls the method with 'CONTROL1' as a parameter, then we just
+ * compare returned object and object relation 'CONTROL1'.<p>
+ * Has <b> OK </b> status if value returned by the method is equal to
+ * a corresponding object relation.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addControl() </code> : adds control to a container </li>
+ * </ul>
+ */
+ public void _getControl() {
+ requiredMethod("addControl()");
+ XControl xCtrlComp = oObj.getControl("CONTROL1");
+ XControl xCl = (XControl) tEnv.getObjRelation("CONTROL1");
+ tRes.tested("getControl()", xCtrlComp.equals(xCl));
+ }
+
+ /**
+ * Test calls the method, then returned value is checked.<p>
+ * Has <b> OK </b> status if returned array consists of at least two
+ * elements.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addControl() </code> : adds control to a container </li>
+ * </ul>
+ */
+ public void _getControls() {
+ requiredMethod("addControl()");
+ XControl[] xCtrls = oObj.getControls();
+ tRes.tested("getControls()",xCtrls.length >= 2);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
new file mode 100644
index 000000000000..6a98ef18100a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
@@ -0,0 +1,345 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCurrencyField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XCurrencyField;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XCurrencyField</code>
+* interface methods :
+* <ul>
+* <li><code> setValue()</code></li>
+* <li><code> getValue()</code></li>
+* <li><code> setMin()</code></li>
+* <li><code> getMin()</code></li>
+* <li><code> setMax()</code></li>
+* <li><code> getMax()</code></li>
+* <li><code> setFirst()</code></li>
+* <li><code> getFirst()</code></li>
+* <li><code> setLast()</code></li>
+* <li><code> getLast()</code></li>
+* <li><code> setSpinSize()</code></li>
+* <li><code> getSpinSize()</code></li>
+* <li><code> setDecimalDigits()</code></li>
+* <li><code> getDecimalDigits()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XCurrencyField
+*/
+public class _XCurrencyField extends MultiMethodTest {
+
+ public XCurrencyField oObj = null;
+ private double val = 0 ;
+ private double min = 0 ;
+ private double max = 0 ;
+ private double first = 0 ;
+ private double last = 0 ;
+ private double spin = 0 ;
+ private short digits = 0 ;
+ private boolean strict = true ;
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getValue </code> </li>
+ * </ul>
+ */
+ public void _setValue() {
+ requiredMethod("getValue()");
+
+ boolean result = true ;
+ oObj.setValue(val + 1.1) ;
+
+ tRes.tested("setValue()", oObj.getValue() == val + 1.1) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getValue() {
+ val = oObj.getValue() ;
+
+ tRes.tested("getValue()", true) ;
+ }
+
+ /**
+ * Sets minimal value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMin </code> </li>
+ * </ul>
+ */
+ public void _setMin() {
+ requiredMethod("getMin()") ;
+
+ oObj.setMin(min + 1.1) ;
+
+ tRes.tested("setMin()", oObj.getMin() == min + 1.1) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getMin() {
+
+ boolean result = true ;
+ min = oObj.getMin() ;
+
+ tRes.tested("getMin()", result) ;
+ }
+
+ /**
+ * Sets maximal value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMax </code> </li>
+ * </ul>
+ */
+ public void _setMax() {
+ requiredMethod("getMax()") ;
+
+ boolean result = true ;
+ oObj.setMax(max + 1.1) ;
+ result = oObj.getMax() == max + 1.1 ;
+
+ tRes.tested("setMax()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getMax() {
+
+ boolean result = true ;
+ max = oObj.getMax() ;
+
+ tRes.tested("getMax()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFirst </code> </li>
+ * </ul>
+ */
+ public void _setFirst() {
+ requiredMethod("getFirst()") ;
+
+ boolean result = true ;
+ oObj.setFirst(first + 1.1) ;
+ double ret = oObj.getFirst() ;
+ result = ret == first + 1.1 ;
+
+ tRes.tested("setFirst()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getFirst() {
+
+ boolean result = true ;
+ first = oObj.getFirst() ;
+
+ tRes.tested("getFirst()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLast </code> </li>
+ * </ul>
+ */
+ public void _setLast() {
+ requiredMethod("getLast()") ;
+
+ boolean result = true ;
+ oObj.setLast(last + 1.1) ;
+ double ret = oObj.getLast() ;
+
+ result = ret == last + 1.1 ;
+
+ tRes.tested("setLast()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getLast() {
+
+ boolean result = true ;
+ last = oObj.getLast() ;
+
+ tRes.tested("getLast()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSpinSize </code> </li>
+ * </ul>
+ */
+ public void _setSpinSize() {
+ requiredMethod("getSpinSize()") ;
+
+ boolean result = true ;
+ oObj.setSpinSize(spin + 1.1) ;
+ result = oObj.getSpinSize() == spin + 1.1 ;
+
+ tRes.tested("setSpinSize()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getSpinSize() {
+
+ boolean result = true ;
+ spin = oObj.getSpinSize() ;
+
+ tRes.tested("getSpinSize()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDecimalDigits </code> </li>
+ * </ul>
+ */
+ public void _setDecimalDigits() {
+ requiredMethod("getDecimalDigits()") ;
+
+ boolean result = true ;
+ oObj.setDecimalDigits((short)(digits + 1)) ;
+
+ short res = oObj.getDecimalDigits() ;
+ result = res == ((short)digits + 1) ;
+
+ tRes.tested("setDecimalDigits()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getDecimalDigits() {
+
+ boolean result = true ;
+ digits = oObj.getDecimalDigits() ;
+
+ tRes.tested("getDecimalDigits()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()") ;
+
+ boolean result = true ;
+ oObj.setStrictFormat(!strict) ;
+ result = oObj.isStrictFormat() == !strict ;
+
+ tRes.tested("setStrictFormat()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true ;
+ strict = oObj.isStrictFormat() ;
+
+ tRes.tested("isStrictFormat()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XDataTransferProviderAccess.java b/qadevOOo/tests/java/ifc/awt/_XDataTransferProviderAccess.java
new file mode 100644
index 000000000000..36ab38972660
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XDataTransferProviderAccess.java
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataTransferProviderAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XDataTransferProviderAccess;
+import com.sun.star.awt.XWindow;
+import com.sun.star.datatransfer.clipboard.XClipboard;
+import com.sun.star.datatransfer.dnd.XDragGestureRecognizer;
+import com.sun.star.datatransfer.dnd.XDragSource;
+import com.sun.star.datatransfer.dnd.XDropTarget;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.awt.XDataTransferProviderAccess</code>
+* interface methods :
+* <ul>
+* <li><code> getDragGestureRecognizer()</code></li>
+* <li><code> getDragSource()</code></li>
+* <li><code> getDropTarget()</code></li>
+* <li><code> getClipboard()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XDataTransferProviderAccess.XWindow'</code>
+* (of type <code>com.sun.star.awt.XWindow</code>):
+* this window must created by the Toolkit tested. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XDataTransferProviderAccess
+*/
+public class _XDataTransferProviderAccess extends MultiMethodTest {
+
+ public XDataTransferProviderAccess oObj = null;
+ protected XWindow win = null ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ win = (XWindow) tEnv.getObjRelation
+ ("XDataTransferProviderAccess.XWindow") ;
+ if (win == null) throw new StatusException(Status.failed
+ ("Relation not found")) ;
+ }
+
+ /**
+ * Tries to get gesture recognizer for the window passed as
+ * relation. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned
+ */
+ public void _getDragGestureRecognizer() {
+
+ boolean result = true ;
+ XDragGestureRecognizer rec = oObj.getDragGestureRecognizer(win) ;
+
+ result = rec != null ;
+
+ tRes.tested("getDragGestureRecognizer()", result) ;
+ }
+
+ /**
+ * Tries to get drag source for the window passed as
+ * relation. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned
+ */
+ public void _getDragSource() {
+
+ boolean result = true ;
+ XDragSource src = oObj.getDragSource(win) ;
+
+ result = src != null ;
+
+ tRes.tested("getDragSource()", result) ;
+ }
+
+ /**
+ * Tries to get drop target for the window passed as
+ * relation. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned
+ */
+ public void _getDropTarget() {
+
+ boolean result = true ;
+ XDropTarget targ = oObj.getDropTarget(win) ;
+
+ result = targ != null ;
+
+ tRes.tested("getDropTarget()", result) ;
+ }
+
+ /**
+ * Tries to obtain default clipboard.<p>
+ * Has <b> OK </b> status if not <code>null</code> value returned.
+ */
+ public void _getClipboard() {
+
+ boolean result = true ;
+ XClipboard cb = oObj.getClipboard("") ;
+
+ result = cb != null ;
+
+ tRes.tested("getClipboard()", result) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XDateField.java b/qadevOOo/tests/java/ifc/awt/_XDateField.java
new file mode 100644
index 000000000000..185b913e551f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XDateField.java
@@ -0,0 +1,369 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDateField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XDateField;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XDateField</code>
+* interface methods :
+* <ul>
+* <li><code> setDate()</code></li>
+* <li><code> getDate()</code></li>
+* <li><code> setMin()</code></li>
+* <li><code> getMin()</code></li>
+* <li><code> setMax()</code></li>
+* <li><code> getMax()</code></li>
+* <li><code> setFirst()</code></li>
+* <li><code> getFirst()</code></li>
+* <li><code> setLast()</code></li>
+* <li><code> getLast()</code></li>
+* <li><code> setLongFormat()</code></li>
+* <li><code> isLongFormat()</code></li>
+* <li><code> setEmpty()</code></li>
+* <li><code> isEmpty()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XDateField
+*/
+public class _XDateField extends MultiMethodTest {
+
+ public XDateField oObj = null;
+
+ private boolean strict = false ;
+ private boolean longFormat = false ;
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getTime </code> </li>
+ * </ul>
+ */
+ public void _setDate() {
+ requiredMethod("getDate()") ;
+
+ boolean result = true ;
+ oObj.setDate(5087) ;
+
+ result = oObj.getDate() == 5087 ;
+
+ tRes.tested("setDate()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getDate() {
+
+ boolean result = true ;
+ oObj.getDate() ;
+
+ tRes.tested("getDate()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMin </code> </li>
+ * </ul>
+ */
+ public void _setMin() {
+
+ boolean result = true ;
+ oObj.setMin(4978) ;
+
+ result = oObj.getMin() == 4978 ;
+
+ tRes.tested("setMin()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getMin() {
+
+ boolean result = true ;
+ oObj.getMin() ;
+
+ tRes.tested("getMin()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMax </code> </li>
+ * </ul>
+ */
+ public void _setMax() {
+
+ boolean result = true ;
+ oObj.setMax(27856) ;
+
+ result = oObj.getMax() == 27856 ;
+
+ tRes.tested("setMax()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getMax() {
+
+ boolean result = true ;
+ oObj.getMax() ;
+
+ tRes.tested("getMax()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFirst </code> </li>
+ * </ul>
+ */
+ public void _setFirst() {
+
+ boolean result = true ;
+ oObj.setFirst(5118) ;
+
+ result = oObj.getFirst() == 5118 ;
+
+ if (!result) {
+ log.println("Set to " + 5118 + " but returned " + oObj.getFirst()) ;
+ }
+
+ tRes.tested("setFirst()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getFirst() {
+
+ boolean result = true ;
+ int val = oObj.getFirst() ;
+
+ log.println("getFirst() = " + val) ;
+
+ tRes.tested("getFirst()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLast </code> </li>
+ * </ul>
+ */
+ public void _setLast() {
+
+ boolean result = true ;
+ oObj.setLast(23450) ;
+
+ result = oObj.getLast() == 23450 ;
+
+ if (!result) {
+ log.println("Set to " + 23450 + " but returned " + oObj.getLast()) ;
+ }
+
+ tRes.tested("setLast()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getLast() {
+
+ boolean result = true ;
+ int val = oObj.getLast() ;
+
+ log.println("getLast() = " + val) ;
+
+ tRes.tested("getLast()", result) ;
+ }
+
+ /**
+ * Sets the value to empty. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTime </code> : value must be not empty </li>
+ * </ul>
+ */
+ public void _setEmpty() {
+ requiredMethod("setDate()") ;
+
+ boolean result = true ;
+ oObj.setEmpty() ;
+
+ tRes.tested("setEmpty()", result) ;
+ }
+
+ /**
+ * Checks if the field is empty. <p>
+ * Has <b> OK </b> status if the value is empty.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setEmpty() </code> </li>
+ * </ul>
+ */
+ public void _isEmpty() {
+ requiredMethod("setEmpty()") ;
+
+ boolean result = true ;
+ result = oObj.isEmpty() ;
+
+ tRes.tested("isEmpty()", result) ;
+ }
+
+ /**
+ * Checks strict state. <p>
+ * Has <b> OK </b> status if strict format is properly set.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()") ;
+
+ boolean result = true ;
+ oObj.setStrictFormat(!strict) ;
+
+ result = oObj.isStrictFormat() == !strict ;
+
+ if (!result) {
+ log.println("Was '" + strict + "', set to '" + !strict +
+ "' but returned '" + oObj.isStrictFormat() + "'") ;
+ }
+
+ tRes.tested("setStrictFormat()", result) ;
+ }
+
+ /**
+ * Gets strict state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true ;
+ strict = oObj.isStrictFormat() ;
+
+ tRes.tested("isStrictFormat()", result) ;
+ }
+
+
+ /**
+ * Checks long format state. <p>
+ * Has <b> OK </b> status if long format is properly set.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isLongFormat </code> </li>
+ * </ul>
+ */
+ public void _setLongFormat() {
+
+ boolean result = true ;
+ oObj.setLongFormat(!longFormat) ;
+
+ result = oObj.isLongFormat() == !longFormat ;
+
+ if (!result) {
+ log.println("Was '" + longFormat + "', set to '" + !longFormat +
+ "' but returned '" + oObj.isLongFormat() + "'") ;
+ }
+
+ tRes.tested("setLongFormat()", result) ;
+ }
+
+ /**
+ * Gets long format state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _isLongFormat() {
+
+ boolean result = true ;
+ longFormat = oObj.isLongFormat() ;
+
+ tRes.tested("isLongFormat()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XDialog.java b/qadevOOo/tests/java/ifc/awt/_XDialog.java
new file mode 100644
index 000000000000..862c15c141d1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XDialog.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDialog.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.XDialog;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XDialog</code>
+* interface methods :
+* <ul>
+* <li><code> setTitle()</code></li>
+* <li><code> getTitle()</code></li>
+* <li><code> execute()</code></li>
+* <li><code> endExecute()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.awt.XDialog
+*/
+public class _XDialog extends MultiMethodTest {
+
+ public XDialog oObj = null;
+
+ /**
+ * As <code>execute()</code> method is a blocking call,
+ * then it must be executed in a separate thread. This
+ * thread class just call <code>execute</code> method
+ * of tested object.
+ */
+ protected Thread execThread = new Thread(
+ new Runnable() {
+ public void run() {
+ oObj.execute() ;
+ }
+ }) ;
+
+ /**
+ * Sets the title to some string. <p>
+ * Has <b>OK</b> status if no runtime exceptions occurs.
+ */
+ public void _setTitle() {
+
+ oObj.setTitle("XDialog test") ;
+
+ tRes.tested("setTitle()", true) ;
+ }
+
+ /**
+ * Gets the title and compares it to the value set in
+ * <code>setTitle</code> method test. <p>
+ * Has <b>OK</b> status is set/get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTitle </code> </li>
+ * </ul>
+ */
+ public void _getTitle() {
+ requiredMethod("setTitle()") ;
+
+ tRes.tested("getTitle()",
+ "XDialog test".equals(oObj.getTitle())) ;
+ }
+
+ /**
+ * Starts the execution of dialog in a separate thread.
+ * As this call is blocking then the thread execution
+ * must not be finished. <p>
+ * Has <b>OK</b> status if thread wasn't finished and
+ * no exceptions occured.
+ */
+ public void _execute() {
+ boolean result = true ;
+
+ log.println("Starting execute() thread ...") ;
+ execThread.start() ;
+
+ try {
+ execThread.join(200) ;
+ } catch (InterruptedException e) {
+ log.println("execute() thread was interrupted") ;
+ result = false ;
+ }
+ result &= execThread.isAlive() ;
+
+ tRes.tested("execute()", result) ;
+ }
+
+ /**
+ * Calls the method and checks if the execution thread
+ * where <code>execute()</code> method is running was
+ * finished. If <code>execute</code> method didn't return
+ * and still running then thread interrupted. <p>
+ * Has <b>OK</b> status if <code>execute</code> method
+ * call successfully retured.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> execute </code> </li>
+ * </ul>
+ */
+ public void _endExecute() {
+ requiredMethod("execute()") ;
+
+ boolean result = true ;
+
+ oObj.endExecute() ;
+
+ try {
+ execThread.join(200) ;
+ } catch (InterruptedException e) {
+ log.println("execute() thread was interrupted") ;
+ result = false ;
+ }
+
+ if (execThread.isAlive()) {
+ execThread.interrupt() ;
+ }
+
+ result &= !execThread.isAlive() ;
+
+ tRes.tested("endExecute()", result) ;
+ }
+
+ /**
+ * Disposes object environment.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XFixedText.java b/qadevOOo/tests/java/ifc/awt/_XFixedText.java
new file mode 100644
index 000000000000..40c81289ef1b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XFixedText.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFixedText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.TextAlign;
+import com.sun.star.awt.XFixedText;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XFixedText</code>
+* interface methods :
+* <ul>
+* <li><code> setText()</code></li>
+* <li><code> getText()</code></li>
+* <li><code> setAlignment()</code></li>
+* <li><code> getAlignment()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XFixedText
+*/
+public class _XFixedText extends MultiMethodTest {
+
+ public XFixedText oObj = null;
+ private String text = null ;
+ private int align = -1 ;
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getText </code> </li>
+ * </ul>
+ */
+ public void _setText() {
+ requiredMethod("getText()") ;
+
+ boolean result = true ;
+ oObj.setText(text + "_") ;
+ result = (text+"_").equals(oObj.getText()) ;
+
+ tRes.tested("setText()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getText() {
+
+ boolean result = true ;
+ text = oObj.getText() ;
+ if (util.utils.isVoid(text)) text = "XFixedText";
+
+ tRes.tested("getText()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getAlignment </code> </li>
+ * </ul>
+ */
+ public void _setAlignment() {
+ requiredMethod("getAlignment()") ;
+
+ boolean result = true ;
+ int newAlign = align ==
+ TextAlign.CENTER ? TextAlign.LEFT : TextAlign.CENTER ;
+ oObj.setAlignment((short)newAlign) ;
+ short getAlign = oObj.getAlignment() ;
+ result = newAlign == getAlign ;
+
+ tRes.tested("setAlignment()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getAlignment() {
+
+ boolean result = true ;
+ align = oObj.getAlignment() ;
+
+ tRes.tested("getAlignment()", result) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XItemListener.java b/qadevOOo/tests/java/ifc/awt/_XItemListener.java
new file mode 100644
index 000000000000..2ef3ac51bb3d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XItemListener.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XItemListener.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.ItemEvent;
+import com.sun.star.awt.XItemListener;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.awt.XItemListener</code>
+* interface methods :
+* <ul>
+* <li><code> itemStateChanged()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'TestItemListener'</code>
+* (of type <code>ifc.awt._XItemListener.TestItemListener</code>):
+* this <code>XItemListener</code> implementation must be
+* added to the object tested for checking
+* <code> itemStateChanged()</code> method call. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XItemListener
+*/
+public class _XItemListener extends MultiMethodTest {
+
+ public XItemListener oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ * and stores event passed.
+ */
+ public static class TestItemListener implements com.sun.star.awt.XItemListener {
+ public boolean itemStateChangedCalled = false ;
+ public ItemEvent event = null ;
+
+ public void itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true ;
+ event = e ;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject e) {}
+
+ }
+
+ TestItemListener itemListener = null ;
+
+ /**
+ * Retrieves object relation.
+ * @throws StatusException If the relation not found.
+ */
+ public void before() {
+ itemListener = (TestItemListener) tEnv.getObjRelation("TestItemListener") ;
+ if (itemListener == null)
+ throw new StatusException(Status.failed("Relation not found")) ;
+ }
+
+ /**
+ * First a <code>ItemEvent</code> object created and
+ * it is passed to <code>itemStateChanged</code> method
+ * call. Then a short wait follows for listener already
+ * registered at the object to be caled. <p>
+ * Has <b> OK </b> status if the listener was called with
+ * the same <code>ItemEvent</code> object as was created
+ * before.
+ */
+ public void _itemStateChanged() {
+
+ boolean result = true ;
+
+ ItemEvent event = new ItemEvent() ;
+ event.Selected = 1 ;
+ event.Highlighted = 2 ;
+ oObj.itemStateChanged(event) ;
+
+ try {
+ Thread.sleep(200) ;
+ } catch (InterruptedException e) {}
+
+ result = itemListener.itemStateChangedCalled &&
+ itemListener.event.Selected == 1 &&
+ itemListener.event.Highlighted == 2 ;
+
+ tRes.tested("itemStateChanged()", result) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XLayoutConstrains.java b/qadevOOo/tests/java/ifc/awt/_XLayoutConstrains.java
new file mode 100644
index 000000000000..0a7df78a46d6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XLayoutConstrains.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLayoutConstrains.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XLayoutConstrains;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XLayoutConstrains</code>
+* interface methods:
+* <ul>
+* <li><code> getMinimumSize() </code></li>
+* <li><code> getPreferredSize() </code></li>
+* <li><code> calcAdjustedSize() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XLayoutConstrains
+*/
+public class _XLayoutConstrains extends MultiMethodTest {
+ public XLayoutConstrains oObj = null;
+
+ /**
+ * Test calls the method, then check if returned value is not null.<p>
+ * Has <b> OK </b> status if the method returns not null.
+ */
+ public void _getMinimumSize() {
+ Size aSize = oObj.getMinimumSize();
+ tRes.tested("getMinimumSize()", aSize != null);
+ }
+
+ /**
+ * Test calls the method, then check if returned value is not null.<p>
+ * Has <b> OK </b> status if the method returns not null.
+ */
+ public void _getPreferredSize() {
+ Size aSize = oObj.getPreferredSize();
+ tRes.tested("getPreferredSize()", aSize != null);
+ }
+
+ /**
+ * Test calls the method with the new size as a parameter.<p>
+ * Has <b> OK </b> status if the method returns not null.
+ */
+ public void _calcAdjustedSize() {
+ Size aSize = oObj.calcAdjustedSize(new Size(50,50));
+ tRes.tested("calcAdjustedSize()", aSize != null);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XListBox.java b/qadevOOo/tests/java/ifc/awt/_XListBox.java
new file mode 100644
index 000000000000..6de58b4a2059
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XListBox.java
@@ -0,0 +1,553 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XListBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XListBox;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.awt.XListBox</code>
+* interface methods :
+* <ul>
+* <li><code> addItemListener()</code></li>
+* <li><code> removeItemListener()</code></li>
+* <li><code> addActionListener()</code></li>
+* <li><code> removeActionListener()</code></li>
+* <li><code> addItem()</code></li>
+* <li><code> addItems()</code></li>
+* <li><code> removeItems()</code></li>
+* <li><code> getItemCount()</code></li>
+* <li><code> getItem()</code></li>
+* <li><code> getItems()</code></li>
+* <li><code> getSelectedItemPos()</code></li>
+* <li><code> getSelectedItemsPos()</code></li>
+* <li><code> getSelectedItem()</code></li>
+* <li><code> getSelectedItems()</code></li>
+* <li><code> selectItemPos()</code></li>
+* <li><code> selectItemsPos()</code></li>
+* <li><code> selectItem()</code></li>
+* <li><code> isMutipleMode()</code></li>
+* <li><code> setMultipleMode()</code></li>
+* <li><code> getDropDownLineCount()</code></li>
+* <li><code> setDropDownLineCount()</code></li>
+* <li><code> makeVisible()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XListBox
+*/
+public class _XListBox extends MultiMethodTest {
+
+ public XListBox oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestActionListener implements com.sun.star.awt.XActionListener {
+ public boolean disposingCalled = false ;
+ public boolean actionPerformedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void actionPerformed(com.sun.star.awt.ActionEvent e) {
+ actionPerformedCalled = true ;
+ }
+
+ }
+
+ TestActionListener actionListener = new TestActionListener() ;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestItemListener implements com.sun.star.awt.XItemListener {
+ public boolean disposingCalled = false ;
+ public boolean itemStateChangedCalled = false ;
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ }
+
+ public void itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true ;
+ }
+
+ }
+
+ TestItemListener itemListener = new TestItemListener() ;
+
+ short lineCount = 0 ;
+ short itemCount = 0 ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ itemCount = oObj.getItemCount();
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addItemListener() {
+
+ boolean result = true ;
+ oObj.addItemListener(itemListener) ;
+
+ tRes.tested("addItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeItemListener() {
+ requiredMethod("addItemListener()") ;
+
+ boolean result = true ;
+ oObj.removeItemListener(itemListener) ;
+
+ tRes.tested("removeItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addActionListener() {
+
+ boolean result = true ;
+ oObj.addActionListener(actionListener) ;
+
+ tRes.tested("addActionListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeActionListener() {
+ requiredMethod("addActionListener()") ;
+
+ boolean result = true ;
+ oObj.removeActionListener(actionListener) ;
+
+ tRes.tested("removeActionListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * Adds one item to the last position and check the number of
+ * items after addition. <p>
+ * Has <b>OK</b> status if the number of items increased by 1.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getItemCount </code> </li>
+ * </ul>
+ */
+ public void _addItem() {
+ requiredMethod("getItemCount()") ;
+
+ boolean result = true ;
+ oObj.addItem("Item1", itemCount) ;
+ result = oObj.getItemCount() == itemCount + 1 ;
+
+ tRes.tested("addItem()", result) ;
+ }
+
+ /**
+ * Adds one two items to the last position and check the number of
+ * items after addition. <p>
+ * Has <b>OK</b> status if the number of items increased by 2.<p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItem </code> </li>
+ * </ul>
+ */
+ public void _addItems() {
+ executeMethod("addItem()") ;
+
+ boolean result = true ;
+ short oldCnt = oObj.getItemCount() ;
+ oObj.addItems(new String[] {"Item2", "Item3"}, oldCnt) ;
+ result = oObj.getItemCount() == oldCnt + 2 ;
+
+ tRes.tested("addItems()", result) ;
+ }
+
+ /**
+ * Gets the current number of items and tries to remove them all
+ * then checks number of items. <p>
+ * Has <b>OK</b> status if no items remains. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getItems </code> </li>
+ * <li> <code> getItem </code> </li>
+ * </ul>
+ */
+ public void _removeItems() {
+ executeMethod("getItems()") ;
+ executeMethod("getItem()") ;
+ executeMethod("getSelectedItemPos()") ;
+ executeMethod("getSelectedItemsPos()") ;
+ executeMethod("getSelectedItem()") ;
+ executeMethod("getSelectedItems()") ;
+
+ boolean result = true ;
+ short oldCnt = oObj.getItemCount() ;
+ oObj.removeItems((short)0, oldCnt) ;
+ result = oObj.getItemCount() == 0 ;
+
+ tRes.tested("removeItems()", result) ;
+ }
+
+ /**
+ * Just retrieves current number of items and stores it. <p>
+ * Has <b>OK</b> status if the count is not less than 0.
+ */
+ public void _getItemCount() {
+
+ boolean result = true ;
+ itemCount = oObj.getItemCount() ;
+
+ tRes.tested("getItemCount()", itemCount >= 0) ;
+ }
+
+ /**
+ * After <code>addItem</code> and <code>addItems</code> methods
+ * test the following items must exist {..., "Item1", "Item2", "Item3"}
+ * Retrieves the item from the position which was ititially the last.<p>
+ * Has <b>OK</b> status if the "Item1" was retrieved. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _getItem() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ String item = oObj.getItem(itemCount) ;
+ result = "Item1".equals(item) ;
+
+ tRes.tested("getItem()", result) ;
+ }
+
+ /**
+ * After <code>addItem</code> and <code>addItems</code> methods
+ * test the following items must exist {..., "Item1", "Item2", "Item3"}
+ * Retrieves all items. <p>
+ * Has <b>OK</b> status if the last three items retrieved are
+ * "Item1", "Item2" and "Item3". <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _getItems() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ String[] items = oObj.getItems() ;
+ for (int i = itemCount; i < (itemCount + 3); i++) {
+ result &= ("Item" + (i+1 - itemCount)).equals(items[i]) ;
+ }
+
+ tRes.tested("getItems()", result) ;
+ }
+
+ /**
+ * Gets line count and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getDropDownLineCount() {
+
+ boolean result = true ;
+ lineCount = oObj.getDropDownLineCount() ;
+
+ tRes.tested("getDropDownLineCount()", result) ;
+ }
+
+ /**
+ * Sets a new value and then checks get value. <p>
+ * Has <b>OK</b> status if set and get values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDropDownLineCount </code> </li>
+ * </ul>
+ */
+ public void _setDropDownLineCount() {
+ requiredMethod("getDropDownLineCount()") ;
+
+ boolean result = true ;
+ oObj.setDropDownLineCount((short)(lineCount + 1)) ;
+ result = oObj.getDropDownLineCount() == lineCount + 1 ;
+
+ tRes.tested("setDropDownLineCount()", result) ;
+ }
+
+ /**
+ * Selects some item and gets selected item position. <p>
+ * Has <b> OK </b> status if position is equal to position set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _getSelectedItemPos() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ oObj.selectItemPos((short)1, true) ;
+ short pos = oObj.getSelectedItemPos() ;
+
+ result = pos == 1 ;
+
+ tRes.tested("getSelectedItemPos()", result) ;
+ }
+
+ /**
+ * Clears all selections, then selects some items and gets selected
+ * item positions. <p>
+ * Has <b> OK </b> status if positions get are the same as were set.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> selectItemsPos </code> </li>
+ * </ul>
+ */
+ public void _getSelectedItemsPos() {
+ requiredMethod("selectItemsPos()") ;
+
+ boolean result = true ;
+ short cnt = oObj.getItemCount() ;
+ for (short i = 0; i < cnt; i++) {
+ oObj.selectItemPos(i, false) ;
+ }
+ oObj.selectItemsPos(new short[] {0, 2}, true) ;
+
+ short[] items = oObj.getSelectedItemsPos() ;
+
+ result = items != null && items.length == 2 &&
+ items[0] == 0 && items[1] == 2 ;
+
+ tRes.tested("getSelectedItemsPos()", result) ;
+ }
+
+ /**
+ * Unselects all items, selects some item and then gets selected item. <p>
+ * Has <b> OK </b> status if items selected and get are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _getSelectedItem() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ short cnt = oObj.getItemCount() ;
+ for (short i = 0; i < cnt; i++) {
+ oObj.selectItemPos(i, false) ;
+ }
+ oObj.selectItem("Item3", true) ;
+ String item = oObj.getSelectedItem() ;
+
+ result = "Item3".equals(item) ;
+
+ tRes.tested("getSelectedItem()", result) ;
+ }
+
+ /**
+ * Clears all selections, then selects some items positions and gets
+ * selected items. <p>
+ * Has <b> OK </b> status if items get are the same as items on
+ * positions which were set.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> selectItemsPos </code> </li>
+ * <li> <code> getItem </code>: this method is used here for checking.
+ * </li>
+ * </ul>
+ */
+ public void _getSelectedItems() {
+ requiredMethod("selectItemsPos()") ;
+ requiredMethod("getItem()") ;
+
+ boolean result = true ;
+ short cnt = oObj.getItemCount() ;
+ for (short i = 0; i < cnt; i++) {
+ oObj.selectItemPos(i, false) ;
+ }
+ oObj.selectItemsPos(new short[] {0, 2}, true) ;
+
+ String[] items = oObj.getSelectedItems() ;
+ result = items != null && items.length == 2 &&
+ oObj.getItem((short)0).equals(items[0]) &&
+ oObj.getItem((short)2).equals(items[1]) ;
+
+ tRes.tested("getSelectedItems()", result) ;
+ }
+
+ /**
+ * Unselects all items, then selects a single item. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _selectItemPos() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ short cnt = oObj.getItemCount() ;
+ for (short i = 0; i < cnt; i++) {
+ oObj.selectItemPos(i, false) ;
+ }
+ oObj.selectItemPos((short)1, true) ;
+
+ tRes.tested("selectItemPos()", result) ;
+ }
+
+ /**
+ * Just selects some items. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _selectItemsPos() {
+ requiredMethod("addItems()") ;
+ requiredMethod("setMultipleMode()") ;
+
+ boolean result = true ;
+ oObj.selectItemsPos(new short[] {0, 2}, true) ;
+
+ tRes.tested("selectItemsPos()", result) ;
+ }
+
+ /**
+ * Just selects an item. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> : to have some items </li>
+ * </ul>
+ */
+ public void _selectItem() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ oObj.selectItem("Item3", true) ;
+
+ tRes.tested("selectItem()", result) ;
+ }
+
+ /**
+ * Checks if multiple mode is set. <p>
+ * Has <b> OK </b> status if multiple mode is set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setMultipleMode </code> </li>
+ * </ul>
+ */
+ public void _isMutipleMode() {
+ requiredMethod("setMultipleMode()") ;
+
+ boolean result = true ;
+ result = oObj.isMutipleMode() ;
+
+ tRes.tested("isMutipleMode()", result) ;
+ }
+
+ /**
+ * Sets multiple mode. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _setMultipleMode() {
+
+ boolean result = true ;
+ oObj.setMultipleMode(true) ;
+
+ tRes.tested("setMultipleMode()", result) ;
+ }
+
+ /**
+ * Just calls the method to make visible third item. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addItems </code> </li>
+ * </ul>
+ */
+ public void _makeVisible() {
+ requiredMethod("addItems()") ;
+
+ boolean result = true ;
+ oObj.makeVisible((short)2) ;
+
+ tRes.tested("makeVisible()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XNumericField.java b/qadevOOo/tests/java/ifc/awt/_XNumericField.java
new file mode 100644
index 000000000000..39adabacbc8f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XNumericField.java
@@ -0,0 +1,345 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNumericField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XNumericField;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XNumericField</code>
+* interface methods :
+* <ul>
+* <li><code> setValue()</code></li>
+* <li><code> getValue()</code></li>
+* <li><code> setMin()</code></li>
+* <li><code> getMin()</code></li>
+* <li><code> setMax()</code></li>
+* <li><code> getMax()</code></li>
+* <li><code> setFirst()</code></li>
+* <li><code> getFirst()</code></li>
+* <li><code> setLast()</code></li>
+* <li><code> getLast()</code></li>
+* <li><code> setSpinSize()</code></li>
+* <li><code> getSpinSize()</code></li>
+* <li><code> setDecimalDigits()</code></li>
+* <li><code> getDecimalDigits()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XNumericField
+*/
+public class _XNumericField extends MultiMethodTest {
+
+ public XNumericField oObj = null;
+ private double val = 0 ;
+ private double min = 0 ;
+ private double max = 0 ;
+ private double first = 0 ;
+ private double last = 0 ;
+ private double spin = 0 ;
+ private short digits = 0 ;
+ private boolean strict = true ;
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getValue </code> </li>
+ * </ul>
+ */
+ public void _setValue() {
+ requiredMethod("getValue()");
+
+ boolean result = true ;
+ oObj.setValue(val + 1.1) ;
+
+ tRes.tested("setValue()", oObj.getValue() == val + 1.1) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getValue() {
+ val = oObj.getValue() ;
+
+ tRes.tested("getValue()", true) ;
+ }
+
+ /**
+ * Sets minimal value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMin </code> </li>
+ * </ul>
+ */
+ public void _setMin() {
+ requiredMethod("getMin()") ;
+
+ oObj.setMin(min + 1.1) ;
+
+ tRes.tested("setMin()", oObj.getMin() == min + 1.1) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getMin() {
+
+ boolean result = true ;
+ min = oObj.getMin() ;
+
+ tRes.tested("getMin()", result) ;
+ }
+
+ /**
+ * Sets maximal value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMax </code> </li>
+ * </ul>
+ */
+ public void _setMax() {
+ requiredMethod("getMax()") ;
+
+ boolean result = true ;
+ oObj.setMax(max + 1.1) ;
+ result = oObj.getMax() == max + 1.1 ;
+
+ tRes.tested("setMax()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getMax() {
+
+ boolean result = true ;
+ max = oObj.getMax() ;
+
+ tRes.tested("getMax()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFirst </code> </li>
+ * </ul>
+ */
+ public void _setFirst() {
+ requiredMethod("getFirst()") ;
+
+ boolean result = true ;
+ oObj.setFirst(first + 1.1) ;
+ double ret = oObj.getFirst() ;
+ result = ret == first + 1.1 ;
+
+ tRes.tested("setFirst()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getFirst() {
+
+ boolean result = true ;
+ first = oObj.getFirst() ;
+
+ tRes.tested("getFirst()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLast </code> </li>
+ * </ul>
+ */
+ public void _setLast() {
+ requiredMethod("getLast()") ;
+
+ boolean result = true ;
+ oObj.setLast(last + 1.1) ;
+ double ret = oObj.getLast() ;
+
+ result = ret == last + 1.1 ;
+
+ tRes.tested("setLast()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getLast() {
+
+ boolean result = true ;
+ last = oObj.getLast() ;
+
+ tRes.tested("getLast()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSpinSize </code> </li>
+ * </ul>
+ */
+ public void _setSpinSize() {
+ requiredMethod("getSpinSize()") ;
+
+ boolean result = true ;
+ oObj.setSpinSize(spin + 1.1) ;
+ result = oObj.getSpinSize() == spin + 1.1 ;
+
+ tRes.tested("setSpinSize()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getSpinSize() {
+
+ boolean result = true ;
+ spin = oObj.getSpinSize() ;
+
+ tRes.tested("getSpinSize()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDecimalDigits </code> </li>
+ * </ul>
+ */
+ public void _setDecimalDigits() {
+ requiredMethod("getDecimalDigits()") ;
+
+ boolean result = true ;
+ oObj.setDecimalDigits((short)(digits + 1)) ;
+
+ short res = oObj.getDecimalDigits() ;
+ result = res == ((short)digits + 1) ;
+
+ tRes.tested("setDecimalDigits()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getDecimalDigits() {
+
+ boolean result = true ;
+ digits = oObj.getDecimalDigits() ;
+
+ tRes.tested("getDecimalDigits()", result) ;
+ }
+
+ /**
+ * Sets value changed and then compares it to get value. <p>
+ * Has <b>OK</b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()") ;
+
+ boolean result = true ;
+ oObj.setStrictFormat(!strict) ;
+ result = oObj.isStrictFormat() == !strict ;
+
+ tRes.tested("setStrictFormat()", result) ;
+ }
+
+ /**
+ * Just calls the method and stores value returned. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true ;
+ strict = oObj.isStrictFormat() ;
+
+ tRes.tested("isStrictFormat()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XPatternField.java b/qadevOOo/tests/java/ifc/awt/_XPatternField.java
new file mode 100644
index 000000000000..e6216851a80a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XPatternField.java
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPatternField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XPatternField;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XPatternField</code>
+* interface methods :
+* <ul>
+* <li><code> setMasks()</code></li>
+* <li><code> getMasks()</code></li>
+* <li><code> setString()</code></li>
+* <li><code> getString()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XPatternField
+*/
+public class _XPatternField extends MultiMethodTest {
+
+ public XPatternField oObj = null ;
+ private String editMask = null ;
+ private String literalMask = null ;
+ private String string = null ;
+ private boolean strict = false ;
+
+ /**
+ * Sets masks to new values then gets them and compare. <p>
+ * Has <b> OK </b> status if set and get masks are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMasks </code> </li>
+ * </ul>
+ */
+ public void _setMasks() {
+ requiredMethod("getMasks()") ;
+
+ boolean result = true ;
+ String newEdit = editMask == null ? "ccc" : editMask + "ccc" ;
+ String newLiteral = literalMask == null ? " " : literalMask + " " ;
+ oObj.setMasks(newEdit, newLiteral) ;
+
+ String[] edit = new String[1] ;
+ String[] literal = new String[1] ;
+ oObj.getMasks(edit, literal) ;
+
+ result &= newEdit.equals(edit[0]) ;
+ result &= newLiteral.equals(literal[0]) ;
+
+ tRes.tested("setMasks()", result) ;
+ }
+
+ /**
+ * Gets masks and stores them. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _getMasks() {
+
+ boolean result = true ;
+ String[] edit = new String[1] ;
+ String[] literal = new String[1] ;
+ oObj.getMasks(edit, literal) ;
+
+ log.println("Edit mask = '" + edit[0] + "', literal = '" +
+ literal[0] + "'") ;
+
+ editMask = edit[0] ;
+ literalMask = literal[0] ;
+
+ tRes.tested("getMasks()", result) ;
+ }
+
+ /**
+ * Sets new string and then get it for verification. <p>
+ * Has <b> OK </b> status if get and set strings are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getString </code> </li>
+ * <li> <code> setMasks </code> : mask must be set for new string
+ * would be valid. </li>
+ * </ul>
+ */
+ public void _setString() {
+ requiredMethod("setMasks()") ;
+ requiredMethod("getString()") ;
+
+ boolean result = true ;
+ String newString = string = "abc" ;
+ oObj.setString(newString) ;
+ String getString = oObj.getString() ;
+
+ result = newString.equals(getString) ;
+
+ if (!result) {
+ log.println("Was '" + string + "', Set '" + newString
+ + "', Get '" + getString + "'") ;
+ }
+
+ tRes.tested("setString()", result) ;
+ }
+
+ /**
+ * Gets current string and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getString() {
+
+ boolean result = true ;
+ string = oObj.getString() ;
+
+ tRes.tested("getString()", result) ;
+ }
+
+ /**
+ * Sets new strict state then checks it. <p>
+ * Has <b> OK </b> status if the state was changed.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()") ;
+
+ boolean result = true ;
+ oObj.setStrictFormat(!strict) ;
+
+ result = oObj.isStrictFormat() == !strict ;
+
+ tRes.tested("setStrictFormat()", result) ;
+ }
+
+ /**
+ * Gets the current strict state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true ;
+ strict = oObj.isStrictFormat() ;
+
+ tRes.tested("isStrictFormat()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XRadioButton.java b/qadevOOo/tests/java/ifc/awt/_XRadioButton.java
new file mode 100644
index 000000000000..497aab506bfb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XRadioButton.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRadioButton.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XRadioButton;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.awt.XRadioButton</code>
+* interface methods :
+* <ul>
+* <li><code> addItemListener()</code></li>
+* <li><code> removeItemListener()</code></li>
+* <li><code> getState()</code></li>
+* <li><code> setState()</code></li>
+* <li><code> setLabel()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XRadioButton
+*/
+public class _XRadioButton extends MultiMethodTest {
+
+ public XRadioButton oObj = null;
+ private boolean state = false ;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestItemListener implements com.sun.star.awt.XItemListener {
+ public boolean disposingCalled = false ;
+ public boolean itemStateChangedCalled = false ;
+ private java.io.PrintWriter log = null ;
+
+ public TestItemListener(java.io.PrintWriter log) {
+ this.log = log ;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ log.println(" disposing was called.") ;
+ }
+
+ public void itemStateChanged(com.sun.star.awt.ItemEvent e) {
+ itemStateChangedCalled = true ;
+ log.println(" itemStateChanged was called.") ;
+ }
+
+ }
+
+ TestItemListener itemListener = null ;
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _addItemListener() {
+
+ itemListener = new TestItemListener(log) ;
+
+ boolean result = true ;
+ oObj.addItemListener(itemListener) ;
+
+ tRes.tested("addItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * !!! Can be checked only interactively !!!
+ */
+ public void _removeItemListener() {
+ requiredMethod("addItemListener()") ;
+
+ boolean result = true ;
+ oObj.removeItemListener(itemListener) ;
+
+ tRes.tested("removeItemListener()", Status.skipped(true)) ;
+ }
+
+ /**
+ * Gets state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getState() {
+
+ boolean result = true ;
+ state = oObj.getState() ;
+
+ tRes.tested("getState()", result) ;
+ }
+
+ /**
+ * Sets a new state and the gets it for checking. <p>
+ * Has <b> OK </b> status if set and get states are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getState </code> </li>
+ * </ul>
+ */
+ public void _setState() {
+ requiredMethod("getState()") ;
+
+ boolean result = true ;
+ oObj.setState(!state) ;
+
+ try {
+ Thread.sleep(200) ;
+ } catch (InterruptedException e) {}
+
+ result = oObj.getState() == !state ;
+
+ tRes.tested("setState()", result) ;
+ }
+
+ /**
+ * Just sets a new label. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _setLabel() {
+
+ boolean result = true ;
+ oObj.setLabel("XRadioButton") ;
+
+ tRes.tested("setLabel()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinField.java b/qadevOOo/tests/java/ifc/awt/_XSpinField.java
new file mode 100644
index 000000000000..6fc70ac639c1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XSpinField.java
@@ -0,0 +1,249 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSpinField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.SpinEvent;
+import com.sun.star.awt.XSpinField;
+import com.sun.star.awt.XSpinListener;
+import com.sun.star.lang.EventObject;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XSpinField</code>
+* interface methods :
+* <ul>
+* <li><code> addSpinListener()</code></li>
+* <li><code> removeSpinListener()</code></li>
+* <li><code> up()</code></li>
+* <li><code> down()</code></li>
+* <li><code> first()</code></li>
+* <li><code> last()</code></li>
+* <li><code> enableRepeat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XSpinField
+*/
+public class _XSpinField extends MultiMethodTest {
+
+ public XSpinField oObj = null;
+
+ /**
+ * Listener implementation which set flags on appropriate
+ * listener methods calls.
+ */
+ protected class TestListener implements XSpinListener {
+ public boolean upFl = false ;
+ public boolean downFl = false ;
+ public boolean firstFl = false ;
+ public boolean lastFl = false ;
+
+ public void up(SpinEvent e) {
+ upFl = true ;
+ }
+ public void down(SpinEvent e) {
+ downFl = true ;
+ }
+ public void first(SpinEvent e) {
+ firstFl = true ;
+ }
+ public void last(SpinEvent e) {
+ lastFl = true ;
+ }
+ public void disposing(EventObject e) {}
+ }
+
+ private TestListener listener = new TestListener() ;
+
+ /**
+ * Just adds a listener. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _addSpinListener() {
+ oObj.addSpinListener(listener) ;
+
+ tRes.tested("addSpinListener()", true) ;
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the appropriate listener method
+ * was called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * </ul>
+ */
+ public void _up() {
+ requiredMethod("addSpinListener()") ;
+
+ oObj.up() ;
+ shortWait();
+
+ tRes.tested("up()", listener.upFl) ;
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the appropriate listener method
+ * was called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * </ul>
+ */
+ public void _down() {
+ requiredMethod("addSpinListener()") ;
+
+ oObj.down() ;
+ shortWait();
+
+ tRes.tested("down()", listener.downFl) ;
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the appropriate listener method
+ * was called.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * </ul>
+ */
+ public void _first() {
+ requiredMethod("addSpinListener()") ;
+
+ oObj.first() ;
+ shortWait();
+
+ tRes.tested("first()", listener.firstFl) ;
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the appropriate listener method
+ * was called.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * </ul>
+ */
+ public void _last() {
+ requiredMethod("addSpinListener()") ;
+
+ oObj.last() ;
+ shortWait();
+
+ tRes.tested("last()", listener.lastFl) ;
+ }
+
+ /**
+ * Removes the listener, then calls <code>up</code> method and
+ * checks if te listener wasn't called. <p>
+ * Has <b>OK</b> status if listener wasn't called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSpinListener </code> </li>
+ * <li> <code> up </code> </li>
+ * <li> <code> down </code> </li>
+ * <li> <code> first </code> </li>
+ * <li> <code> last </code> </li>
+ * </ul>
+ */
+ public void _removeSpinListener() {
+ requiredMethod("addSpinListener()") ;
+ executeMethod("up()") ;
+ executeMethod("down()") ;
+ executeMethod("first()") ;
+ executeMethod("last()") ;
+
+ listener.upFl = false ;
+
+ oObj.removeSpinListener(listener) ;
+
+ oObj.up() ;
+
+ tRes.tested("removeSpinListener()", !listener.upFl) ;
+ }
+
+ /**
+ * Enables then disables repeating. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _enableRepeat() {
+ oObj.enableRepeat(true) ;
+ oObj.enableRepeat(false) ;
+
+ tRes.tested("enableRepeat()", true) ;
+ }
+
+ /**
+ * Waits for 0.5 sec to allow listener to be called.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/awt/_XTabController.java b/qadevOOo/tests/java/ifc/awt/_XTabController.java
new file mode 100644
index 000000000000..814fd8a7451c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTabController.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTabController.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XTabController;
+import com.sun.star.awt.XTabControllerModel;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* This interface is DEPRECATED !!!
+* All test results are SKIPPED.OK now.
+* Testing <code>com.sun.star.awt.XTabController</code>
+* interface methods :
+* <ul>
+* <li><code> activateFirst()</code></li>
+* <li><code> activateLast()</code></li>
+* <li><code> activateTabOrder()</code></li>
+* <li><code> autoTabOrder()</code></li>
+* <li><code> getContainer()</code></li>
+* <li><code> getCotrols()</code></li>
+* <li><code> getModel()</code></li>
+* <li><code> setContainer()</code></li>
+* <li><code> setModel()</code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'MODEL'</code> : <code>XTabControllerModel</code> a model for
+* the object</li>
+* <li> <code>'CONTAINER'</code> : <code>XControlContainer</code> a container
+* for the object</li>
+* <ul> <p>
+* @see com.sun.star.awt.XTabController
+*/
+public class _XTabController extends MultiMethodTest {
+ public XTabController oObj = null;
+
+ /**
+ * Test calls the method with object relation 'MODEL' as a parameter.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _setModel() {
+ oObj.setModel( (XTabControllerModel) tEnv.getObjRelation("MODEL"));
+ tRes.tested("setModel()", Status.skipped(true) );
+ }
+
+ /**
+ * Test calls the method, then checks returned value.<p>
+ * Has <b> OK </b> status if method returns a value that equals to
+ * corresponding object relation.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setModel() </code> : sets model for the object </li>
+ * </ul>
+ */
+ public void _getModel() {
+ requiredMethod("setModel()");
+ XTabControllerModel setModel = oObj.getModel();
+ tRes.tested("getModel()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method with object relation 'CONTAINER' as a parameter.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _setContainer() {
+ oObj.setContainer( (XControlContainer)
+ tEnv.getObjRelation("CONTAINER"));
+ tRes.tested("setContainer()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method, then checks returned value.<p>
+ * Has <b> OK </b> status if method returns a value that equals to
+ * corresponding object relation.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setContainer() </code> : sets container for the object</li>
+ * </ul>
+ */
+ public void _getContainer() {
+ requiredMethod( "setContainer()");
+ XControlContainer setContainer = oObj.getContainer();
+ XControlContainer relContainer = (XControlContainer )
+ tEnv.getObjRelation("CONTAINER");
+ tRes.tested("getContainer()", Status.skipped(true) );
+ }
+
+ /**
+ * Test calls the method, then checks returned sequence.<p>
+ * Has <b> OK </b> status if returned sequence is not null.<p>
+ */
+ public void _getControls() {
+ XControl[] aControl = oObj.getControls();
+ tRes.tested("getControls()", Status.skipped(true) );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _autoTabOrder() {
+ oObj.autoTabOrder();
+ tRes.tested("autoTabOrder()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _activateTabOrder() {
+ oObj.activateTabOrder();
+ tRes.tested("activateTabOrder()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _activateFirst() {
+ oObj.activateFirst();
+ tRes.tested("activateFirst()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _activateLast() {
+ oObj.activateLast();
+ tRes.tested("activateLast()", Status.skipped(true));
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTabControllerModel.java b/qadevOOo/tests/java/ifc/awt/_XTabControllerModel.java
new file mode 100644
index 000000000000..fce82b683ec6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTabControllerModel.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTabControllerModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XTabControllerModel;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.awt.XTabControllerModel</code>
+* interface methods :
+* <ul>
+* <li><code> getGroupControl()</code></li>
+* <li><code> setGroupControl()</code></li>
+* <li><code> setControlModels()</code></li>
+* <li><code> getControlModels()</code></li>
+* <li><code> setGroup()</code></li>
+* <li><code> getGroupCount()</code></li>
+* <li><code> getGroup()</code></li>
+* <li><code> getGroupByName()</code></li>
+* </ul> <p>
+*
+* Since the interface is <b>DEPRECATED</b> all methods have
+* status SKIPPED.OK <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Model1'</code> : <code>XControlModel</code> relation
+* , any control model belonging to the object tested.</li>
+* <li> <code>'Model2'</code> : <code>XControlModel</code> relation
+* , any control model belonging to the object tested.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTabControllerModel
+*/
+public class _XTabControllerModel extends MultiMethodTest {
+
+ public XTabControllerModel oObj = null;
+ private XControlModel[] Modelseq1 = new XControlModel[1];
+ private XControlModel[] Modelseq2 = new XControlModel[1];
+
+ /**
+ * Sets group control to <code>true</code> then calls
+ * <code>getGroupControl()</code> method and checks the value. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>
+ * <p>
+ */
+ public void _getGroupControl() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getGroupControl()", Status.skipped(true));
+ }
+
+ /**
+ * Sets group control to <code>false</code> then calls
+ * <code>getGroupControl()</code> method and checks the value. <p>
+ * Has <b> OK </b> status if the method returns <code>false</code>
+ * <p>
+ */
+ public void _setGroupControl() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("setGroupControl()", Status.skipped(true));
+ }
+
+ /**
+ * Test calls the method and sets control models to a single
+ * model from 'Model1' relation. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _setControlModels() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("setControlModels()", Status.skipped(true));
+ }
+
+ /**
+ * Calls method and checks if models were properly set in
+ * <code>setControlModels</code> method test. <p>
+ * Has <b>OK</b> status if the model sequence set is equal
+ * to the sequence get. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setControlModels </code> : to set sequence of models.</li>
+ * </ul>
+ */
+ public void _getControlModels() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getControlModels()", Status.skipped(true));
+ }
+
+ /**
+ * Sets the group named 'XTabControlModel' to sequence with a single
+ * element from 'Model2' relation. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _setGroup() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("setGroup()", Status.skipped(true));
+ }
+
+ /**
+ * Calls method and checks if the group was properly set in
+ * <code>setGroup</code> method test. <p>
+ * Has <b>OK</b> status if the sequence set is equal
+ * to the sequence get. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGroup </code> : to set the sequence.</li>
+ * </ul>
+ */
+ public void _getGroup() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getGroup()", Status.skipped(true));
+ }
+
+ /**
+ * Retrieves group named 'XTabControllerModel' added in <code>
+ * setGroup</code> method test, and checks it. <p>
+ * Has <b> OK </b> status if sequence get is equal to sequence set.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGroup </code> : to set the sequence.</li>
+ * </ul>
+ */
+ public void _getGroupByName() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getGroupByName()", Status.skipped(true));
+ }
+
+ /**
+ * Gets number of groups.
+ * Has <b> OK </b> status if the number is greater than 0.
+ * <ul>
+ * <li> <code> setGroup </code> : to has at least one group.</li>
+ * </ul>
+ */
+ public void _getGroupCount() {
+ log.println("Always SKIPPED.OK since deprecated.");
+ tRes.tested("getGroupCount()", Status.skipped(true));
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTextComponent.java b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java
new file mode 100644
index 000000000000..62439a020630
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java
@@ -0,0 +1,295 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextComponent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.Selection;
+import com.sun.star.awt.TextEvent;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XTextListener;
+import com.sun.star.lang.EventObject;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.awt.XTextComponent</code>
+* interface methods:
+* <ul>
+* <li><code> addTextListener() </code></li>
+* <li><code> removeTextListener() </code></li>
+* <li><code> setText() </code></li>
+* <li><code> getText() </code></li>
+* <li><code> insertText() </code></li>
+* <li><code> getSelectedText() </code></li>
+* <li><code> setSelection() </code></li>
+* <li><code> getSelection() </code></li>
+* <li><code> setEditable() </code></li>
+* <li><code> isEditable() </code></li>
+* <li><code> setMaxTextLen() </code></li>
+* <li><code> getMaxTextLen() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XTextComponent.onlyNumbers'</code> (of type <code>Object</code>):
+* needed for checking if component can contain only numeric values </li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTextComponent
+*/
+public class _XTextComponent extends MultiMethodTest {
+ public XTextComponent oObj = null;
+ public boolean textChanged = false;
+ // indicates that component can contain only numeric values
+ private boolean num = false ;
+
+ /**
+ * Listener implementation which just set flag when listener
+ * method is called.
+ */
+ protected class MyChangeListener implements XTextListener {
+ public void disposing ( EventObject oEvent ) {}
+ public void textChanged(TextEvent ev) {
+ textChanged = true;
+ }
+ }
+
+ XTextListener listener = new MyChangeListener();
+
+ /**
+ * Retrieves object relation, then sets flag 'num' to 'true'
+ * if relation is not null.
+ */
+ public void before() {
+ if (tEnv.getObjRelation("XTextComponent.onlyNumbers") != null)
+ num = true;
+ }
+
+ /**
+ * After test calls the method, a new text is set to the object. Then
+ * we check if listener was called, and set a new text value
+ * to the object.<p>
+ * Has <b> OK </b> status if listener was called.
+ */
+ public void _addTextListener(){
+ oObj.addTextListener(listener);
+ oObj.setText("Listen");
+ try {
+ Thread.currentThread().sleep(500);
+ } catch(java.lang.InterruptedException e) {
+ e.printStackTrace(log);
+ }
+ if (!textChanged) {
+ log.println("Listener wasn't called after changing Text");
+ }
+
+ tRes.tested("addTextListener()",textChanged);
+ }
+
+ /**
+ * After setting flag 'textChanged' to false, test calls the method.
+ * Then a new text value is set to the object. <p>
+ * Has <b> OK </b> status if listener was not called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li><code> addTextListener() </code>: adds listener to the object.</li>
+ * </ul>
+ */
+ public void _removeTextListener() {
+ requiredMethod("addTextListener()");
+ textChanged = false;
+ oObj.removeTextListener(listener);
+ oObj.setText("Do not listen");
+ tRes.tested("removeTextListener()",!textChanged);
+ }
+
+ /**
+ * At first we're setting some string variable 'newText' depending of a kind
+ * of object we are working with. Then test calls the method. <p>
+ * Has <b> OK </b> status if set value is equal to a value obtained after.
+ */
+ public void _setText() {
+ String newText = num ? "823" : "setText" ;
+ if (tEnv.getTestCase().getObjectName().equals("OTimeControl")) {
+ newText = "8:15";
+ }
+ log.println("Setting text to : '" + newText + "'") ;
+ oObj.setText(newText);
+ log.println("Getting text : '" + oObj.getText() + "'") ;
+ tRes.tested("setText()",oObj.getText().equals(newText));
+ }
+
+ /**
+ * At first we're setting some string variable 'newText' depending of a kind
+ * of object we are working with. Then we set text to the object and call
+ * the method. <p>
+ * Has <b> OK </b> status if set value is equal to a value obtained using
+ * getText() method.
+ */
+ public void _getText() {
+ String newText = num ? "823" : "setText" ;
+ if (tEnv.getTestCase().getObjectName().equals("OTimeControl")) {
+ newText = "8:15";
+ }
+ oObj.setText(newText);
+ tRes.tested("getText()",oObj.getText().equals(newText));
+ }
+
+ /**
+ * At first we're setting string variables 'text' and 'itext' depending
+ * of a kind of object we are working with. Next, value from 'text' variable
+ * is set to an object using setText(), then the method insertText() is called.
+ * <p>
+ * Has <b> OK </b> status if text is inserted to the object.
+ */
+ public void _insertText() {
+ String text = num ? "753" : "iText" ;
+ String itext = num ? "6" : "insert" ;
+ log.println("Setting text to : '" + text + "'") ;
+ oObj.setText(text);
+ log.println("Iserting text to (0,1) : '" + itext + "'") ;
+ oObj.insertText(new Selection(0,1), itext);
+ log.println("getText() returns: " + oObj.getText());
+ tRes.tested("insertText()", oObj.getText().equals
+ (num ? "653" : "insertText"));
+ }
+
+ /**
+ * After text is set to the object, test calls the method.<p>
+ * Has <b> OK </b> status if selected text is equal to first three symbols
+ * of text added before.
+ */
+ public void _getSelectedText() {
+ oObj.setText("getSelectedText");
+ oObj.setSelection(new Selection(0,3));
+ tRes.tested("getSelectedText()",oObj.getSelectedText().equals("get"));
+ }
+
+ /**
+ * After setting new text to an object, and defining selection variable,
+ * test calls the method. <p>
+ * Has <b> OK </b> status if selection set before is equal to a selection we
+ * got using getSelection().
+ */
+ public void _setSelection() {
+ oObj.setText("setSelection");
+ Selection sel = new Selection(0,3);
+ oObj.setSelection(sel);
+ tRes.tested("setSelection()", ValueComparer.equalValue
+ (oObj.getSelection(), sel));
+ }
+
+ /**
+ * After setting new text to an object, and defining selection variable,
+ * test calls the method. <p>
+ * Has <b> OK </b> status if selection set before is equal to a selection we
+ * got using getSelection().
+ */
+ public void _getSelection() {
+ oObj.setText("getSelection");
+ Selection sel = new Selection(2,3);
+ oObj.setSelection(sel);
+ tRes.tested("getSelection()", ValueComparer.equalValue
+ (oObj.getSelection(), sel));
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if method has changed a property 'Editable'.
+ */
+ public void _setEditable(){
+ oObj.setEditable(true);
+ tRes.tested("setEditable()", oObj.isEditable());
+ }
+
+ /**
+ * First we set 'Editable' variable to false. Then test calls the method.<p>
+ * Has <b> OK </b> status if method returns value we set before.
+ */
+ public void _isEditable(){
+ oObj.setEditable(false);
+ tRes.tested("isEditable()", ! oObj.isEditable());
+ }
+
+ /**
+ * Test calls the method. Then new text value is set to the object. <p>
+ * Has <b> OK </b> status if text, returned by getText() is a string of
+ * length we set before.
+ */
+ public void _setMaxTextLen() {
+ oObj.setMaxTextLen((short)10);
+ //oObj.setText("0123456789ABCDE");
+ //String get = oObj.getText();
+ //tRes.tested("setMaxTextLen()",get.length() == 10);
+ tRes.tested("setMaxTextLen()",oObj.getMaxTextLen()==10);
+ }
+
+ /**
+ * At first we set MaxTextLen, then test calls the method. <p>
+ * Has <b> OK </b> status if method returns a value we set before.
+ */
+ public void _getMaxTextLen() {
+ oObj.setMaxTextLen((short)15);
+ log.println("getMaxTextLen() returns: "+oObj.getMaxTextLen());
+ tRes.tested("getMaxTextLen()",oObj.getMaxTextLen()==15);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTextLayoutConstrains.java b/qadevOOo/tests/java/ifc/awt/_XTextLayoutConstrains.java
new file mode 100644
index 000000000000..9df7e2099fcf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTextLayoutConstrains.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextLayoutConstrains.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XTextLayoutConstrains;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XTextLayoutConstrains</code>
+* interface methods:
+* <ul>
+* <li><code> getMinimumSize() </code></li>
+* <li><code> getColumnsAndLines() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTextLayoutConstrains
+*/
+public class _XTextLayoutConstrains extends MultiMethodTest {
+ public XTextLayoutConstrains oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if both returned size fields are not equal to zero.
+ */
+ public void _getMinimumSize() {
+ short nCols = 0;
+ short nLines = 0;
+ Size mSize = oObj.getMinimumSize(nCols,nLines);
+ boolean res = ( (mSize.Height != 0) && (mSize.Width != 0) );
+ if (res == false) {
+ log.println("mSize.height: " + mSize.Height);
+ log.println("mSize.width: " + mSize.Width);
+ }
+ tRes.tested("getMinimumSize()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if both returned values are not equal to zero.
+ */
+ public void _getColumnsAndLines() {
+ short[] nCols = new short[1];
+ short[] nLines = new short[1];
+ oObj.getColumnsAndLines(nCols,nLines);
+ boolean res = ( (nCols[0] != 0) && (nLines[0] != 0) );
+ if (res == false) {
+ log.println("nCols: " + nCols[0]);
+ log.println("nLines: " + nLines[0]);
+ }
+ tRes.tested("getColumnsAndLines()",res);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTextListener.java b/qadevOOo/tests/java/ifc/awt/_XTextListener.java
new file mode 100644
index 000000000000..804fd29698b0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTextListener.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextListener.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.TextEvent;
+import com.sun.star.awt.XTextListener;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.awt.XTextListener</code>
+* interface methods:
+* <ul>
+* <li><code> textChanged() </code></li>
+* </ul><p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'TestTextListener'</code>
+* (of type <code>ifc.awt._XTextListener.TestTextListener</code>):
+* this listener implementation must be registered for object tested for
+* checking
+* <code>textChanged()</code> method call. The listener must be registered
+* in object environment creation because it's not a fact that tested
+* component supports <code>XTextComponent</code> interface and the listener
+* can be registered in another object.</li>
+* <ul> <p>
+*
+* @see com.sun.star.awt.XTextListener
+*/
+public class _XTextListener extends MultiMethodTest {
+ public XTextListener oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ * and stores event passed.
+ */
+ public static class TestTextListener implements
+ com.sun.star.awt.XTextListener {
+ public boolean textChangedCalled = false ;
+ public TextEvent event = null ;
+
+ public void textChanged(TextEvent e) {
+ textChangedCalled = true ;
+ event = e ;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject e) {}
+
+ }
+
+ TestTextListener textListener = null;
+ /**
+ * Retrieves object relation.
+ * @throws StatusException If the relation not found.
+ */
+ public void before() {
+ textListener = (TestTextListener)
+ tEnv.getObjRelation("TestTextListener");
+ if (textListener == null) {
+ throw new StatusException(Status.failed("Relation not found"));
+ }
+ }
+
+ /**
+ * First a <code>TextEvent</code> object created and
+ * it is passed to <code>textChanged</code> method
+ * call. Then a short wait follows for listener already
+ * registered at the object to be called. <p>
+ * Has <b> OK </b> status if the listener was called with
+ * the same <code>TextEvent</code> object as was created
+ * before.
+ */
+ public void _textChanged() {
+
+ boolean result = true ;
+
+ TextEvent event = new TextEvent() ;
+ event.dummy1 = 2;
+ oObj.textChanged(event);
+
+ try {
+ Thread.sleep(200) ;
+ } catch (InterruptedException e) {}
+
+ result = textListener.textChangedCalled &&
+ textListener.event.dummy1 == 2;
+
+ tRes.tested("textChanged()", result) ;
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTimeField.java b/qadevOOo/tests/java/ifc/awt/_XTimeField.java
new file mode 100644
index 000000000000..a9510be54a05
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTimeField.java
@@ -0,0 +1,324 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTimeField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+
+import com.sun.star.awt.XTimeField;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XTimeField</code>
+* interface methods :
+* <ul>
+* <li><code> setTime()</code></li>
+* <li><code> getTime()</code></li>
+* <li><code> setMin()</code></li>
+* <li><code> getMin()</code></li>
+* <li><code> setMax()</code></li>
+* <li><code> getMax()</code></li>
+* <li><code> setFirst()</code></li>
+* <li><code> getFirst()</code></li>
+* <li><code> setLast()</code></li>
+* <li><code> getLast()</code></li>
+* <li><code> setEmpty()</code></li>
+* <li><code> isEmpty()</code></li>
+* <li><code> setStrictFormat()</code></li>
+* <li><code> isStrictFormat()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTimeField
+*/
+public class _XTimeField extends MultiMethodTest {
+
+ public XTimeField oObj = null;
+ private boolean strict = false ;
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getTime </code> </li>
+ * </ul>
+ */
+ public void _setTime() {
+ requiredMethod("getTime()") ;
+
+ boolean result = true ;
+ oObj.setTime(5087) ;
+
+ result = oObj.getTime() == 5087 ;
+
+ tRes.tested("setTime()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getTime() {
+
+ boolean result = true ;
+ oObj.getTime() ;
+
+ tRes.tested("getTime()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMin </code> </li>
+ * </ul>
+ */
+ public void _setMin() {
+
+ boolean result = true ;
+ oObj.setMin(4978) ;
+
+ result = oObj.getMin() == 4978 ;
+
+ tRes.tested("setMin()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getMin() {
+
+ boolean result = true ;
+ oObj.getMin() ;
+
+ tRes.tested("getMin()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMax </code> </li>
+ * </ul>
+ */
+ public void _setMax() {
+
+ boolean result = true ;
+ oObj.setMax(27856) ;
+
+ result = oObj.getMax() == 27856 ;
+
+ tRes.tested("setMax()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getMax() {
+
+ boolean result = true ;
+ oObj.getMax() ;
+
+ tRes.tested("getMax()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFirst </code> </li>
+ * </ul>
+ */
+ public void _setFirst() {
+
+ boolean result = true ;
+ oObj.setFirst(5118) ;
+
+ result = oObj.getFirst() == 5118 ;
+
+ if (!result) {
+ log.println("Set to " + 5118 + " but returned " + oObj.getFirst()) ;
+ }
+
+ tRes.tested("setFirst()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getFirst() {
+
+ boolean result = true ;
+ int val = oObj.getFirst() ;
+
+ log.println("getFirst() = " + val) ;
+
+ tRes.tested("getFirst()", result) ;
+ }
+
+ /**
+ * Sets a new value and checks if it was correctly set. <p>
+ * Has <b> OK </b> status if set and get values are equal.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLast </code> </li>
+ * </ul>
+ */
+ public void _setLast() {
+
+ boolean result = true ;
+ oObj.setLast(23450) ;
+
+ result = oObj.getLast() == 23450 ;
+
+ if (!result) {
+ log.println("Set to " + 23450 + " but returned " + oObj.getLast()) ;
+ }
+
+ tRes.tested("setLast()", result) ;
+ }
+
+ /**
+ * Gets the current value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _getLast() {
+
+ boolean result = true ;
+ int val = oObj.getLast() ;
+
+ log.println("getLast() = " + val) ;
+
+ tRes.tested("getLast()", result) ;
+ }
+
+ /**
+ * Sets the value to empty. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTime </code> : value must be not empty </li>
+ * </ul>
+ */
+ public void _setEmpty() {
+ requiredMethod("setTime()") ;
+
+ boolean result = true ;
+ oObj.setEmpty() ;
+
+ tRes.tested("setEmpty()", result) ;
+ }
+
+ /**
+ * Checks if the field is empty. <p>
+ * Has <b> OK </b> status if the value is empty.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setEmpty() </code> </li>
+ * </ul>
+ */
+ public void _isEmpty() {
+ requiredMethod("setEmpty()") ;
+
+ boolean result = true ;
+ result = oObj.isEmpty() ;
+
+ tRes.tested("isEmpty()", result) ;
+ }
+
+ /**
+ * Checks strict state. <p>
+ * Has <b> OK </b> status if strict format is set.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isStrictFormat </code> </li>
+ * </ul>
+ */
+ public void _setStrictFormat() {
+ requiredMethod("isStrictFormat()") ;
+
+ boolean result = true ;
+ oObj.setStrictFormat(!strict) ;
+
+ result = oObj.isStrictFormat() == !strict ;
+
+ tRes.tested("setStrictFormat()", result) ;
+ }
+
+ /**
+ * Gets strict state and stores it. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _isStrictFormat() {
+
+ boolean result = true ;
+ strict = oObj.isStrictFormat() ;
+
+ tRes.tested("isStrictFormat()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XToolkit.java b/qadevOOo/tests/java/ifc/awt/_XToolkit.java
new file mode 100644
index 000000000000..47c2928f7323
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XToolkit.java
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XToolkit.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.WindowDescriptor;
+import com.sun.star.awt.XDevice;
+import com.sun.star.awt.XRegion;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.XWindowPeer;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XToolkit</code>
+* interface methods:
+* <ul>
+* <li><code> getDesktopWindow() </code></li>
+* <li><code> getWorkArea() </code></li>
+* <li><code> createWindow() </code></li>
+* <li><code> createWindows() </code></li>
+* <li><code> createScreenCompatibleDevice() </code></li>
+* <li><code> createRegion() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XToolkit
+*/
+public class _XToolkit extends MultiMethodTest {
+ public XToolkit oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status always, because Desktop component
+ * currently is not supported as visible.
+ */
+ public void _getDesktopWindow() {
+ XWindowPeer win = oObj.getDesktopWindow();
+ if (win == null) {
+ log.println("getDesktopWindow() returns NULL");
+ }
+ tRes.tested("getDesktopWindow()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getWorkArea() {
+ Rectangle area = oObj.getWorkArea();
+ tRes.tested("getWorkArea()", area != null);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _createWindow() {
+ boolean res = false;
+ try {
+ XWindowPeer cWin = oObj.createWindow(
+ createDesc(new Rectangle(0,0,100,100)));
+ if (cWin == null) {
+ log.println("createWindow() create a NULL Object");
+ } else {
+ res = true;
+ }
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured while checking 'createWindow':");
+ ex.printStackTrace(log);
+ }
+ tRes.tested("createWindow()", res);
+ }
+
+ /**
+ * After defining of WindowDescriptor array, test calls the method. <p>
+ * Has <b> OK </b> status if all elements of the returned array are
+ * not null.
+ */
+ public void _createWindows() {
+ boolean res = false;
+ try {
+ WindowDescriptor[] descs = new WindowDescriptor[2];
+ descs[0] = createDesc(new Rectangle(0,0,100,100));
+ descs[1] = createDesc(new Rectangle(100,100,200,200));
+ XWindowPeer[] cWins = oObj.createWindows(descs);
+ if ( (cWins[0] == null) || (cWins[1] == null) ) {
+ log.println("createWindows() creates NULL Windows");
+ } else {
+ res = true;
+ }
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured while checking 'createWindows':");
+ ex.printStackTrace(log);
+ }
+ tRes.tested("createWindows()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _createScreenCompatibleDevice() {
+ XDevice dev = oObj.createScreenCompatibleDevice(100, 100);
+ tRes.tested("createScreenCompatibleDevice()", dev != null);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _createRegion() {
+ XRegion reg = oObj.createRegion();
+ tRes.tested("createRegion()", reg != null);
+ }
+
+ /**
+ * Just creates the WindowDescriptor as an argument for createWindow().
+ */
+ public WindowDescriptor createDesc(Rectangle rect) {
+ XWindowPeer win = (XWindowPeer) tEnv.getObjRelation("WINPEER");
+ return new WindowDescriptor(com.sun.star.awt.WindowClass.TOP,
+ "", win, (short) -1, rect, com.sun.star.awt.WindowAttribute.SHOW);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XTopWindow.java b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java
new file mode 100644
index 000000000000..0f7f83fa2c41
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTopWindow.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.XMenuBar;
+import com.sun.star.awt.XTopWindow;
+import com.sun.star.awt.XTopWindowListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XTopWindow</code>
+* interface methods :
+* <ul>
+* <li><code> addTopWindowListener()</code></li>
+* <li><code> removeTopWindowListener()</code></li>
+* <li><code> toFront()</code></li>
+* <li><code> toBack()</code></li>
+* <li><code> setMenuBar()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XTopWindow
+*/
+public class _XTopWindow extends MultiMethodTest {
+
+ public XTopWindow oObj = null;
+
+ /**
+ * Listener implementation which sets flags on different
+ * method calls.
+ */
+ protected class TestListener implements XTopWindowListener {
+ private PrintWriter log = null ;
+ public boolean activated = false ;
+ public boolean deactivated = false ;
+
+ public TestListener(PrintWriter log) {
+ this.log = log ;
+ }
+
+ public void initListener() {
+ activated = false;
+ deactivated = false;
+ }
+
+ public void windowOpened(EventObject e) {
+ log.println("windowOpened() called") ;
+ }
+ public void windowClosing(EventObject e) {
+ log.println("windowClosing() called") ;
+ }
+ public void windowClosed(EventObject e) {
+ log.println("windowClosed() called") ;
+ }
+ public void windowMinimized(EventObject e) {
+ log.println("windowMinimized() called") ;
+ }
+ public void windowNormalized(EventObject e) {
+ log.println("windowNormalized() called") ;
+ }
+ public void windowActivated(EventObject e) {
+ activated = true;
+ log.println("windowActivated() called") ;
+ }
+ public void windowDeactivated(EventObject e) {
+ deactivated = true;
+ log.println("windowDeactivated() called") ;
+ }
+ public void disposing(EventObject e) {}
+ }
+
+ protected TestListener listener = null ;
+
+ XTextDocument aTextDoc = null;
+
+
+ protected void before() {
+ aTextDoc = util.WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Adds a listener . <p>
+ *
+ * Has <b>OK</b> status always (listener calls are checked in
+ * other methods. <p>
+ */
+ public void _addTopWindowListener() {
+ listener = new TestListener(log) ;
+
+ oObj.addTopWindowListener(listener) ;
+
+ tRes.tested("addTopWindowListener()", true);
+ }
+
+ /**
+ * Removes a listener added before. <p>
+ * Has <b>OK</b> status always. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> toBack </code> : to have a definite method execution
+ * order.</li>
+ * </ul>
+ */
+ public void _removeTopWindowListener() {
+ executeMethod("toBack()");
+
+ oObj.removeTopWindowListener(listener);
+
+ tRes.tested("removeTopWindowListener()", true);
+ }
+
+ /**
+ * Moves the window to front and check the listener calls. <p>
+ * Has <b>OK</b> status if listener <code>activated</code> method
+ * was called.
+ */
+ public void _toFront() {
+ requiredMethod("addTopWindowListener()");
+ listener.initListener();
+ oObj.toFront();
+ shortWait();
+
+ tRes.tested("toFront()", listener.activated && !listener.deactivated);
+ }
+
+ /**
+ * This method doesn't do anything the Office implementation. <p>
+ * So it has always <b>OK</b> status
+ */
+ public void _toBack() {
+ oObj.toBack();
+ tRes.tested("toBack()", true);
+ }
+
+ /**
+ * Creates a simple menu bar and adds to the window. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _setMenuBar() {
+ XMenuBar menu = null ;
+ boolean result = true ;
+
+ try {
+ menu = (XMenuBar) UnoRuntime.queryInterface(XMenuBar.class,
+ tParam.getMSF().createInstance("com.sun.star.awt.MenuBar")) ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't instanciate MenuBar service") ;
+ result = false ;
+ }
+
+ menu.insertItem((short)1, "MenuItem",
+ com.sun.star.awt.MenuItemStyle.CHECKABLE, (short)1) ;
+
+ oObj.setMenuBar(menu) ;
+
+ tRes.tested("setMenuBar()", true) ;
+ }
+
+ /**
+ * Disposes the document created in <code>before</code> method.
+ */
+ protected void after() {
+ aTextDoc.dispose();
+ }
+
+ private void shortWait() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XView.java b/qadevOOo/tests/java/ifc/awt/_XView.java
new file mode 100644
index 000000000000..eb703566bd8b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XView.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XGraphics;
+import com.sun.star.awt.XView;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.awt.XView</code>
+* interface methods:
+* <ul>
+* <li><code> setGraphics() </code></li>
+* <li><code> getGraphics() </code></li>
+* <li><code> getSize() </code></li>
+* <li><code> draw() </code></li>
+* <li><code> setZoom() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'GRAPHICS'</code> (of type <code>XGraphics</code>):
+* used as a parameter to setGraphics() </li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XView
+*/
+public class _XView extends MultiMethodTest {
+ public XView oObj = null;
+
+ /**
+ * After obtaining object relation 'GRAPHICS', test calls the method. <p>
+ * Has <b> OK </b> status if the method returns true.
+ */
+ public void _setGraphics() {
+ XGraphics graph = (XGraphics) tEnv.getObjRelation("GRAPHICS");
+ boolean isSet = oObj.setGraphics(graph);
+ if ( !isSet ) {
+ log.println("setGraphics() returns false");
+ }
+ tRes.tested("setGraphics()", isSet);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGraphics() </code> : sets the output device </li>
+ * </ul>
+ */
+ public void _getGraphics() {
+ requiredMethod("setGraphics()");
+ XGraphics graph = oObj.getGraphics();
+ if (graph == null) {
+ log.println("getGraphics() returns NULL");
+ }
+ tRes.tested("getGraphics()", graph != null);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns structure with fields that
+ * are not equal to zero. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGraphics() </code> : sets the output device </li>
+ * </ul>
+ */
+ public void _getSize() {
+ requiredMethod("setGraphics()");
+ Size aSize = oObj.getSize();
+ boolean res = (aSize.Height != 0) && (aSize.Width != 0);
+ if ( !res ) {
+ log.println("Height: " + aSize.Height);
+ log.println("Width: " + aSize.Width);
+ }
+ tRes.tested("getSize()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGraphics() </code> : sets the output device </li>
+ * </ul>
+ */
+ public void _draw() {
+ requiredMethod("setGraphics()");
+ oObj.draw(20, 20);
+ tRes.tested("draw()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setGraphics() </code> : sets the output device </li>
+ * </ul>
+ */
+ public void _setZoom() {
+ requiredMethod("setGraphics()");
+ oObj.setZoom(2,2);
+ tRes.tested("setZoom()", true);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/awt/_XWindow.java b/qadevOOo/tests/java/ifc/awt/_XWindow.java
new file mode 100644
index 000000000000..71d3114a1647
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/awt/_XWindow.java
@@ -0,0 +1,644 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XWindow.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.awt;
+
+import com.sun.star.awt.FocusEvent;
+import com.sun.star.awt.KeyEvent;
+import com.sun.star.awt.MouseEvent;
+import com.sun.star.awt.PaintEvent;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.PosSize;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.WindowEvent;
+import com.sun.star.awt.XFocusListener;
+import com.sun.star.awt.XKeyListener;
+import com.sun.star.awt.XMouseListener;
+import com.sun.star.awt.XMouseMotionListener;
+import com.sun.star.awt.XPaintListener;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowListener;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.lang.EventObject;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.awt.XWindow</code>
+* interface methods :
+* <ul>
+* <li><code> setPosSize()</code></li>
+* <li><code> getPosSize()</code></li>
+* <li><code> setVisible()</code></li>
+* <li><code> setEnable()</code></li>
+* <li><code> setFocus()</code></li>
+* <li><code> addWindowListener()</code></li>
+* <li><code> removeWindowListener()</code></li>
+* <li><code> addFocusListener()</code></li>
+* <li><code> removeFocusListener()</code></li>
+* <li><code> addKeyListener()</code></li>
+* <li><code> removeKeyListener()</code></li>
+* <li><code> addMouseListener()</code></li>
+* <li><code> removeMouseListener()</code></li>
+* <li><code> addMouseMotionListener()</code></li>
+* <li><code> removeMouseMotionListener()</code></li>
+* <li><code> addPaintListener()</code></li>
+* <li><code> removePaintListener()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XWindow.AnotherWindow'</code> (of type <code>XWindow</code>):
+* Some another window which can gain focus so the tested one
+* must lost it. </li>
+* <li> <code>'XWindow.ControlShape'</code> <b>optional</b>
+* (of type <code>XControlShape</code>):
+* Some shapes cann't change their size within fixed ControlShape
+* and their size could be changed only if size of container
+* ControlShape is changed. For such shapes this relation should
+* be passed for proper <code>addWindowListener</code> test. </li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.awt.XWindow
+*/
+public class _XWindow extends MultiMethodTest {
+ public XWindow oObj = null;
+ private Rectangle posSize = null ;
+ private XWindow win = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getPosSize() {
+ posSize = oObj.getPosSize() ;
+ tRes.tested("getPosSize()", posSize != null) ;
+ }
+
+ /**
+ * After defining Rectangle structure to be set, test calls the method. <p>
+ * Has <b> OK </b> status if structure obtained using getPosSize() is
+ * equal to structure previously set using setPosSize(). <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getPosSize() </code> : returns the outer bounds of
+ * the window </li>
+ * </ul>
+ */
+ public void _setPosSize() {
+ Rectangle newRec = new Rectangle();
+
+ requiredMethod("getPosSize()");
+ newRec.X = posSize.X + 1;
+ newRec.Y = posSize.Y + 1;
+ newRec.Width = posSize.Width - 3;
+ newRec.Height = posSize.Height - 3;
+ oObj.setPosSize(newRec.X, newRec.Y, newRec.Width, newRec.Height,
+ PosSize.POSSIZE);
+ Rectangle gPS = oObj.getPosSize();
+ log.println("Was : (" + posSize.X + ", " + posSize.Y + ", " +
+ posSize.Width + ", " + posSize.Height + "), ");
+ log.println("Get : (" + gPS.X + ", " + gPS.Y + ", " +
+ gPS.Width + ", " + gPS.Height + "). ");
+ tRes.tested("setPosSize()", ValueComparer.equalValue(newRec, gPS) );
+ }
+
+ /**
+ * At first object relation 'XWindow.AnotherWindow' is obtained.
+ * Then test calls the methods of two 'XWindow' objects several times to be
+ * sure that the focus has changed. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setFocus() {
+ win = (XWindow) tEnv.getObjRelation("XWindow.AnotherWindow");
+ oObj.setFocus();
+ win.setFocus();
+ oObj.setFocus();
+ tRes.tested("setFocus()", true);
+ }
+
+ /**
+ * Test calls the method twice with two parameters: 'true' and 'false'. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setVisible() {
+ oObj.setVisible(false);
+ oObj.setVisible(true);
+ tRes.tested("setVisible()", true);
+ }
+
+ /**
+ * Test calls the method twice with two parameters: 'true' and 'false'. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setEnable() {
+ oObj.setEnable(false);
+ oObj.setEnable(true);
+ tRes.tested("setEnable()", true);
+ }
+
+
+ /**
+ * A class we use to test addWindowListener() and
+ * removeWindowListener()
+ */
+ public class TestWindowListener implements XWindowListener {
+ public boolean resized = false ;
+ public boolean moved = false ;
+ public boolean hidden = false ;
+ public boolean shown = false ;
+
+ public void init() {
+ resized = false ;
+ moved = false ;
+ hidden = false ;
+ shown = false ;
+ }
+
+ public void windowResized(WindowEvent e) {
+ resized = true ;
+ }
+ public void windowMoved(WindowEvent e) {
+ moved = true ;
+ }
+ public void windowHidden(EventObject e) {
+ hidden = true ;
+ }
+ public void windowShown(EventObject e) {
+ shown = true ;
+ }
+ public void disposing(EventObject e) {}
+
+ }
+
+ private TestWindowListener wListener = new TestWindowListener() ;
+
+
+ /**
+ * Test calls the method. Then we check if listener's methods were called
+ * when we move, resize, hide and show the window. The resizing is
+ * performed depending on 'XWindow.ControlShape' existance. If this
+ * relation exists then the size and position of container control
+ * shape is changed, else the position and size of window itself is
+ * chaged<p>
+ *
+ * Has <b> OK </b> status if methods of wListener were called when
+ * corresponding events occured. <p>
+ *
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> setPosSize() </code>: sets the outer bounds of the
+ * window</li>
+ * <li> <code> setVisible() </code>: shows or hides the window
+ * depending on the parameter</li>
+ * </ul>
+ */
+ public void _addWindowListener() {
+ executeMethod("setPosSize()");
+ executeMethod("setVisible()");
+ boolean result = true ;
+
+ oObj.addWindowListener(wListener);
+
+ // testing wListener.windowMoved()
+ XControlShape ctrlShape = (XControlShape)
+ tEnv.getObjRelation("XWindow.ControlShape");
+
+ if (ctrlShape != null) {
+ try {
+ Size sz = ctrlShape.getSize();
+ sz.Height += 100;
+ ctrlShape.setSize(sz);
+ Point pos = ctrlShape.getPosition();
+ pos.X += 100 ;
+ ctrlShape.setPosition(pos);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't change size or position: ");
+ e.printStackTrace(log);
+ }
+ } else {
+ oObj.setPosSize(posSize.X + 2, 0, 0, 0, PosSize.X);
+ oObj.setPosSize(0, 0, 100, 100, PosSize.WIDTH);
+ }
+
+ shortWait();
+ boolean res = wListener.resized && wListener.moved &&
+ !wListener.hidden && !wListener.shown;
+ result &= res;
+ if (!res) {
+ log.println("windowMoved() or windowResized() wasn't called");
+ } else {
+ log.println("windowMoved() and windowResized() was called");
+ }
+
+ // testing wListener.windowHidden()
+ wListener.init();
+ shortWait();
+ oObj.setVisible(false);
+ shortWait();
+ res = wListener.hidden;
+ //!wListener.resized && !wListener.moved &&
+ // wListener.hidden && !wListener.shown;
+ result &= res;
+ if (!res) {
+ log.println("windowHidden() wasn't called");
+ } else {
+ log.println("windowHidden() was called");
+ }
+
+ // testing wListener.windowShown()
+ wListener.init() ;
+ oObj.setVisible(true) ;
+ shortWait();
+ res = !wListener.resized && !wListener.moved &&
+ !wListener.hidden && wListener.shown;
+ result &= res;
+ if (!res) {
+ log.println("windowShown() wasn't called");
+ } else {
+ log.println("windowShown() was called");
+ }
+
+ tRes.tested("addWindowListener()", result) ;
+ }
+
+
+ /**
+ * Test calls the method. Then we change window and check that listener's
+ * methods were not called. <p>
+ * Has <b> OK </b> status if listener does not react on window events.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addWindowListener() </code>: adds window listener to the
+ * object </li>
+ * </ul>
+ */
+ public void _removeWindowListener() {
+ requiredMethod("addWindowListener()");
+ oObj.removeWindowListener(wListener);
+ wListener.init();
+ oObj.setPosSize(posSize.X, posSize.Y,
+ posSize.Width , posSize.Height, PosSize.POSSIZE);
+ oObj.setVisible(false);
+ oObj.setVisible(true);
+ boolean res = !(wListener.resized || wListener.moved
+ || wListener.hidden || wListener.shown);
+
+ tRes.tested("removeWindowListener()", res);
+ }
+
+ /**
+ * A class we use to test addFocusListener() and
+ * removeFocusListener()
+ */
+ public class TestFocusListener implements XFocusListener {
+ public boolean gained = false ;
+ public boolean lost = false ;
+
+ public void focusGained(FocusEvent e) {
+ gained = true ;
+ }
+ public void focusLost(FocusEvent e) {
+ lost = true ;
+ }
+ public void init() {
+ gained = false;
+ lost = false;
+ }
+ public void disposing(EventObject e) {}
+
+ }
+
+ private TestFocusListener fListener = new TestFocusListener();
+
+ /**
+ * Test calls the method. Then we change focus and check that listener's
+ * methods were called. <p>
+ * Has <b> OK </b> status if methods of fListener were called when
+ * corresponding events occured. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setFocus() </code>: sets the focus to the window </li>
+ * </ul>
+ */
+ public void _addFocusListener() {
+ boolean result = true ;
+
+ requiredMethod("setFocus()");
+ oObj.addFocusListener(fListener) ;
+
+ // testing fListener.lost()
+ oObj.setFocus();
+ shortWait();
+ win.setFocus();
+ shortWait();
+ result &= fListener.lost;
+ if (!fListener.lost) {
+ log.println("Lost focus was not notified about") ;
+ }
+
+ // testing fListener.gained()
+ oObj.setFocus() ;
+ shortWait();
+ result &= fListener.gained;
+ if (!fListener.gained) {
+ log.println("Gained focus was not notified about") ;
+ }
+
+ tRes.tested("addFocusListener()", result) ;
+ }
+
+ /**
+ * Test calls the method. Then we change focus and check that listener's
+ * methods were not called. <p>
+ * Has <b> OK </b> status if listener does not react on focus changing. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addFocusListener() </code> : adds focus listener to
+ * the object </li>
+ * </ul>
+ */
+ public void _removeFocusListener() {
+ requiredMethod("addFocusListener()");
+ oObj.removeFocusListener(fListener);
+ fListener.init();
+ oObj.setFocus();
+ win.setFocus();
+ oObj.setFocus();
+ boolean res = !(fListener.gained || fListener.lost);
+ tRes.tested("removeFocusListener()", res);
+ }
+
+ /**
+ * A class we use to test addKeyListener() and
+ * removeKeyListener()
+ */
+ public class TestKeyListener implements XKeyListener {
+ public boolean pressed = false;
+ public boolean released = false;
+ public void keyPressed(KeyEvent e) { pressed = true; }
+ public void keyReleased(KeyEvent e) { released = true; }
+ public void disposing(EventObject e) {}
+ public void init() { pressed = false; released = false; }
+ }
+
+ private TestKeyListener kListener = new TestKeyListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _addKeyListener() {
+ oObj.addKeyListener(kListener);
+ tRes.tested("addKeyListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addKeyListener() </code> : adds key listener to
+ * the object </li>
+ * </ul>
+ */
+ public void _removeKeyListener() {
+ requiredMethod("addKeyListener()");
+ oObj.removeKeyListener(kListener);
+ tRes.tested("removeKeyListener()", true);
+ }
+
+ /**
+ * A class we use to test addMouseListener() and
+ * removeMouseListener()
+ */
+ public class TestMouseListener implements XMouseListener {
+ public boolean pressed = false;
+ public boolean released = false;
+ public boolean entered = false;
+ public boolean exited = false;
+
+ public void mousePressed(MouseEvent e) {
+ pressed = true;
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ released = true;
+ }
+
+ public void mouseEntered(MouseEvent e) {
+ entered = true;
+ }
+
+ public void mouseExited(MouseEvent e) {
+ exited = true;
+ }
+
+ public void disposing(EventObject e) {}
+
+ public void init() {
+ pressed = false;
+ released = false;
+ exited = false;
+ entered = false;
+ }
+
+ }
+
+ private TestMouseListener mListener = new TestMouseListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _addMouseListener() {
+ oObj.addMouseListener(mListener);
+ tRes.tested("addMouseListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addMouseListener() </code> : adds mouse listener to
+ * the object</li>
+ * </ul>
+ */
+ public void _removeMouseListener() {
+ requiredMethod("addMouseListener()");
+ oObj.removeMouseListener(mListener);
+ tRes.tested("removeMouseListener()", true);
+ }
+
+ /**
+ * A class we use to test addMouseMotionListener() and
+ * removeMouseMotionListener()
+ */
+ public class TestMouseMotionListener implements XMouseMotionListener {
+ public boolean dragged = false;
+ public boolean moved = false;
+
+ public void mouseDragged(MouseEvent e) {
+ dragged = true;
+ }
+
+ public void mouseMoved(MouseEvent e) {
+ moved = true;
+ }
+
+ public void disposing(EventObject e) {}
+
+ public void init() {
+ dragged = false;
+ moved = false;
+ }
+
+ }
+
+ private TestMouseMotionListener mmListener = new TestMouseMotionListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _addMouseMotionListener() {
+ oObj.addMouseMotionListener(mmListener);
+ tRes.tested("addMouseMotionListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addMouseMotionListener() </code> : adds mouse motion
+ * listener to the object</li>
+ * </ul>
+ */
+ public void _removeMouseMotionListener() {
+ requiredMethod("addMouseMotionListener()");
+ oObj.removeMouseMotionListener(mmListener);
+ tRes.tested("removeMouseMotionListener()", true);
+ }
+
+ /**
+ * A class we use to test addPaintListener() and
+ * removePaintListener()
+ */
+ public class TestPaintListener implements XPaintListener {
+ public boolean paint = false;
+
+ public void windowPaint(PaintEvent e) {
+ paint = true;
+ }
+
+ public void disposing(EventObject e) {}
+
+ public void init() {
+ paint = false;
+ }
+
+ }
+
+ private TestPaintListener pListener = new TestPaintListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _addPaintListener() {
+ oObj.addPaintListener(pListener);
+ tRes.tested("addPaintListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addPaintListener() </code> : adds paint listener to
+ * the object </li>
+ * </ul>
+ */
+ public void _removePaintListener() {
+ requiredMethod("addPaintListener()");
+ oObj.removePaintListener(pListener);
+ tRes.tested("removePaintListener()", true);
+ }
+
+ /**
+ * Sleeps for 0.2 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) ;
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java
new file mode 100644
index 000000000000..7c7cbe098032
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java
@@ -0,0 +1,271 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFastPropertySet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.beans;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XFastPropertySet;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.uno.UnoRuntime;
+import java.util.Random;
+import java.util.Set;
+import java.util.Vector;
+import lib.MultiMethodTest;
+import lib.StatusException;
+import util.ValueChanger;
+
+/**
+* Testing <code>com.sun.star.beans.XFastPropertySet</code>
+* interface methods :
+* <ul>
+* <li><code> setFastPropertyValue()</code></li>
+* <li><code> getFastPropertyValue()</code></li>
+* </ul> <p>
+* Required relations :
+* <ul>
+* <li> <code>'XFastPropertySet.ExcludeProps'</code>
+* <b>(optional) </b> : java.util.Set.
+* Has property names which must be skipped from testing in
+* some reasons (for example property accepts restricted set
+* of values).
+* </li>
+* <ul> <p>
+* @see com.sun.star.beans.XFastPropertySet
+*/
+public class _XFastPropertySet extends MultiMethodTest {
+
+ public XFastPropertySet oObj = null;
+ private Vector handles = new Vector();
+ private int handle = -1;
+ private Set exclude = null ;
+
+ /**
+ * Retrieves relation.
+ */
+ protected void before() {
+ exclude = (Set) tEnv.getObjRelation("XFastPropertySet.ExcludeProps") ;
+ if (exclude == null) {
+ exclude = new java.util.HashSet() ;
+ }
+ }
+
+ /**
+ * Test selects random property which can not be VOID and
+ * is writable, then change property value using <code>
+ * get/set</code> methods, and checks if value properly changed.
+ * Has <b> OK </b> status if value after change is not equal to value
+ * before and no exceptions were thrown. <p>
+ */
+ public void _setFastPropertyValue() {
+ XPropertySet PS = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ XPropertySetInfo propertySetInfo = PS.getPropertySetInfo();
+
+ if (propertySetInfo == null) {
+ log.println("getPropertySetInfo() method returned null");
+ tRes.tested("setFastPropertyValue()", false) ;
+ }
+ getPropsToTest(propertySetInfo);
+
+ Object gValue = null;
+ Object sValue = null;
+
+ if ( handle == -1) {
+ log.println("*** No changeable properties found ***");
+ tRes.tested("setFastPropertyValue()", false) ;
+ } else {
+ try {
+ gValue = oObj.getFastPropertyValue(handle);
+ sValue = ValueChanger.changePValue(gValue);
+ oObj.setFastPropertyValue(handle, sValue);
+ sValue = oObj.getFastPropertyValue(handle);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change property with handle = " + handle);
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change property with handle = " + handle);
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change property with handle = " + handle);
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change property with handle = " + handle);
+ e.printStackTrace(log);
+ }
+
+ tRes.tested("setFastPropertyValue()",(!gValue.equals(sValue)));
+ }
+ }
+
+ /**
+ * Test selects random property which can not be VOID and
+ * is writable, then calls the method and checks that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if exceptions were thrown. <p>
+ */
+ public void _getFastPropertyValue() {
+ XPropertySet PS = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ XPropertySetInfo propertySetInfo = PS.getPropertySetInfo();
+
+ if (propertySetInfo == null) {
+ log.println("getPropertySetInfo() method returned null");
+ tRes.tested("getFastPropertyValue()", false) ;
+ }
+
+ getPropsToTest(propertySetInfo);
+
+ try {
+ Object gValue = oObj.getFastPropertyValue(handle);
+ tRes.tested("getFastPropertyValue()",true);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to get property '"
+ + handle +"'");
+ e.printStackTrace(log);
+ tRes.tested("getFastPropertyValue()",false);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to get property '"
+ + handle +"'");
+ e.printStackTrace(log);
+ tRes.tested("getFastPropertyValue()",false);
+ }
+ return;
+ }
+
+
+ //Get the properties being tested
+ private void getPropsToTest(XPropertySetInfo xPSI) {
+
+ Property[] properties = xPSI.getProperties();
+
+ for (int i = 0; i < properties.length; i++) {
+ if (exclude.contains(properties[i].Name)) continue ;
+ Property property = properties[i];
+ String name = property.Name;
+ int handle = property.Handle;
+ log.println("Checking '" + name + "' with handle = " + handle);
+ boolean isWritable =
+ ((property.Attributes & PropertyAttribute.READONLY) == 0);
+ boolean isNotNull =
+ ((property.Attributes & PropertyAttribute.MAYBEVOID) == 0);
+ boolean isBound =
+ ((property.Attributes & PropertyAttribute.BOUND) != 0);
+ boolean isConstr =
+ ((property.Attributes & PropertyAttribute.CONSTRAINED) != 0);
+ boolean canChange = false;
+ if ( isWritable && isNotNull )
+ canChange = isChangeable(handle);
+ if ( isWritable && isNotNull && canChange)
+ handles.add(new Integer(handle));
+ } // endfor
+
+ Random rnd = new Random();
+ int nr = rnd.nextInt(handles.size());
+ handle = ((Integer)handles.elementAt(nr)).intValue();
+ }
+
+ private boolean isChangeable(int handle) {
+ boolean hasChanged = false;
+ try {
+ Object getProp = oObj.getFastPropertyValue(handle);
+ Object setValue = null;
+
+ if (getProp != null)
+ setValue = ValueChanger.changePValue(getProp);
+ else
+ log.println("Property with handle = " + handle
+ + " is null but 'MAYBEVOID' isn't set");
+ if (setValue != null) {
+ oObj.setFastPropertyValue(handle, setValue);
+ hasChanged =
+ (!getProp.equals(oObj.getFastPropertyValue(handle)));
+ }
+ else
+ log.println("Couldn't change Property with handle " + handle);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Property with handle " + handle + " throws exception");
+ e.printStackTrace(log);
+ throw new StatusException("Property with handle " + handle
+ + " throws exception", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Property with handle " + handle + " throws exception");
+ e.printStackTrace(log);
+ throw new StatusException("Property with handle " + handle
+ + " throws exception", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Property with handle " + handle + " throws exception");
+ e.printStackTrace(log);
+ throw new StatusException("Property with handle " + handle
+ + " throws exception", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Property with handle " + handle + " throws exception");
+ e.printStackTrace(log);
+ throw new StatusException("Property with handle " + handle
+ + " throws exception", e);
+ }
+
+ return hasChanged;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/beans/_XIntrospection.java b/qadevOOo/tests/java/ifc/beans/_XIntrospection.java
new file mode 100644
index 000000000000..12eb0a3bf4a8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/beans/_XIntrospection.java
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XIntrospection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.beans;
+
+import com.sun.star.beans.XIntrospection;
+import com.sun.star.beans.XIntrospectionAccess;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.beans.XIntrospection</code>
+* interface methods :
+* <ul>
+* <li><code> inspect() </code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.beans.XIntrospection
+*/
+public class _XIntrospection extends MultiMethodTest {
+
+ public XIntrospection oObj = null;
+
+ /**
+ * Test inspects the object tested, and checks if it
+ * has a base <code>XInterface</code> method
+ * <code>acquire</code>.
+ */
+ public void _inspect() {
+ boolean result = true;
+ XIntrospectionAccess xIA = oObj.inspect(oObj);
+ result = (xIA.hasMethod("acquire",1));
+ tRes.tested("inspect()",result);
+ }
+
+} // finish class _XIntrospection
+
+
diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
new file mode 100644
index 000000000000..c42acc5c971d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
@@ -0,0 +1,383 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMultiPropertySet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.beans;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.PropertyChangeEvent;
+import com.sun.star.beans.XMultiPropertySet;
+import com.sun.star.beans.XPropertiesChangeListener;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.lang.EventObject;
+import java.io.PrintWriter;
+import java.util.*;
+import lib.MultiMethodTest;
+import util.ValueChanger;
+
+
+/**
+* Testing <code>com.sun.star.beans.XMultiPropertySet</code>
+* interface methods :
+* <ul>
+* <li><code> getPropertySetInfo()</code></li>
+* <li><code> setPropertyValues()</code></li>
+* <li><code> getPropertyValues()</code></li>
+* <li><code> addPropertiesChangeListener()</code></li>
+* <li><code> removePropertiesChangeListener()</code></li>
+* <li><code> firePropertiesChangeEvent()</code></li>
+* </ul> <p>
+*
+* Required relations :
+* <ul>
+* <li> <code>'XMultiPropertySet.ExcludeProps'</code>
+* <b>(optional) </b> : java.util.Set.
+* Has property names which must be skipped from testing in
+* some reasons (for example property accepts restricted set
+* of values).
+* </li>
+* <ul> <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.beans.XMultiPropertySet
+*/
+public class _XMultiPropertySet extends MultiMethodTest {
+
+ public XMultiPropertySet oObj = null;
+
+ private boolean propertiesChanged = false;
+ private XPropertySetInfo propertySetInfo = null;
+ private String [] testPropsNames = null;
+ private int testPropsAmount = 0;
+ private PrintWriter _log = null;
+
+ private Object[] values = null;
+
+ private Set exclProps = null;
+
+ /**
+ * Initializes some fields.
+ */
+ public void before() {
+ _log = log;
+
+ exclProps = (Set) tEnv.getObjRelation("XMultiPropertySet.ExcludeProps");
+ if (exclProps == null) exclProps = new HashSet(0);
+ }
+
+ /**
+ * Listener implementation which sets a flag when
+ * listener was called.
+ */
+ public class MyChangeListener implements XPropertiesChangeListener {
+ public void propertiesChange(PropertyChangeEvent[] e) {
+ //_log.println("Listener was called");
+ propertiesChanged = true;
+ }
+ public void disposing (EventObject obj) {}
+ };
+
+ private XPropertiesChangeListener PClistener =
+ new MyChangeListener();
+
+ /**
+ * Test calls the method and checks return value.
+ * <code>PropertySetInfo</code> object is stored<p>
+ * Has <b> OK </b> status if the method returns not null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getPropertySetInfo() {
+ boolean bResult = true;
+ propertySetInfo = oObj.getPropertySetInfo();
+
+ if (propertySetInfo == null) {
+ log.println("getPropertySetInfo() method returned null");
+ bResult = false;
+ }
+
+ tRes.tested("getPropertySetInfo()", bResult) ;
+ }
+
+
+ /**
+ * Test collects all property names and retrieves their values,
+ * then checks the value returned. Finally it also collects
+ * bound properties for other methods tests.<p>
+ * Has <b> OK </b> status if the method returns non null value
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getPropertySetInfo() </code> : to have a list
+ * of properties.</li>
+ * </ul>
+ */
+ public void _getPropertyValues() {
+ requiredMethod("getPropertySetInfo()");
+ boolean bResult = true;
+
+ Property[] properties = propertySetInfo.getProperties();
+ String[] allnames = new String[properties.length];
+ for (int i = 0; i < properties.length; i++) {
+ allnames[i] = properties[i].Name;
+ }
+
+ values = oObj.getPropertyValues(allnames);
+
+ bResult &= values!=null;
+ tRes.tested("getPropertyValues()", bResult) ;
+
+ getPropsToTest(properties);
+ }
+
+ /**
+ * Test adds listener for all bound properties then each property
+ * is changed and listener call . <p>
+ * Has <b> OK </b> status if on each property change the listener was
+ * called and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getPropertyValues() </code> : to collect bound
+ * properties.</li>
+ * </ul>
+ */
+ public void _addPropertiesChangeListener() {
+
+ requiredMethod("getPropertyValues()");
+
+ boolean result = true ;
+ // Creating listener
+ oObj.addPropertiesChangeListener(testPropsNames, PClistener);
+
+
+ // Change one of the property to be sure, that this event was cauched.
+ //Random rnd = new Random();
+ //int idx = rnd.nextInt(testPropsAmount);
+ for (int i=0; i<testPropsAmount;i++) {
+ log.print("Trying to change property " + testPropsNames[i]);
+ try {
+ Object[] gValues = oObj.getPropertyValues(testPropsNames);
+ Object newValue = ValueChanger.changePValue(gValues[i]);
+ gValues[i] = newValue;
+ propertiesChanged = false;
+ oObj.setPropertyValues(testPropsNames, gValues);
+ waitAMoment() ;
+ result &= propertiesChanged ;
+ log.println(" ... done");
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+testPropsNames[i] + "' :" + e);
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+testPropsNames[i] + "' :" + e);
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+testPropsNames[i] + "' :" + e);
+ e.printStackTrace(log);
+ } // end of try-catch
+ }
+ tRes.tested("addPropertiesChangeListener()", propertiesChanged);
+ }
+
+ /**
+ * Calls method and check if listener was called. <p>
+ * Has <b> OK </b> status if the listener was
+ * called and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addPropertiesChangeListener() </code> : listener to
+ * be added.</li>
+ * </ul>
+ */
+ public void _firePropertiesChangeEvent() {
+ requiredMethod("addPropertiesChangeListener()");
+ propertiesChanged = false ;
+
+ oObj.firePropertiesChangeEvent(testPropsNames, PClistener);
+ waitAMoment() ;
+
+ tRes.tested("firePropertiesChangeEvent()", propertiesChanged);
+ }
+
+
+ /**
+ * Removes listener added before. <p>
+ * Has <b> OK </b> status no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addPropertiesChangeListener() </code> : listener to
+ * be added.</li>
+ * </ul>
+ */
+ public void _removePropertiesChangeListener() {
+ requiredMethod("firePropertiesChangeEvent()");
+ boolean bResult = true;
+
+ oObj.removePropertiesChangeListener(PClistener);
+
+ tRes.tested("removePropertiesChangeListener()", bResult);
+ }
+
+
+ /**
+ * Changes all properties, then set them to new values, get them
+ * and checks if their values were changed properly. <p>
+ * Has <b> OK </b> status if all properties properly changed
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getPropertyValues() </code> : to collect bound
+ * properties.</li>
+ * </ul>
+ */
+ public void _setPropertyValues() {
+ requiredMethod("getPropertyValues()");
+ boolean bResult = true;
+
+ log.println("Changing all properties");
+ Object[] gValues = oObj.getPropertyValues(testPropsNames);
+ for (int i=0; i<testPropsAmount;i++) {
+ Object oldValue = gValues[i];
+ Object newValue = ValueChanger.changePValue(gValues[i]);
+ gValues[i] = newValue;
+ }
+
+ try {
+ oObj.setPropertyValues(testPropsNames, gValues);
+ Object[] newValues = oObj.getPropertyValues(testPropsNames);
+ for (int i=0; i<testPropsAmount;i++) {
+ if (newValues[i].equals(gValues[i])) {
+ bResult = true;
+ }
+ }
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while setting properties");
+ e.printStackTrace(log);
+ bResult = false;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while setting properties");
+ e.printStackTrace(log);
+ bResult = false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while setting properties");
+ e.printStackTrace(log);
+ bResult = false;
+ } // end of try-catch
+
+ tRes.tested("setPropertyValues()", bResult);
+ }
+
+ //Get the properties being tested
+ private void getPropsToTest(Property[] properties) {
+
+ String bound = "";
+
+ for (int i = 0; i < properties.length; i++) {
+
+ Property property = properties[i];
+ String name = property.Name;
+ boolean isWritable = ((property.Attributes &
+ PropertyAttribute.READONLY) == 0);
+ boolean isNotNull = ((property.Attributes &
+ PropertyAttribute.MAYBEVOID) == 0);
+ boolean isBound = ((property.Attributes &
+ PropertyAttribute.BOUND) != 0);
+ boolean isExcluded = exclProps.contains(name);
+
+ if ( isWritable && isNotNull && isBound && !isExcluded) {
+ bound+=name+";";
+ }
+
+ } // endfor
+
+ //get a array of bound properties
+ if (bound.equals("")) bound = "none";
+ StringTokenizer ST=new StringTokenizer(bound,";");
+ int nr = ST.countTokens();
+ testPropsNames = new String[nr];
+ for (int i=0; i<nr; i++) testPropsNames[i] = ST.nextToken();
+ testPropsAmount = nr;
+ return;
+
+ }
+
+ /**
+ * Waits some time for listener to be called.
+ */
+ private void waitAMoment() {
+ try {
+ Thread.sleep(200) ;
+ } catch (java.lang.InterruptedException e) {
+ log.println("!!! Exception while waiting !!!") ;
+ }
+ }
+
+ /*
+ * Does nothing.
+ */
+ protected void after() {
+ //disposeEnvironment();
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java
new file mode 100644
index 000000000000..5532ce241109
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java
@@ -0,0 +1,252 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMultiPropertyStates.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.beans;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.PropertyState;
+import com.sun.star.beans.XMultiPropertyStates;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.beans.XMultiPropertyStates</code>
+* interface methods :
+* <ul>
+* <li><code> getPropertyStates()</code></li>
+* <li><code> setAllPropertiesToDefault()</code></li>
+* <li><code> getPropertyValues()</code></li>
+* <li><code> setPropertiesToDefault()</code></li>
+* <li><code> getPropertyDefaults()</code></li>
+* </ul>
+* @see com.sun.star.beans.XMultiPropertyStates
+*/
+public class _XMultiPropertyStates extends MultiMethodTest {
+
+ public XMultiPropertyStates oObj = null;
+
+ Object[] defaults = null;
+ PropertyState[] states = null;
+ String[] names = null;
+
+ public void before() {
+ names = (String[]) tEnv.getObjRelation("PropertyNames");
+ if (names == null) {
+ throw new StatusException(Status.failed("No PropertyNames given"));
+ }
+
+ log.println("Totally " + names.length + " properties encountered.");
+ }
+
+ /**
+ * Test calls the method and checks return value.
+ * <code>PropertyDefaults</code> are stored<p>
+ * Has <b> OK </b> status if the method returns not null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getPropertyDefaults() {
+ boolean result = false;
+ try {
+ defaults = oObj.getPropertyDefaults(names);
+ result = (defaults != null) && defaults.length == names.length;
+ log.println("Number of default values: " + defaults.length);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("some properties seem to be unknown");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Wrapped target Exception was thrown");
+ }
+ tRes.tested("getPropertyDefaults()", result) ;
+ }
+
+ /**
+ * Test calls the method and checks return value.
+ * Has <b> OK </b> status if the method returns not null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getPropertyStates() {
+ boolean result = false;
+ try {
+ states = oObj.getPropertyStates(names);
+ result = (states != null) && (states.length == names.length);
+ log.println("Number of states: " + states.length);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("some properties seem to be unknown");
+ }
+ tRes.tested("getPropertyStates()", result) ;
+ }
+
+ /**
+ * Test calls the method and checks return value.
+ * Has <b> OK </b> status if the Property
+ * has default state afterwards. <p>
+ */
+ public void _setPropertiesToDefault() {
+ requiredMethod("getPropertyStates()");
+ // searching for property which currently don't have default value
+ // and preferable has MAYBEDEFAULT attr
+ // if no such properties are found then the first one is selected
+ boolean mayBeDef = false;
+ String propName = names[0];
+ int propIdx = 0;
+
+ for(int i = 0; i < names.length; i++) {
+ if (!mayBeDef && states[i] != PropertyState.DEFAULT_VALUE ) {
+ propName = names[i];
+ propIdx = i;
+ XPropertySet xPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ XPropertySetInfo xPropSetInfo = xPropSet.getPropertySetInfo();
+ Property prop = null;
+ try {
+ prop = xPropSetInfo.getPropertyByName(names[i]);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("couldn't get property info");
+ throw new StatusException(Status.failed
+ ("couldn't get property info"));
+ }
+ if ( (prop.Attributes & PropertyAttribute.MAYBEDEFAULT) == 1 ){
+ log.println("Property " + names[i] +
+ " 'may be default' and doesn't have default value");
+ mayBeDef = true;
+ }
+ }
+ }
+ log.println("The property " + propName + " selected");
+
+ boolean result = false;
+ try {
+ String[] the_first = new String[1];
+ the_first[0] = propName;
+ log.println("Setting " + propName + " to default");
+ oObj.setPropertiesToDefault(the_first);
+ result = (oObj.getPropertyStates(the_first)[0].equals
+ (PropertyState.DEFAULT_VALUE));
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("some properties seem to be unknown");
+ }
+
+ if (!result) {
+ log.println("The property didn't change its state to default ...");
+ if (mayBeDef) {
+ log.println(" ... and it may be default - FAILED");
+ } else {
+ log.println(" ... but it may not be default - OK");
+ result = true;
+ }
+ }
+
+ tRes.tested("setPropertiesToDefault()", result) ;
+ }
+
+ /**
+ * Test calls the method and checks return value.
+ * Has <b> OK </b> status if the all Properties
+ * have default state afterwards. <p>
+ */
+ public void _setAllPropertiesToDefault() {
+ requiredMethod("setPropertiesToDefault()");
+ boolean result = true;
+
+ oObj.setAllPropertiesToDefault();
+ log.println("Checking that all properties are now in DEFAULT state" +
+ " excepting may be those which 'cann't be default'");
+
+ try {
+ states = oObj.getPropertyStates(names);
+ for (int i = 0; i < states.length; i++) {
+ boolean part_result = states[i].equals
+ (PropertyState.DEFAULT_VALUE);
+ if (!part_result) {
+ log.println("Property '" + names[i] +
+ "' wasn't set to default");
+ XPropertySet xPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ XPropertySetInfo xPropSetInfo =
+ xPropSet.getPropertySetInfo();
+ Property prop = xPropSetInfo.getPropertyByName(names[i]);
+ if ( (prop.Attributes &
+ PropertyAttribute.MAYBEDEFAULT) == 1 ) {
+ log.println(" ... and it has MAYBEDEFAULT "+
+ "attribute - FAILED");
+ } else {
+ log.println(" ... but it has no MAYBEDEFAULT "+
+ "attribute - OK");
+ part_result = true;
+ }
+ }
+
+ result &= part_result;
+ }
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("some properties seem to be unknown");
+ result=false;
+ }
+
+ tRes.tested("setAllPropertiesToDefault()", result) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/beans/_XPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XPropertySet.java
new file mode 100644
index 000000000000..32cfa51010b1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/beans/_XPropertySet.java
@@ -0,0 +1,641 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPropertySet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.beans;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.PropertyChangeEvent;
+import com.sun.star.beans.XPropertyChangeListener;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.beans.XVetoableChangeListener;
+import com.sun.star.lang.EventObject;
+import java.util.Random;
+import java.util.StringTokenizer;
+import lib.MultiMethodTest;
+import util.ValueChanger;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.beans.XPropertySet</code>
+* interface methods :
+* <ul>
+* <li><code>getPropertySetInfo()</code></li>
+* <li><code>setPropertyValue()</code></li>
+* <li><code>getPropertyValue()</code></li>
+* <li><code>addPropertyChangeListener()</code></li>
+* <li><code>removePropertyChangeListener()</code></li>
+* <li><code>addVetoableChangeListener()</code></li>
+* <li><code>removeVetoableChangeListener()</code></li>
+* </ul>
+* @see com.sun.star.beans.XPropertySet
+*/
+public class _XPropertySet extends MultiMethodTest {
+
+ public XPropertySet oObj = null;
+
+ /**
+ * Flag that indicates change listener was called.
+ */
+ boolean propertyChanged = false;
+
+ /**
+ * Listener that must be called on bound property changing.
+ */
+ public class MyChangeListener implements XPropertyChangeListener {
+ /**
+ * Just set <code>propertyChanged</code> flag to true.
+ */
+ public void propertyChange(PropertyChangeEvent e) {
+ propertyChanged = true;
+ }
+ public void disposing (EventObject obj) {}
+ };
+
+ XPropertyChangeListener PClistener = new MyChangeListener();
+
+ /**
+ * Flag that indicates veto listener was called.
+ */
+ boolean vetoableChanged = false;
+
+ /**
+ * Listener that must be called on constrained property changing.
+ */
+ public class MyVetoListener implements XVetoableChangeListener {
+ /**
+ * Just set <code>vetoableChanged</code> flag to true.
+ */
+ public void vetoableChange(PropertyChangeEvent e) {
+ vetoableChanged = true;
+ }
+ public void disposing (EventObject obj) {}
+ };
+
+ XVetoableChangeListener VClistener = new MyVetoListener();
+
+ /**
+ * Structure that collects three properties of each type to test :
+ * Constrained, Bound and Normal.
+ */
+ public class PropsToTest {
+ String constrained = null;
+ String bound = null;
+ String normal = null;
+ }
+
+ PropsToTest PTT = new PropsToTest();
+
+ /**
+ * Tests method <code>getPropertySetInfo</code>. After test completed
+ * call {@link #getPropsToTest} method to retrieve different kinds
+ * of properties to test then. <p>
+ * Has OK status if not null <code>XPropertySetInfo</code>
+ * object returned.<p>
+ * Since <code>getPropertySetInfo</code> is optional, it may return null,
+ * if it is not implemented. This method uses then an object relation
+ * <code>PTT</code> (Properties To Test) to determine available properties.
+ * All tests for services without <code>getPropertySetInfo</code> must
+ * provide this object relation.
+ */
+ public void _getPropertySetInfo() {
+
+ XPropertySetInfo propertySetInfo = oObj.getPropertySetInfo();
+
+ if (propertySetInfo == null) {
+ log.println("getPropertySetInfo() method returned null");
+ tRes.tested("getPropertySetInfo()", true) ;
+ String[] ptt = (String[]) tEnv.getObjRelation("PTT");
+ PTT.normal=ptt[0];
+ PTT.bound=ptt[1];
+ PTT.constrained=ptt[2];
+ } else {
+ tRes.tested("getPropertySetInfo()", true );
+ getPropsToTest(propertySetInfo);
+ }
+
+ return;
+
+ } // end of getPropertySetInfo()
+
+ /**
+ * Tests change listener which added for bound properties.
+ * Adds listener to bound property (if it exists), then changes
+ * its value and check if listener was called. <p>
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>getPropertySetInfo</code> : in this method test
+ * one of bound properties is retrieved. </li>
+ * </ul> <p>
+ * Has OK status if NO bound properties exist or if listener
+ * was successfully called.
+ */
+ public void _addPropertyChangeListener() {
+
+ requiredMethod("getPropertySetInfo()");
+
+ propertyChanged = false;
+
+
+ if ( PTT.bound.equals("none") ) {
+ log.println("*** No bound properties found ***");
+ tRes.tested("addPropertyChangeListener()", true) ;
+ } else {
+ try {
+ oObj.addPropertyChangeListener(PTT.bound,PClistener);
+ Object gValue = oObj.getPropertyValue(PTT.bound);
+ oObj.setPropertyValue(PTT.bound,
+ ValueChanger.changePValue(gValue));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace(log);
+ } // end of try-catch
+ tRes.tested("addPropertyChangeListener()", propertyChanged);
+ if (!propertyChanged) {
+ log.println("propertyChangeListener wasn't called for '"+
+ PTT.bound+"'");
+ }
+ } //endif
+
+ return;
+
+ } // end of addPropertyChangeListener()
+
+ /**
+ * Tests vetoable listener which added for constrained properties.
+ * Adds listener to constrained property (if it exists), then changes
+ * its value and check if listener was called. <p>
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>getPropertySetInfo</code> : in this method test
+ * one of constrained properties is retrieved. </li>
+ * </ul> <p>
+ * Has OK status if NO constrained properties exist or if listener
+ * was successfully called.
+ */
+ public void _addVetoableChangeListener() {
+
+ requiredMethod("getPropertySetInfo()");
+
+ vetoableChanged = false;
+
+ if ( PTT.constrained.equals("none") ) {
+ log.println("*** No constrained properties found ***");
+ tRes.tested("addVetoableChangeListener()", true) ;
+ } else {
+ try {
+ oObj.addVetoableChangeListener(PTT.constrained,VClistener);
+ Object gValue = oObj.getPropertyValue(PTT.constrained);
+ oObj.setPropertyValue(PTT.constrained,
+ ValueChanger.changePValue(gValue));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace(log);
+ } // end of try-catch
+ tRes.tested("addVetoableChangeListener()",vetoableChanged);
+ if (!vetoableChanged) {
+ log.println("vetoableChangeListener wasn't called for '"+
+ PTT.constrained+"'");
+ }
+ } //endif
+
+ return;
+
+ } // end of addVetoableChangeListener()
+
+
+ /**
+ * Tests <code>setPropertyValue</code> method.
+ * Stores value before call, and compares it with value after
+ * call. <p>
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>getPropertySetInfo</code> : in this method test
+ * one of normal properties is retrieved. </li>
+ * </ul> <p>
+ * Has OK status if NO normal properties exist or if value before
+ * method call is not equal to value after.
+ */
+ public void _setPropertyValue() {
+
+ requiredMethod("getPropertySetInfo()");
+
+ Object gValue = null;
+ Object sValue = null;
+
+ if ( PTT.normal.equals("none") ) {
+ log.println("*** No changeable properties found ***");
+ tRes.tested("setPropertyValue()", true) ;
+ } else {
+ try {
+ gValue = oObj.getPropertyValue(PTT.normal);
+ sValue = ValueChanger.changePValue(gValue);
+ oObj.setPropertyValue(PTT.normal, sValue);
+ sValue = oObj.getPropertyValue(PTT.normal);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.normal+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.normal+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.normal+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.normal+"'");
+ e.printStackTrace(log);
+ } // end of try-catch
+ tRes.tested("setPropertyValue()",(! gValue.equals(sValue)));
+ } //endif
+
+ return;
+
+ } // end of setPropertyValue()
+
+ /**
+ * Tests <code>getPropertyValue</code> method.
+ * Just call this method and checks for no exceptions <p>
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>getPropertySetInfo</code> : in this method test
+ * one of normal properties is retrieved. </li>
+ * </ul> <p>
+ * Has OK status if NO normal properties exist or if no
+ * exceptions were thrown.
+ */
+ public void _getPropertyValue() {
+
+ requiredMethod("getPropertySetInfo()");
+
+ String toCheck = PTT.normal;
+
+ if ( PTT.normal.equals("none") ) {
+ toCheck = oObj.getPropertySetInfo().getProperties()[0].Name;
+ log.println("All properties are Read Only");
+ log.println("Using: "+toCheck);
+ }
+
+ try {
+ Object gValue = oObj.getPropertyValue(toCheck);
+ tRes.tested("getPropertyValue()",true);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to get property '"+
+ PTT.normal+"'");
+ e.printStackTrace(log);
+ tRes.tested("getPropertyValue()",false);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to get property '"+
+ PTT.normal+"'");
+ e.printStackTrace(log);
+ tRes.tested("getPropertyValue()",false);
+ } // end of try-catch
+
+ return;
+ }
+
+ /**
+ * Tests <code>removePropertyChangeListener</code> method.
+ * Removes change listener, then changes bound property value
+ * and checks if the listener was NOT called.
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>addPropertyChangeListener</code> : here listener
+ * was added. </li>
+ * </ul> <p>
+ * Has OK status if NO bound properties exist or if listener
+ * was not called and no exceptions arose.
+ */
+ public void _removePropertyChangeListener() {
+
+ requiredMethod("addPropertyChangeListener()");
+
+ propertyChanged = false;
+
+ if ( PTT.bound.equals("none") ) {
+ log.println("*** No bound properties found ***");
+ tRes.tested("removePropertyChangeListener()", true) ;
+ } else {
+ try {
+ propertyChanged = false;
+ oObj.removePropertyChangeListener(PTT.bound,PClistener);
+ Object gValue = oObj.getPropertyValue(PTT.bound);
+ oObj.setPropertyValue(PTT.bound,
+ ValueChanger.changePValue(gValue));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace(log);
+ } // end of try-catch
+
+ tRes.tested("removePropertyChangeListener()",!propertyChanged);
+ if (propertyChanged) {
+ log.println("propertyChangeListener was called after removing"+
+ " for '"+PTT.bound+"'");
+ }
+ } //endif
+
+ return;
+
+ } // end of removePropertyChangeListener()
+
+
+ /**
+ * Tests <code>removeVetoableChangeListener</code> method.
+ * Removes vetoable listener, then changes constrained property value
+ * and checks if the listener was NOT called.
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>addPropertyChangeListener</code> : here vetoable listener
+ * was added. </li>
+ * </ul> <p>
+ * Has OK status if NO constrained properties exist or if listener
+ * was NOT called and no exceptions arose.
+ */
+ public void _removeVetoableChangeListener() {
+
+ requiredMethod("addVetoableChangeListener()");
+
+ vetoableChanged = false;
+
+ if ( PTT.constrained.equals("none") ) {
+ log.println("*** No constrained properties found ***");
+ tRes.tested("removeVetoableChangeListener()", true) ;
+ } else {
+ try {
+ oObj.removeVetoableChangeListener(PTT.constrained,VClistener);
+ Object gValue = oObj.getPropertyValue(PTT.constrained);
+ oObj.setPropertyValue(PTT.constrained,
+ ValueChanger.changePValue(gValue));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace(log);
+ } // end of try-catch
+
+ tRes.tested("removeVetoableChangeListener()",!vetoableChanged);
+ if (vetoableChanged) {
+ log.println("vetoableChangeListener was called after "+
+ "removing for '"+PTT.constrained+"'");
+ }
+ } //endif
+
+ return;
+
+ } // end of removeVetoableChangeListener()
+
+
+ /**
+ * Gets the properties being tested. Searches and stores by one
+ * property of each kind (Bound, Vetoable, Normal).
+ */
+ public PropsToTest getPropsToTest(XPropertySetInfo xPSI) {
+
+ Property[] properties = xPSI.getProperties();
+ String bound = "";
+ String constrained = "";
+ String normal = "";
+
+ for (int i = 0; i < properties.length; i++) {
+
+ Property property = properties[i];
+ String name = property.Name;
+ log.println("Checking '"+name+"'");
+ boolean isWritable = ((property.Attributes &
+ PropertyAttribute.READONLY) == 0);
+ boolean isNotNull = ((property.Attributes &
+ PropertyAttribute.MAYBEVOID) == 0);
+ boolean isBound = ((property.Attributes &
+ PropertyAttribute.BOUND) != 0);
+ boolean isConstr = ((property.Attributes &
+ PropertyAttribute.CONSTRAINED) != 0);
+ boolean canChange = false;
+
+ if ( !isWritable ) log.println("Property '"+name+"' is READONLY");
+
+ if (name.endsWith("URL")) isWritable = false;
+ if (name.startsWith("Fill")) isWritable = false;
+ if (name.startsWith("Font")) isWritable = false;
+ if (name.startsWith("IsNumbering")) isWritable = false;
+ if (name.startsWith("LayerName")) isWritable = false;
+ if (name.startsWith("Line")) isWritable = false;
+
+ //if (name.equals("xinterfaceA") || name.equals("xtypeproviderA")
+ //|| name.equals("arAnyA")) isWritable=false;
+
+ if ( isWritable && isNotNull ) canChange = isChangeable(name);
+
+ if ( isWritable && isNotNull && isBound && canChange) {
+ bound+=name+";";
+ }
+
+ if ( isWritable && isNotNull && isConstr && canChange) {
+ constrained+=name+";";
+ }
+
+ if ( isWritable && isNotNull && canChange) normal+=name+";";
+
+
+ } // endfor
+
+ //get a random bound property
+ PTT.bound=getRandomString(bound);
+ log.println("Bound: "+PTT.bound);
+
+ //get a random constrained property
+ PTT.constrained=getRandomString(constrained);
+ log.println("Constrained: "+PTT.constrained);
+
+ //get a random normal property
+ PTT.normal=getRandomString(normal);
+
+ return PTT;
+
+ }
+
+ /**
+ * Retrieves one random property name from list (property names separated
+ * by ';') of property names.
+ */
+ public String getRandomString(String str) {
+
+ String gRS = "none";
+ Random rnd = new Random();
+
+ if (str.equals("")) str = "none";
+ StringTokenizer ST=new StringTokenizer(str,";");
+ int nr = rnd.nextInt(ST.countTokens());
+ if (nr < 1) nr+=1;
+ for (int i=1; i<nr+1; i++) gRS = ST.nextToken();
+
+ return gRS;
+
+ }
+
+ public boolean isChangeable(String name) {
+ boolean hasChanged = false;
+ try {
+ Object getProp = oObj.getPropertyValue(name);
+ log.println("Getting: "+getProp);
+ if (name.equals("xinterfaceA")) {
+ System.out.println("drin");
+ }
+
+ Object setValue = null;
+ if (getProp != null) {
+ if (!utils.isVoid(getProp))
+ setValue = ValueChanger.changePValue(getProp);
+ else log.println("Property '"+name+
+ "' is void but MAYBEVOID isn't set");
+ } else log.println("Property '"+name+"'is null and can't be changed");
+ if (name.equals("LineStyle")) setValue = null;
+ if (setValue != null) {
+ oObj.setPropertyValue(name, setValue);
+ log.println("Setting to :"+setValue);
+ hasChanged = (! getProp.equals(oObj.getPropertyValue(name)));
+ } else log.println("Couldn't change Property '"+name+"'");
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace(log);
+ } catch (com.sun.star.uno.RuntimeException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace(log);
+ } catch (java.lang.ArrayIndexOutOfBoundsException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace(log);
+ }
+
+ return hasChanged;
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+
+} // finish class _XPropertySet
+
diff --git a/qadevOOo/tests/java/ifc/beans/_XPropertySetInfo.java b/qadevOOo/tests/java/ifc/beans/_XPropertySetInfo.java
new file mode 100644
index 000000000000..72a870bfc577
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/beans/_XPropertySetInfo.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPropertySetInfo.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.beans;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.XPropertySetInfo;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.beans.XPropertySetInfo</code>
+* interface methods :
+* <ul>
+* <li><code>getProperties()</code></li>
+* <li><code>getPropertyByName()</code></li>
+* <li><code>hasPropertyByName()</code></li>
+* </ul>
+* @see com.sun.star.beans.XPropertySetInfo
+*/
+public class _XPropertySetInfo extends MultiMethodTest {
+
+ public XPropertySetInfo oObj = null;// oObj filled by MultiMethodTest
+
+ public Property IsThere = null;
+
+ /**
+ * Test calls the method and stores one of the properties.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * value that isn't null.<p>
+ */
+ public void _getProperties() {
+ Property[] properties = oObj.getProperties();
+ IsThere = properties[0];
+ tRes.tested("getProperties()", ( properties != null ));
+ return;
+ }
+
+ /**
+ * Test calls the method with property name that certainly present
+ * in the property set and again calls the method with property name
+ * that certainly doesn't present in the property set.<p>
+ * Has <b> OK </b> status if the method in one case successfully
+ * returns value that isn't null and no exceptions were thrown and
+ * in other case exception was thrown.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>getProperties()</code> : to have a property that certainly
+ * present in the property set</li>
+ * </ul>
+ */
+ public void _getPropertyByName() {
+ requiredMethod("getProperties()");
+ boolean result;
+ try {
+ Property prop = oObj.getPropertyByName(IsThere.Name);
+ result = (prop != null);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occurred while testing" +
+ " getPropertyByName with existing property");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ try {
+ oObj.getPropertyByName("Jupp");
+ log.println("No Exception thrown while testing"+
+ " getPropertyByName with non existing property");
+ result = false;
+ }
+ catch (UnknownPropertyException e) {
+ result = true;
+ }
+ tRes.tested("getPropertyByName()", result);
+ return;
+ }
+
+ /**
+ * Test calls the method with property name that certainly present
+ * in the property set and again calls the method with property name
+ * that certainly doesn't present in the property set.<p>
+ * Has <b> OK </b> status if the method successfully returns true in
+ * one case and false in other case.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>getProperties()</code> : to have a property that certainly
+ * present in the property set</li>
+ * </ul>
+ */
+ public void _hasPropertyByName() {
+ requiredMethod("getProperties()");
+ boolean result;
+ tRes.tested("hasPropertyByName()",
+ (
+ (oObj.hasPropertyByName(IsThere.Name)) &&
+ (!oObj.hasPropertyByName("Jupp")) )
+ );
+ }
+
+} /// finish class XPropertySetInfo
+
+
diff --git a/qadevOOo/tests/java/ifc/beans/_XPropertyState.java b/qadevOOo/tests/java/ifc/beans/_XPropertyState.java
new file mode 100644
index 000000000000..bc28e7c3e09f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/beans/_XPropertyState.java
@@ -0,0 +1,279 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPropertyState.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:07:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.beans;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.PropertyState;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.beans.XPropertyState;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+
+/**
+* Testing <code>com.sun.star.beans.XPropertyState</code>
+* interface methods :
+* <ul>
+* <li><code> getPropertyState()</code></li>
+* <li><code> getPropertyStates()</code></li>
+* <li><code> setPropertyToDefault()</code></li>
+* <li><code> getPropertyDefault()</code></li>
+* </ul>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated. <p>
+* <b>Note:</b> object tested must also implement
+* <code>com.sun.star.beans.XPropertySet</code> interface.
+* @see com.sun.star.beans.XPropertyState
+*/
+public class _XPropertyState extends MultiMethodTest {
+
+ public XPropertyState oObj = null;
+
+ private XPropertySet oPS = null ;
+ private XPropertySetInfo propertySetInfo = null;
+ private Property[] properties = null ;
+ private String pName = null ;
+ private Object propDef = null ;
+
+ /**
+ * Queries object for <code>XPropertySet</code> interface and
+ * initializes some fields used by all methods. <p>
+ *
+ * Searches property which is not READONLY and MAYBEDEFAULT, if
+ * such property is not found, then uses property with only
+ * READONLY attribute. This property name is stored and is used
+ * by all tests.
+ *
+ * @throws StatusException If <code>XPropertySet</code> is not
+ * implemented by object.
+ */
+ public void before() throws StatusException {
+ oPS = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, oObj );
+ if (oPS == null)
+ throw new StatusException
+ ("XPropertySet interface isn't implemented.",
+ new NullPointerException
+ ("XPropertySet interface isn't implemented.")) ;
+
+ propertySetInfo = oPS.getPropertySetInfo();
+ properties = propertySetInfo.getProperties();
+ Property prop = null;
+ for (int i=0;i<properties.length;i++) {
+ try {
+ prop = propertySetInfo.getPropertyByName
+ (properties[i].Name);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Unknown Property "+prop.Name);
+ }
+ boolean readOnly = (prop.Attributes &
+ PropertyAttribute.READONLY) != 0;
+ boolean maybeDefault = (prop.Attributes &
+ PropertyAttribute.MAYBEDEFAULT) != 0;
+ if (!readOnly && maybeDefault) {
+ pName = properties[i].Name;
+ log.println("Property '" + pName + "' has attributes "+
+ prop.Attributes);
+ break ;
+ } else
+ if (!readOnly) {
+ pName = properties[i].Name;
+ log.println("Property '" + pName +
+ "' is not readonly, may be used ...");
+ } else {
+ log.println("Skipping property '" + properties[i].Name +
+ "' Readonly: " + readOnly + ", MaybeDefault: " +
+ maybeDefault);
+ }
+ }
+
+ }
+
+ /**
+ * Test calls the method and checks that no exceptions were thrown. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _getPropertyDefault(){
+ boolean result = true ;
+ try {
+ propDef = oObj.getPropertyDefault(pName);
+ log.println("Default property value is : '" + propDef + "'");
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception " + e +
+ "occured while getting Property default");
+ result=false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception " + e +
+ "occured while getting Property default");
+ result=false;
+ }
+ tRes.tested("getPropertyDefault()", result);
+ }
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if the method returns not null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getPropertyState(){
+ boolean result = true ;
+ try {
+ PropertyState ps = oObj.getPropertyState(pName);
+ if (ps == null) {
+ log.println("!!! Returned value == null") ;
+ result = false ;
+ }
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception " + e +
+ "occured while getting Property state");
+ result = false;
+ }
+ tRes.tested("getPropertyState()", result);
+ }
+
+ /**
+ * Test calls the method with array of one property name
+ * and checks return value and that no exceptions were thrown. <p>
+ * Has <b> OK </b> status if the method returns array with one
+ * PropertyState and no exceptions were thrown. <p>
+ */
+ public void _getPropertyStates(){
+ boolean result = true ;
+ try {
+ PropertyState[] ps = oObj.getPropertyStates
+ (new String[] {pName});
+ if (ps == null) {
+ log.println("!!! Returned value == null") ;
+ result = false ;
+ } else {
+ if (ps.length != 1) {
+ log.println("!!! Array lebgth returned is invalid - " +
+ ps.length) ;
+ result = false ;
+ }
+ }
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception " + e +
+ "occured while getting Property state");
+ result = false;
+ }
+
+ tRes.tested("getPropertyStates()", result);
+ }
+
+
+ /**
+ * Sets the property to default, then compares the current property
+ * value to value received by method <code>getPropertyDefault</code>.
+ * Has <b> OK </b> status if the current proeprty value equals to
+ * default property. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>getPropertyDefault</code>: we have to know what is
+ * default value</li></ul>
+ */
+ public void _setPropertyToDefault(){
+ requiredMethod("getPropertyDefault()") ;
+
+ boolean result = true ;
+ try {
+ oObj.setPropertyToDefault(pName);
+ if ((properties[0].Attributes &
+ PropertyAttribute.MAYBEDEFAULT) != 0) {
+ Object actualDef = propDef ;
+ if (propDef instanceof Any) {
+ actualDef = ((Any)propDef).getObject() ;
+ }
+ Object actualVal = oPS.getPropertyValue(pName) ;
+ if (actualVal instanceof Any) {
+ actualVal = ((Any)actualVal).getObject() ;
+ }
+ result = util.ValueComparer.equalValue
+ (actualDef,actualVal) ;
+ log.println("Default value = '" + actualDef +
+ "', returned value = '"
+ + actualVal + "' for property " + pName) ;
+ }
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception " + e +
+ "occured while setting Property to default");
+ result=false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception " + e +
+ "occured while testing property value");
+ result=false;
+ }
+
+ tRes.tested("setPropertyToDefault()", result);
+ }
+
+ public void after() {
+ disposeEnvironment() ;
+ }
+
+ }// EOF _XPropertyState
+
diff --git a/qadevOOo/tests/java/ifc/bridge/_XBridge.java b/qadevOOo/tests/java/ifc/bridge/_XBridge.java
new file mode 100644
index 000000000000..14b31c13ea19
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/bridge/_XBridge.java
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XBridge.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.bridge;
+
+import com.sun.star.bridge.XBridge;
+import com.sun.star.connection.XConnection;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+
+/**
+* Testing <code>com.sun.star.bridge.XBridge</code>
+* interface methods :
+* <ul>
+* <li><code> getInstance()</code></li>
+* <li><code> getName()</code></li>
+* <li><code> getDescription()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XInitialization.args'</code> (of type <code>Object[]</code>):
+* relation which contains arguments for Bridge initialization.
+* It used here to check description of the bridge. This array
+* must contain : [0] - the name of the bridge, [1] - the name of
+* protocol, [2] - <code>XConnection</code> reference to bridge
+* connection. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.bridge.XBridge
+*/
+public class _XBridge extends MultiMethodTest {
+
+ public XBridge oObj;
+
+ protected Object[] args;//for object relation 'XInitialization.args'
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ args = (Object[])tEnv.getObjRelation("XInitialization.args");
+
+ if (args == null) throw new StatusException(Status.failed
+ ("Relation 'XInitialization.args' not found")) ;
+ XInitialization xInit = (XInitialization)UnoRuntime.queryInterface(
+ XInitialization.class, oObj);
+ try {
+ xInit.initialize(args);
+ }
+ catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't initialize the bridge", e);
+ }
+ }
+
+ /**
+ * Tries to retrieve <code>ServiceManager</code> service
+ * using the bridge. <p>
+ * Has <b>OK</b> status if non null object returned.
+ */
+ public void _getInstance() {
+ XInterface xInt = (XInterface)oObj.getInstance(
+ "com.sun.star.lang.ServiceManager");
+
+ tRes.tested("getInstance()", xInt != null);
+ }
+
+ /**
+ * Retrieves the name of the bridge from relation and compares
+ * it to name returned by the method. <p>
+ * Has <b>OK</b> status if names are equal.
+ */
+ public void _getName() {
+ String expectedName = (String)args[0]; // args[0] - bridge name
+
+ String name = oObj.getName();
+
+ if (!tRes.tested("getName()", name.equals(expectedName))) {
+ log.println("getName() returns wrong result : \"" + name + "\"");
+ log.println("expected = \"" + expectedName + "\"");
+ }
+ }
+
+ /**
+ * Retrieves the description of the bridge and compares it with
+ * expected description composed using relation
+ * <code> ([protocol] + ":" + [connection description]) </code>. <p>
+ * Has <b>OK</b> status if description returned by the method
+ * is equal to expected one.
+ */
+ public void _getDescription() {
+ String protocol = (String)args[1]; // args[1] - protocol
+ XConnection xConnection = (XConnection)args[2]; // args[2] - connection
+ // expected description is protocol + ":" + xConnection.getDescription()
+ String expectedDescription =
+ protocol + ":" + xConnection.getDescription();
+
+ String description = oObj.getDescription();
+
+ if (!tRes.tested("getDescription()",
+ description.equals(expectedDescription))) {
+ log.println("getDescription() returns wrong result : \""
+ + description + "\"");
+ log.println("expected = \"" + expectedDescription + "\"");
+ }
+ }
+
+ /**
+ * Disposes object environment.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java b/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java
new file mode 100644
index 000000000000..1f29612627c0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java
@@ -0,0 +1,264 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XBridgeFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.bridge;
+
+import com.sun.star.bridge.XBridge;
+import com.sun.star.bridge.XBridgeFactory;
+import com.sun.star.connection.XAcceptor;
+import com.sun.star.connection.XConnection;
+import com.sun.star.connection.XConnector;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Tests <code>com.sun.star.bridge.XBridgeFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createBridge()</code></li>
+* <li><code> getBridge()</code></li>
+* <li><code> getExistingBridges()</code></li>
+* </ul> <p>
+* @see com.sun.star.bridge.XBridgeFactory
+*/
+public class _XBridgeFactory extends MultiMethodTest {
+
+ public XBridgeFactory oObj = null;
+
+ private String bridgeName = null ;
+
+ AcceptorThread acceptorThread = null;
+
+ /**
+ * Interrupts the acceptor after test is finished
+ */
+ protected void after() {
+ acceptorThread.acc.stopAccepting();
+ if (acceptorThread.isAlive()) {
+ acceptorThread.interrupt();
+ }
+ }
+ /**
+ * 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 {
+ /**
+ * the acceptor
+ */
+ private XAcceptor acc = null ;
+ /**
+ * If exception occured during method call it is
+ * stored in this field.
+ */
+ public Exception ex = null ;
+ /**
+ * If method call returns some value it stores in this field.
+ */
+ public XConnection acceptedCall = null ;
+
+ /**
+ * Gets an object which can call <code>accept</code> method.
+ */
+ public AcceptorThread(XAcceptor acc) {
+ this.acc = acc ;
+ }
+
+ /**
+ * Call <code>accept()</code> method.
+ */
+ 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 ;
+ }
+ }
+ }
+
+ /**
+ * Variable to make bridge names unique in different threads.
+ */
+ public static int uniqueSuffix = 0 ;
+ /**
+ * Object for synchronizing <code>uniqueSuffix</code> increment.
+ */
+ public static Object synchFlag = new Object() ;
+ /**
+ * Connection string
+ */
+ public String connectString;
+
+ /**
+ * Gets array of existing bridges. <p>
+ * Has <b>OK</b> status if method returns not null.
+ */
+ public void _getExistingBridges() {
+
+ XBridge[] bridges = oObj.getExistingBridges() ;
+
+ log.println("Existing bridges :") ;
+ for (int i = 0; i < bridges.length; i++)
+ log.println(" " + bridges[i].getDescription()) ;
+
+ if (bridges.length > 0) bridgeName = bridges[0].getName() ;
+
+ tRes.tested("getExistingBridges()", bridges != null) ;
+ }
+
+ /**
+ * First creates connection with StarOffice process, using environment
+ * property <code>'CNCSTR'</code>. Then cerates bridge with unique name
+ * using protocol specified in environment as <code>'PROTOCOL'</code>
+ * property. After that bridge is disposed. <p>
+ * Has <b>OK</b> status if value returned is not null
+ * and no exceptions were thrown.<p>
+ */
+ public void _createBridge() {
+ XBridge bridge = null;
+ XConnection conn = null ;
+ boolean result = false ;
+
+ // first creating a connection
+ try {
+ XInterface x = (XInterface) tParam.getMSF().createInstance
+ ("com.sun.star.connection.Connector") ;
+
+ XConnector xCntr = (XConnector) UnoRuntime.queryInterface
+ (XConnector.class, x) ;
+
+ x = (XInterface) tParam.getMSF().createInstance
+ ("com.sun.star.connection.Acceptor") ;
+
+ XAcceptor xAccptr = (XAcceptor)UnoRuntime.queryInterface(
+ XAcceptor.class, x);
+ connectString = (String)tEnv.getObjRelation("CNNCTSTR");
+ acceptorThread = new AcceptorThread(xAccptr) ;
+ acceptorThread.start();
+
+ try {
+ Thread.sleep(500);
+ }
+ catch (java.lang.InterruptedException e) {}
+ conn = xCntr.connect(connectString) ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create connection", e);
+ }
+
+ try {
+ String protocol = (String) tParam.get("PROTOCOL") ;
+ if (protocol == null) protocol = "iiop" ;
+
+ String brName ;
+ synchronized (synchFlag) {
+ brName = "MyBridge" + (uniqueSuffix++) ;
+ }
+
+ log.println("Creating bridge with name " + brName) ;
+
+ bridge = oObj.createBridge(brName,
+ protocol, conn, null) ;
+
+
+ result = bridge != null ;
+ } catch (com.sun.star.bridge.BridgeExistsException e) {
+ log.println("Exception while bridge creating :" + e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while bridge creating :" + e) ;
+ }
+
+ tRes.tested("createBridge()", result) ;
+ }
+
+ /**
+ * Gets bridge by name and checks the bridge name returned. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code>getExestingBridges</code> : to have some bridge name
+ * to retrieve </li>
+ * </ul> <p>
+ * Has <b>OK</b> status if bridge successfully returned and it's name
+ * equals to name passed as parameter.
+ */
+ public void _getBridge() {
+ executeMethod("getExistingBridges()") ;
+
+ if (bridgeName == null) {
+ log.println("No name for getting the bridge") ;
+ return ;
+ }
+
+ XBridge br = oObj.getBridge(bridgeName) ;
+
+ tRes.tested("getBridge()", br != null &&
+ bridgeName.equals(br.getName())) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java b/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java
new file mode 100644
index 000000000000..9ebb13e351a1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java
@@ -0,0 +1,244 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XUnoUrlResolver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.bridge;
+
+import com.sun.star.bridge.XBridge;
+import com.sun.star.bridge.XBridgeFactory;
+import com.sun.star.bridge.XInstanceProvider;
+import com.sun.star.bridge.XUnoUrlResolver;
+import com.sun.star.connection.ConnectionSetupException;
+import com.sun.star.connection.NoConnectException;
+import com.sun.star.connection.XAcceptor;
+import com.sun.star.connection.XConnection;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.StatusException;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.bridge.XUnoUrlResolver</code>
+* interface methods :
+* <ul>
+* <li><code> resolve()</code></li>
+* </ul> <p>
+* @see com.sun.star.bridge.XUnoUrlResolver
+*/
+public class _XUnoUrlResolver extends MultiMethodTest {
+
+ // starting port and current port to choose
+ static int basePort = 0;
+ int curPort = 0;
+
+ public XUnoUrlResolver oObj;
+
+ /**
+ * Implementation for providing an instance
+ *
+ * @see com.sun.star.bridge.XInstanceProvider
+ */
+ 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
+ {
+ try {
+ return xMSF.createInstance(aInstanceName);
+ }
+ catch(com.sun.star.uno.Exception e) {
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+ }
+
+ /**
+ * Thread for creating a bridge so the resolver can access it
+ */
+ class BridgeThread extends Thread {
+ private XBridgeFactory xBrdgFctr = null;
+ private XInstanceProvider xInstProv = null;
+ private XAcceptor xAcc = null;
+ private String connectString = null;
+
+ public XBridge xBridge = null;
+
+ public BridgeThread(XAcceptor xAcc, XBridgeFactory xBrdgFctr,
+ XInstanceProvider xInstProv, String connectString
+ ) {
+ this.xInstProv = xInstProv;
+ this.xBrdgFctr = xBrdgFctr;
+ this.xAcc = xAcc;
+ this.connectString = connectString;
+ }
+
+ public void run() {
+ try {
+ // create a connection
+ XConnection xCon = xAcc.accept(connectString);
+ // create a bridge over that conmnection
+ xBridge = xBrdgFctr.createBridge(
+ "MyBridge", "urp", xCon, xInstProv);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.connection.ConnectionSetupException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.connection.AlreadyAcceptingException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.bridge.BridgeExistsException e) {
+ e.printStackTrace(log);
+ }
+ }
+
+ }
+ /**
+ * Test calls the method using environment property
+ * <code>'CNCSTR'</code>. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * object that support interface <code>XMultiServiceFactory</code> and
+ * no exceptions were thrown. <p>
+ * @see com.sun.star.lang.XMultiServiceFactory
+ */
+ public void _resolve() {
+ String connectStr = (String)tParam.get("CNCSTR");
+ int pIndex = connectStr.indexOf("port=") + 5;
+ connectStr = connectStr.substring(0, pIndex);
+ System.out.println("ConnectString: " + connectStr);
+
+ // select the port
+ basePort = ((Integer)tEnv.getObjRelation("PORT")).intValue();
+ curPort = utils.getNextFreePort(basePort);
+ log.println("Choose Port nr: " + curPort);
+
+ connectStr += curPort;
+
+ try {
+ XMultiServiceFactory xMSF = tParam.getMSF();
+
+ // get the bridge factory
+ XBridgeFactory xBrdgFctr = (XBridgeFactory)
+ UnoRuntime.queryInterface(XBridgeFactory.class,
+ tEnv.getObjRelation("BRIDGEFACTORY"));
+
+ // get the acceptor
+ XAcceptor xAcc = (XAcceptor)UnoRuntime.queryInterface(
+ XAcceptor.class, tEnv.getObjRelation("ACCEPTOR"));
+
+ // instance provider
+ XInstanceProvider xInstProv = new MyInstanceProvider(xMSF);
+ // thread for providing a bridge
+ BridgeThread brThread = new BridgeThread(xAcc, xBrdgFctr,
+ xInstProv, connectStr);
+ brThread.start();
+
+ try {
+ Thread.sleep(500);
+ }
+ catch(java.lang.InterruptedException e) {}
+ // get an instance from the remote
+ Object obj = oObj.resolve(
+ "uno:" + connectStr + ";urp;com.sun.star.lang.ServiceManager");
+ // got the instance?
+ XMultiServiceFactory oMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, obj);
+
+ if (brThread.isAlive())
+ brThread.interrupt();
+
+ tRes.tested("resolve()", oMSF != null);
+ } catch (NoConnectException e) {
+ log.println("Unexpected exception thrown " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ } catch (ConnectionSetupException e) {
+ log.println("Unexpected exception thrown " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ } catch (IllegalArgumentException e) {
+ log.println("Unexpected exception thrown " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception thrown " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/chart/_BarDiagram.java b/qadevOOo/tests/java/ifc/chart/_BarDiagram.java
new file mode 100644
index 000000000000..8751b5ea89b8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_BarDiagram.java
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * $RCSfile: _BarDiagram.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.BarDiagram</code>
+* service properties:
+* <ul>
+* <li><code>'Vertical'</code></li>
+* <li><code>'Deep'</code></li>
+* <li><code>'StackedBarsConnected'</code></li>
+* <li><code>'NumberOfLines'</code></li>
+* </ul>
+* Properties testing is automated
+* by <code>lib.MultiPropertyTest</code> except property
+* <code>'NumberOfLines'</code>. <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* <li> <code>'BAR'</code> (of type <code>XDiagram</code>):
+* relation that use as parameter for method setDiagram of chart document </li>
+* <ul> <p>
+* @see com.sun.star.chart.BarDiagram
+* @see com.sun.star.chart.XChartDocument
+* @see com.sun.star.chart.XDiagram
+* @see lib.MultiPropertyTest
+*/
+public class _BarDiagram extends MultiPropertyTest {
+
+ XChartDocument doc = null;
+ XDiagram oldDiagram = null;
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to BarDiagram");
+ doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ XDiagram bar = (XDiagram) tEnv.getObjRelation("BAR");
+ if (bar == null) throw new StatusException(Status.failed
+ ("Relation 'BAR' not found"));
+
+ oldDiagram = doc.getDiagram();
+ doc.setDiagram(bar);
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ log.println("Set it to 3D");
+ try {
+ oObj.setPropertyValue("Dim3D", new Boolean(true));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ }
+ }
+
+ /**
+ * Sets the old diagram for a chart document.
+ */
+ protected void after() {
+ doc.setDiagram(oldDiagram);
+ }
+
+ protected PropertyTester LineTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ int a = 0;
+ int b = 2;
+ if ( ((Integer) oldValue).intValue() == a)
+ return new Integer(b); else
+ return new Integer(a);
+ }
+ } ;
+
+ /**
+ * Tests property 'NumberOfLines'.
+ * This property tests when diagram in 2D-mode only
+ * except all other properties. This property is currently supported by
+ * two dimensional vertical bar charts only.
+ */
+ public void _NumberOfLines() {
+ log.println("Set it to 2D");
+ try {
+ oObj.setPropertyValue("Dim3D", new Boolean(false));
+ oObj.setPropertyValue("Vertical", new Boolean(false));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ }
+
+ log.println("Testing with custom Property tester") ;
+ testProperty("NumberOfLines", LineTester) ;
+ }
+} // EOF BarDiagram
+
diff --git a/qadevOOo/tests/java/ifc/chart/_Chart3DBarProperties.java b/qadevOOo/tests/java/ifc/chart/_Chart3DBarProperties.java
new file mode 100644
index 000000000000..46b2eba8119e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_Chart3DBarProperties.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Chart3DBarProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.Chart3DBarProperties</code>
+* service properties:
+* <ul>
+* <li><code> SolidType</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* <li> <code>'BAR'</code> (of type <code>XDiagram</code>):
+* relation that use as parameter for method setDiagram of chart document </li>
+* <ul> <p>
+* @see com.sun.star.chart.Chart3DBarProperties
+* @see com.sun.star.chart.XChartDocument
+* @see com.sun.star.chart.XDiagram
+*/
+public class _Chart3DBarProperties extends MultiPropertyTest {
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to BarDiagram");
+ XChartDocument doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ XDiagram bar = (XDiagram) tEnv.getObjRelation("BAR");
+ if (bar == null) throw new StatusException(Status.failed
+ ("Relation 'BAR' not found"));
+
+ doc.setDiagram(bar);
+ log.println("Change Diagram to 3D");
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ try {
+ oObj.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);
+ }
+ }
+} // finish class _Chart3DBarProperties
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartAxis.java b/qadevOOo/tests/java/ifc/chart/_ChartAxis.java
new file mode 100644
index 000000000000..7493729d1e35
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartAxis.java
@@ -0,0 +1,231 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartAxis.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import lib.StatusException;
+import util.ValueChanger;
+
+/**
+* Testing <code>com.sun.star.chart.ChartAxis</code>
+* service properties:
+* <ul>
+* <li><code> ArrangeOrder</code></li>
+* <li><code> AutoMax</code></li>
+* <li><code> AutoMin</code></li>
+* <li><code> AutoOrigin</code></li>
+* <li><code> AutoStepHelp</code></li>
+* <li><code> AutoStepMain</code></li>
+* <li><code> DisplayLabels</code></li>
+* <li><code> GapWidth</code></li>
+* <li><code> HelpMarks</code></li>
+* <li><code> Logarithmic</code></li>
+* <li><code> Marks</code></li>
+* <li><code> Max</code></li>
+* <li><code> Min</code></li>
+* <li><code> NumberFormat</code></li>
+* <li><code> Origin</code></li>
+* <li><code> Overlap</code></li>
+* <li><code> StepHelp</code></li>
+* <li><code> StepMain</code></li>
+* <li><code> TextBreak</code></li>
+* <li><code> TextRotation</code></li>
+* <li><code> TextCanOverlap</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartAxis
+*/
+public class _ChartAxis extends MultiPropertyTest {
+
+ /**
+ * Tests property 'Max'.
+ * Property 'AutoOrigin' sets to true and property 'AutoMax'
+ * sets to false before test.
+ */
+ public void _Max() {
+ try {
+ //if AutoOrigin isn't true then this property works only when
+ //current Origin is less then new value of Max
+ oObj.setPropertyValue("AutoOrigin", new Boolean(true));
+ oObj.setPropertyValue("AutoMax",new Boolean(false));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ }
+
+ testProperty("Max");
+ }
+
+ /**
+ * Tests property 'Min'.
+ * Property 'AutoOrigin' sets to true and property 'AutoMin'
+ * sets to false before test.
+ */
+ public void _Min() {
+ try {
+ //if AutoOrigin isn't true then this property works only when
+ //current Origin is greater then new value of Min
+ oObj.setPropertyValue("AutoOrigin", new Boolean(true));
+ oObj.setPropertyValue("AutoMin", new Boolean(false));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ }
+
+ testProperty("Min");
+ }
+
+ /**
+ * Tests property 'Origin'.
+ * Property 'Logarithmic' sets to false before test.
+ */
+ public void _Origin() {
+ try {
+ oObj.setPropertyValue("Logarithmic",new Boolean(false));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ }
+
+ testProperty("Origin");
+ }
+
+ protected PropertyTester StepMainTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ Double ValueToSet = (Double) ValueChanger.changePValue(oldValue);
+ double stm = ValueToSet.doubleValue();
+ stm = stm / 5;
+ return new Double(stm);
+ }
+ };
+
+ /**
+ * Tests property 'StepMain'.
+ * Property 'Logarithmic' and 'AutoStepMain' sets
+ * to false before test.
+ */
+ public void _StepMain() {
+ try {
+ oObj.setPropertyValue("AutoStepMain", new Boolean(false));
+ oObj.setPropertyValue("Logarithmic",new Boolean(false));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't set property value", e);
+ }
+
+ testProperty("StepMain", StepMainTester);
+ }
+} // finish class _ChartAxis
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartAxisXSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartAxisXSupplier.java
new file mode 100644
index 000000000000..a8c4ca08f125
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartAxisXSupplier.java
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartAxisXSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.chart.ChartAxisXSupplier</code>
+* service properties :
+* <ul>
+* <li><code> HasXAxis</code></li>
+* <li><code> HasXAxisDescription</code></li>
+* <li><code> HasXAxisGrid</code></li>
+* <li><code> HasXAxisHelpGrid</code></li>
+* <li><code> HasXAxisTitle</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartAxisXSupplier
+*/
+public class _ChartAxisXSupplier extends MultiPropertyTest {
+ public void _HasXAxis() {
+ try {
+ log.println("Property HasXAxis");
+ boolean res = ((Boolean)oObj.getPropertyValue(
+ "HasXAxis")).booleanValue();
+ if (!res)
+ oObj.setPropertyValue("HasXAxis", Boolean.TRUE);
+ // test connected property HasXAxisDescription
+ if (!((Boolean)oObj.getPropertyValue(
+ "HasXAxisDescription")).booleanValue())
+ oObj.setPropertyValue("HasXAxisDescription", Boolean.TRUE);
+
+ oObj.setPropertyValue("HasXAxis", Boolean.FALSE);
+ boolean setVal = ((Boolean)oObj.getPropertyValue(
+ "HasXAxis")).booleanValue();
+ log.println("Start value: " + setVal);
+ // description should also be false now
+ setVal |= ((Boolean)oObj.getPropertyValue(
+ "HasXAxisDescription")).booleanValue();
+ log.println("Connected value axis description: " + setVal);
+
+ oObj.setPropertyValue("HasXAxis", Boolean.TRUE);
+ setVal |= !((Boolean)oObj.getPropertyValue(
+ "HasXAxis")).booleanValue();
+ log.println("Changed value: " + !setVal);
+
+ // description should be true again
+ setVal |= !((Boolean)oObj.getPropertyValue(
+ "HasXAxisDescription")).booleanValue();
+ log.println("Changed connected value axis description: " + !setVal);
+
+ tRes.tested("HasXAxis", !setVal);
+ // leave axis untouched
+ oObj.setPropertyValue("HasXAxis", new Boolean(res));
+ }
+ catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasXAxis", false);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasXAxis", false);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasXAxis", false);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasXAxis", false);
+ }
+ }
+
+ public void _HasXAxisDescription() {
+ requiredMethod("HasXAxis");
+ try {
+ log.println("Property HasXAxisDescription");
+ if (!((Boolean)oObj.getPropertyValue("HasXAxis")).booleanValue())
+ oObj.setPropertyValue("HasXAxis", Boolean.TRUE);
+
+ boolean res = ((Boolean)oObj.getPropertyValue(
+ "HasXAxisDescription")).booleanValue();
+ log.println("Start value: " + res);
+
+ oObj.setPropertyValue("HasXAxisDescription", new Boolean(!res));
+ boolean setValue = ((Boolean)oObj.getPropertyValue(
+ "HasXAxisDescription")).booleanValue();
+ log.println("Changed value: " + setValue);
+ tRes.tested("HasXAxisDescription", res != setValue);
+ }
+ catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasXAxisDescription", false);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasXAxisDescription", false);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasXAxisDescription", false);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasXAxisDescription", false);
+ }
+ }
+} // EOF ChartAxisXSupplier
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartAxisYSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartAxisYSupplier.java
new file mode 100644
index 000000000000..51a4de25592c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartAxisYSupplier.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartAxisYSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.ChartAxisYSupplier</code>
+* service properties :
+* <ul>
+* <li><code> HasYAxis</code></li>
+* <li><code> HasYAxisDescription</code></li>
+* <li><code> HasYAxisGrid</code></li>
+* <li><code> HasYAxisHelpGrid</code></li>
+* <li><code> HasYAxisTitle</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartAxisYSupplier
+*/
+public class _ChartAxisYSupplier extends MultiPropertyTest {
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ XChartDocument doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ }
+
+ public void _HasYAxis() {
+ try {
+ log.println("Property HasYAxis");
+ boolean res = ((Boolean)oObj.getPropertyValue(
+ "HasYAxis")).booleanValue();
+ if (!res)
+ oObj.setPropertyValue("HasYAxis", Boolean.TRUE);
+ // test connected property HasYAxisDescription
+ if (!((Boolean)oObj.getPropertyValue(
+ "HasYAxisDescription")).booleanValue())
+ oObj.setPropertyValue("HasYAxisDescription", Boolean.TRUE);
+
+ oObj.setPropertyValue("HasYAxis", Boolean.FALSE);
+ boolean setVal = ((Boolean)oObj.getPropertyValue(
+ "HasYAxis")).booleanValue();
+ log.println("Start value: " + setVal);
+ // description should also be false now
+ setVal |= ((Boolean)oObj.getPropertyValue(
+ "HasYAxisDescription")).booleanValue();
+ log.println("Connected value axis description: " + setVal);
+
+ oObj.setPropertyValue("HasYAxis", Boolean.TRUE);
+ setVal |= !((Boolean)oObj.getPropertyValue(
+ "HasYAxis")).booleanValue();
+ log.println("Changed value: " + !setVal);
+
+ // description should be true again
+ setVal |= !((Boolean)oObj.getPropertyValue(
+ "HasYAxisDescription")).booleanValue();
+ log.println("Changed connected value axis description: "+!setVal);
+
+ tRes.tested("HasYAxis", !setVal);
+ // leave axis untouched
+ oObj.setPropertyValue("HasYAxis", new Boolean(res));
+ }
+ catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasYAxis", false);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasYAxis", false);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasYAxis", false);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasYAxis", false);
+ }
+ }
+
+ public void _HasYAxisDescription() {
+ requiredMethod("HasYAxis");
+ try {
+ log.println("Property HasYAxisDescription");
+ if (!((Boolean)oObj.getPropertyValue("HasYAxis")).booleanValue())
+ oObj.setPropertyValue("HasYAxis", Boolean.TRUE);
+
+ boolean res = ((Boolean)oObj.getPropertyValue(
+ "HasYAxisDescription")).booleanValue();
+ log.println("Start value: " + res);
+
+ oObj.setPropertyValue("HasYAxisDescription", new Boolean(!res));
+ boolean setValue = ((Boolean)oObj.getPropertyValue(
+ "HasYAxisDescription")).booleanValue();
+ log.println("Changed value: " + setValue);
+ tRes.tested("HasYAxisDescription", res != setValue);
+ }
+ catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasYAxisDescription", false);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasYAxisDescription", false);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasYAxisDescription", false);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasYAxisDescription", false);
+ }
+ }
+
+} // EOF ChartAxisYSupplier
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartAxisZSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartAxisZSupplier.java
new file mode 100644
index 000000000000..521c87835f27
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartAxisZSupplier.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartAxisZSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.ChartAxisZSupplier</code>
+* service properties :
+* <ul>
+* <li><code> HasZAxis</code></li>
+* <li><code> HasZAxisDescription</code></li>
+* <li><code> HasZAxisGrid</code></li>
+* <li><code> HasZAxisHelpGrid</code></li>
+* <li><code> HasZAxisTitle</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* <li> <code>'BAR'</code> (of type <code>XDiagram</code>):
+* relation that use as parameter for method setDiagram of chart document</li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartAxisZSupplier
+*/
+public class _ChartAxisZSupplier extends MultiPropertyTest {
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to BarDiagram");
+ XChartDocument doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ XDiagram bar = (XDiagram) tEnv.getObjRelation("BAR");
+ if (bar == null) throw new StatusException(Status.failed
+ ("Relation 'BAR' not found"));
+
+ doc.setDiagram(bar);
+ log.println("Set it to 3D");
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ try {
+ oObj.setPropertyValue("Dim3D", new Boolean(true));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ }
+ }
+
+ public void _HasZAxis() {
+ try {
+ log.println("Property HasZAxis");
+ boolean res = ((Boolean)oObj.getPropertyValue(
+ "HasZAxis")).booleanValue();
+ if (!res)
+ oObj.setPropertyValue("HasZAxis", Boolean.TRUE);
+ // test connected property HasZAxisDescription
+ if (!((Boolean)oObj.getPropertyValue(
+ "HasZAxisDescription")).booleanValue())
+ oObj.setPropertyValue("HasZAxisDescription", Boolean.TRUE);
+
+ oObj.setPropertyValue("HasZAxis", Boolean.FALSE);
+ boolean setVal = ((Boolean)oObj.getPropertyValue(
+ "HasZAxis")).booleanValue();
+ log.println("Start value: " + setVal);
+ // description should also be false now
+ setVal |= ((Boolean)oObj.getPropertyValue(
+ "HasZAxisDescription")).booleanValue();
+ log.println("Connected value axis description: " + setVal);
+
+ oObj.setPropertyValue("HasZAxis", Boolean.TRUE);
+ setVal |= !((Boolean)oObj.getPropertyValue(
+ "HasZAxis")).booleanValue();
+ log.println("Changed value: " + !setVal);
+
+ // description should be true again
+ setVal |= !((Boolean)oObj.getPropertyValue(
+ "HasZAxisDescription")).booleanValue();
+ log.println("Changed connected value axis description: " + !setVal);
+
+ tRes.tested("HasZAxis", !setVal);
+ // leave axis untouched
+ oObj.setPropertyValue("HasZAxis", new Boolean(res));
+ }
+ catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasZAxis", false);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasZAxis", false);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasZAxis", false);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasZAxis", false);
+ }
+ }
+
+ public void _HasZAxisDescription() {
+ requiredMethod("HasZAxis");
+ try {
+ log.println("Property HasZAxisDescription");
+ if (!((Boolean)oObj.getPropertyValue("HasZAxis")).booleanValue())
+ oObj.setPropertyValue("HasZAxis", Boolean.TRUE);
+
+ boolean res = ((Boolean)oObj.getPropertyValue(
+ "HasZAxisDescription")).booleanValue();
+ log.println("Start value: " + res);
+
+ oObj.setPropertyValue("HasZAxisDescription", new Boolean(!res));
+ boolean setValue = ((Boolean)oObj.getPropertyValue(
+ "HasZAxisDescription")).booleanValue();
+ log.println("Changed value: " + setValue);
+ tRes.tested("HasZAxisDescription", res != setValue);
+ }
+ catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasZAxisDescription", false);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasZAxisDescription", false);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasZAxisDescription", false);
+ }
+ catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println(e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("HasZAxisDescription", false);
+ }
+ }
+
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+} // EOF ChartAxisZSupplier
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartDataPointProperties.java b/qadevOOo/tests/java/ifc/chart/_ChartDataPointProperties.java
new file mode 100644
index 000000000000..3b2892e238b1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartDataPointProperties.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartDataPointProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import lib.Status;
+import lib.StatusException;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.chart.ChartDataPointProperties</code>
+* service properties :
+* <ul>
+* <li><code> DataCaption</code></li>
+* <li><code> SymbolType</code></li>
+* <li><code> SymbolBitmapURL</code></li>
+* </ul> <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code>poliball.gif</code> :
+* for test of property 'SymbolBitmapURL' </li>
+* <ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* <li> <code>'LINE'</code> (of type <code>XDiagram</code>):
+* relation that use as parameter for method setDiagram of chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartDataPointProperties
+*/
+public class _ChartDataPointProperties extends MultiPropertyTest {
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to LineDiagram");
+ XChartDocument doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ XDiagram Line = (XDiagram) tEnv.getObjRelation("LINE");
+ if (Line == null) throw new StatusException(Status.failed
+ ("Relation 'LINE' not found"));
+
+ doc.setDiagram(Line);
+ }
+
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ return utils.getFullTestURL("poliball.gif");
+ }
+ };
+
+ /**
+ * Tests property 'SymbolBitmapURL' using file <code>polibal.gif</code>.
+ */
+ public void _SymbolBitmapURL() {
+ try {
+ oObj.setPropertyValue(
+ "SymbolType",
+ new Integer(com.sun.star.chart.ChartSymbolType.BITMAPURL) );
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ }
+
+ testProperty("SymbolBitmapURL", URLTester);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartDataRowProperties.java b/qadevOOo/tests/java/ifc/chart/_ChartDataRowProperties.java
new file mode 100644
index 000000000000..9c3e5a07a720
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartDataRowProperties.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartDataRowProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.chart.ChartDataRowProperties</code>
+* service properties :
+* <ul>
+* <li><code> Axis</code></li>
+* <li><code> DataErrorProperties</code></li>
+* <li><code> DataMeanValueProperties</code></li>
+* <li><code> DataRegressionProperties</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartDataRowProperties
+*/
+public class _ChartDataRowProperties extends MultiPropertyTest {
+
+ public void _Axis() {
+ try {
+ Integer axis = (Integer) oObj.getPropertyValue("Axis");
+ int newValue;
+ if (axis.intValue()==2) {
+ newValue = 4;
+ } else {
+ newValue = 2;
+ }
+ oObj.setPropertyValue("Axis", new Integer(newValue));
+ axis = (Integer) oObj.getPropertyValue("Axis");
+ tRes.tested("Axis",axis.intValue()==newValue);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ tRes.tested("Axis",false);
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartDocument.java b/qadevOOo/tests/java/ifc/chart/_ChartDocument.java
new file mode 100644
index 000000000000..19c12fb876ac
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartDocument.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.chart.ChartDocument</code>
+* service properties :
+* <ul>
+* <li><code> HasLegend</code></li>
+* <li><code> HasMainTitle</code></li>
+* <li><code> HasSubTitle</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartDocument
+*/
+public class _ChartDocument extends MultiPropertyTest {
+}
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartLegend.java b/qadevOOo/tests/java/ifc/chart/_ChartLegend.java
new file mode 100644
index 000000000000..61311d9415b0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartLegend.java
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartLegend.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.chart.ChartLegend</code>
+* service properties :
+* <ul>
+* <li><code> Alignment</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartLegend
+*/
+public class _ChartLegend extends MultiPropertyTest {
+}
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartStatistics.java b/qadevOOo/tests/java/ifc/chart/_ChartStatistics.java
new file mode 100644
index 000000000000..6571751da86e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartStatistics.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartStatistics.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.ChartStatistics</code>
+* service properties :
+* <ul>
+* <li><code> RegressionCurves</code></li>
+* <li><code> ConstantErrorLow</code></li>
+* <li><code> ConstantErrorHigh</code></li>
+* <li><code> MeanValue</code></li>
+* <li><code> ErrorCategory</code></li>
+* <li><code> PercentageError</code></li>
+* <li><code> ErrorMargin</code></li>
+* <li><code> ErrorIndicator</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartStatistics
+*/
+public class _ChartStatistics extends MultiPropertyTest {
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to LineDiagram");
+ XChartDocument doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartTableAddressSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartTableAddressSupplier.java
new file mode 100644
index 000000000000..124af33e77a5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartTableAddressSupplier.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartTableAddressSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.chart.ChartSeriesAddress;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.chart.ChartTableAddressSupplier</code>
+* service properties :
+* <ul>
+* <li><code> CategoriesRangeAddress</code></li>
+* <li><code> SeriesAddresses</code></li>
+* <li><code> MainTitleAddress</code></li>
+* <li><code> SubTitleAddress</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartTableAddressSupplier
+*/
+public class _ChartTableAddressSupplier extends MultiPropertyTest {
+
+ /**
+ * Tests property 'SeriesAddresses'.
+ */
+ public void _SeriesAddresses() {
+ testProperty("SeriesAddresses", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ ChartSeriesAddress[] addr = (ChartSeriesAddress[]) oldValue ;
+ ChartSeriesAddress[] newAddr = null ;
+ if (addr.length > 1) {
+ newAddr = new ChartSeriesAddress[addr.length - 1] ;
+ System.arraycopy(addr, 0, newAddr, 0, addr.length - 1) ;
+ } else {
+ newAddr = addr ;
+ }
+
+ return newAddr ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartTitle.java b/qadevOOo/tests/java/ifc/chart/_ChartTitle.java
new file mode 100644
index 000000000000..a97b083784cb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartTitle.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartTitle.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.ValueChanger;
+
+/**
+* Testing <code>com.sun.star.chart.ChartTitle</code>
+* service properties :
+* <ul>
+* <li><code> TextRotation</code></li>
+* <li><code> String</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartTitle
+*/
+public class _ChartTitle extends MultiPropertyTest {
+
+ /**
+ * Tests property 'TextRotation'.
+ */
+ public void _TextRotation() {
+ testProperty("TextRotation", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ Object ValueToSet = ValueChanger.changePValue(oldValue);
+ int ro = ((Integer) ValueToSet).intValue() * 100;
+ return new Integer( ro );
+ }
+ } );
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisXSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisXSupplier.java
new file mode 100644
index 000000000000..0982974602a6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisXSupplier.java
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartTwoAxisXSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.ChartTwoAxisXSupplier</code>
+* service properties :
+* <ul>
+* <li><code> HasSecondaryXAxis</code></li>
+* <li><code> HasSecondaryXAxisDescription</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* <li> <code>'BAR'</code> (of type <code>XDiagram</code>):
+* relation that use as parameter for method setDiagram of chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartTwoAxisXSupplier
+*/
+public class _ChartTwoAxisXSupplier extends MultiPropertyTest {
+
+ XChartDocument doc = null;
+ XDiagram oldDiagram = null;
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to BarDiagram");
+ doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ XDiagram bar = (XDiagram) tEnv.getObjRelation("BAR");
+ if (bar == null) throw new StatusException(Status.failed
+ ("Relation 'BAR' not found"));
+
+ oldDiagram = doc.getDiagram();
+
+ doc.setDiagram(bar);
+ log.println("Set it to 3D");
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ try {
+ oObj.setPropertyValue("Dim3D", new Boolean(true));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ }
+ }
+
+ /**
+ * Sets the old diagram for a chart document.
+ */
+ protected void after() {
+ doc.setDiagram(oldDiagram);
+ }
+} // EOF ChartTwoAxisXSupplier
+
diff --git a/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisYSupplier.java b/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisYSupplier.java
new file mode 100644
index 000000000000..0f1f5cf10344
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_ChartTwoAxisYSupplier.java
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ChartTwoAxisYSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.ChartTwoAxisYSupplier</code>
+* service properties :
+* <ul>
+* <li><code> HasSecondaryYAxis</code></li>
+* <li><code> HasSecondaryYAxisDescription</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* <li> <code>'BAR'</code> (of type <code>XDiagram</code>):
+* relation that use as parameter for method setDiagram of chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.ChartTwoAxisYSupplier
+*/
+public class _ChartTwoAxisYSupplier extends MultiPropertyTest {
+
+ XChartDocument doc = null;
+ XDiagram oldDiagram = null;
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to BarDiagram");
+ doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ XDiagram bar = (XDiagram) tEnv.getObjRelation("BAR");
+ if (bar == null) throw new StatusException(Status.failed
+ ("Relation 'BAR' not found"));
+
+ oldDiagram = doc.getDiagram();
+
+ doc.setDiagram(bar);
+ log.println("Set it to 3D");
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ try {
+ oObj.setPropertyValue("Dim3D", new Boolean(true));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ }
+ }
+
+ /**
+ * Sets the old diagram for a chart document.
+ */
+ protected void after() {
+ doc.setDiagram(oldDiagram);
+ }
+} // EOF ChartTwoAxisYSupplier
+
diff --git a/qadevOOo/tests/java/ifc/chart/_Diagram.java b/qadevOOo/tests/java/ifc/chart/_Diagram.java
new file mode 100644
index 000000000000..b3bffc1425db
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_Diagram.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Diagram.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.Diagram</code>
+* service properties :
+* <ul>
+* <li><code> DataCaption</code></li>
+* <li><code> DataRowSource</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.Diagram
+*/
+public class _Diagram extends MultiPropertyTest {
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to LineDiagram");
+ XChartDocument doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/chart/_Dim3DDiagram.java b/qadevOOo/tests/java/ifc/chart/_Dim3DDiagram.java
new file mode 100644
index 000000000000..34395ff89164
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_Dim3DDiagram.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Dim3DDiagram.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.Dim3DDiagram</code>
+* service properties :
+* <ul>
+* <li><code> Dim3D</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.Dim3DDiagram
+*/
+public class _Dim3DDiagram extends MultiPropertyTest {
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to LineDiagram");
+ XChartDocument doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ }
+} // EOF Dim3DDiagram
+
diff --git a/qadevOOo/tests/java/ifc/chart/_LineDiagram.java b/qadevOOo/tests/java/ifc/chart/_LineDiagram.java
new file mode 100644
index 000000000000..684ba038f1b0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_LineDiagram.java
@@ -0,0 +1,228 @@
+/*************************************************************************
+ *
+ * $RCSfile: _LineDiagram.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.LineDiagram</code>
+* service properties :
+* <ul>
+* <li><code> SymbolType</code></li>
+* <li><code> SymbolSize</code></li>
+* <li><code> SymbolBitmapURL</code></li>
+* <li><code> Lines</code></li>
+* <li><code> SplineType</code></li>
+* </ul> <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code>poliball.gif</code> :
+* for test of property 'SymbolBitmapURL' </li>
+* <li> <code>crazy-blue.jpg</code> :
+* for test of property 'SymbolBitmapURL' </li>
+* <ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* <li> <code>'LINE'</code> (of type <code>XDiagram</code>):
+* relation that use as parameter for method setDiagram of chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.LineDiagram
+*/
+public class _LineDiagram extends MultiPropertyTest {
+
+ XChartDocument doc = null;
+ XDiagram oldDiagram = null;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to LineDiagram");
+ doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ XDiagram Line = (XDiagram) tEnv.getObjRelation("LINE");
+ if (Line == null) throw new StatusException(Status.failed
+ ("Relation 'LINE' not found"));
+
+ oldDiagram = doc.getDiagram();
+ doc.setDiagram(Line);
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ }
+
+ /**
+ * Sets the old diagram for a chart document.
+ */
+ protected void after() {
+ doc.setDiagram(oldDiagram);
+ }
+
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(util.utils.getFullTestURL("poliball.gif")))
+ return util.utils.getFullTestURL("crazy-blue.jpg"); else
+ return util.utils.getFullTestURL("poliball.gif");
+ }
+ } ;
+
+ protected PropertyTester SymbolTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+
+ int a = com.sun.star.chart.ChartSymbolType.AUTO;
+ int b = com.sun.star.chart.ChartSymbolType.NONE;
+ if ( ((Integer) oldValue).intValue() == a)
+ return new Integer(b); else
+ return new Integer(a);
+ }
+ } ;
+
+ protected PropertyTester SplineTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+
+ int a = 0;
+ int b = 2;
+ if ( ((Integer) oldValue).intValue() == a)
+ return new Integer(b); else
+ return new Integer(a);
+ }
+ } ;
+
+ /**
+ * Tests property 'SymbolType'.
+ */
+ public void _SymbolType() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("SymbolType", SymbolTester) ;
+ try {
+ oObj.setPropertyValue("SymbolType",new Integer(-2));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ }
+ }
+
+ /**
+ * Tests property 'SplineType'.
+ */
+ public void _SplineType() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("SplineType", SplineTester) ;
+ }
+
+ /**
+ * Tests property 'SymbolBitmapURL'.
+ */
+ public void _SymbolBitmapURL() {
+ log.println("Testing with custom Property tester") ;
+ try {
+ oObj.setPropertyValue("SymbolType",
+ new Integer(com.sun.star.chart.ChartSymbolType.BITMAPURL));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while set property value");
+ e.printStackTrace(log);
+ throw new StatusException("Exception while set property value", e);
+ }
+
+ testProperty("SymbolBitmapURL", URLTester) ;
+ }
+} // EOF LineDiagram
+
diff --git a/qadevOOo/tests/java/ifc/chart/_StackableDiagram.java b/qadevOOo/tests/java/ifc/chart/_StackableDiagram.java
new file mode 100644
index 000000000000..5a3a58a47f2c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_StackableDiagram.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * $RCSfile: _StackableDiagram.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.StackableDiagram</code>
+* service properties :
+* <ul>
+* <li><code> Percent</code></li>
+* <li><code> Stacked</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* <li> <code>'STACK'</code> (of type <code>XDiagram</code>):
+* relation that use as parameter for method setDiagram of chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.StackableDiagram
+*/
+public class _StackableDiagram extends MultiPropertyTest {
+
+ XChartDocument doc = null;
+ XDiagram oldDiagram = null;
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to LineDiagram");
+ doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ XDiagram stack = (XDiagram) tEnv.getObjRelation("STACK");
+ if (stack == null) throw new StatusException(Status.failed
+ ("Relation 'STACK' not found"));
+
+ oldDiagram = doc.getDiagram();
+
+ doc.setDiagram(stack);
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, doc.getDiagram() );
+ }
+
+ /**
+ * Sets the old diagram for a chart document.
+ */
+ protected void after() {
+ doc.setDiagram(oldDiagram);
+ }
+
+} // EOF StackableDiagram
+
diff --git a/qadevOOo/tests/java/ifc/chart/_StockDiagram.java b/qadevOOo/tests/java/ifc/chart/_StockDiagram.java
new file mode 100644
index 000000000000..a0e91c85627e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_StockDiagram.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: _StockDiagram.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.StockDiagram</code>
+* service properties :
+* <ul>
+* <li><code> Volume</code></li>
+* <li><code> UpDown</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CHARTDOC'</code> (of type <code>XChartDocument</code>):
+* to have reference to chart document </li>
+* <li> <code>'STOCK'</code> (of type <code>XDiagram</code>):
+* relation that use as parameter for method setDiagram of chart document </li>
+* </ul> <p>
+* @see com.sun.star.chart.StockDiagram
+*/
+public class _StockDiagram extends MultiPropertyTest {
+
+ XDiagram oldDiagram = null;
+ XChartDocument doc = null;
+
+ /**
+ * Retrieves object relations and prepares a chart document.
+ * @throws StatusException if one of relations not found.
+ */
+ protected void before() {
+ log.println("Setting Diagram type to StockDiagram");
+ doc = (XChartDocument) tEnv.getObjRelation("CHARTDOC");
+ if (doc == null) throw new StatusException(Status.failed
+ ("Relation 'CHARTDOC' not found"));
+
+ XDiagram stock = (XDiagram) tEnv.getObjRelation("STOCK");
+ if (stock == null) throw new StatusException(Status.failed
+ ("Relation 'STOCK' not found"));
+
+ oldDiagram = doc.getDiagram();
+ doc.setDiagram(stock);
+ oObj = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, doc.getDiagram());
+ }
+
+ /**
+ * Sets the old diagram for a chart document.
+ */
+ protected void after() {
+ doc.setDiagram(oldDiagram);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/chart/_X3DDisplay.java b/qadevOOo/tests/java/ifc/chart/_X3DDisplay.java
new file mode 100644
index 000000000000..6d48e06a2f67
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_X3DDisplay.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: _X3DDisplay.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.X3DDisplay;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.chart.X3DDisplay</code>
+* interface methods :
+* <ul>
+* <li><code> getWall()</code></li>
+* <li><code> getFloor()</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.X3DDisplay
+*/
+public class _X3DDisplay extends MultiMethodTest {
+
+ public X3DDisplay oObj = null;
+ boolean result = true;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value that isn't null. <p>
+ */
+ public void _getWall() {
+ result = true;
+
+ XPropertySet Wall = oObj.getWall();
+ result = (Wall != null);
+
+ tRes.tested("getWall()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value that isn't null. <p>
+ */
+ public void _getFloor() {
+ result = true;
+
+ XPropertySet Floor = oObj.getWall();
+ result = (Floor != null);
+
+ tRes.tested("getFloor()", result);
+ }
+
+} // EOF X3DDisplay
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XAxisXSupplier.java b/qadevOOo/tests/java/ifc/chart/_XAxisXSupplier.java
new file mode 100644
index 000000000000..2bafac5d5c8d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XAxisXSupplier.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAxisXSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XAxisXSupplier;
+import com.sun.star.drawing.XShape;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.chart.XAxisXSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getXMainGrid()</code></li>
+* <li><code> getXAxisTitle()</code></li>
+* <li><code> getXAxis()</code></li>
+* <li><code> getXHelpGrid()</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.XAxisXSupplier
+*/
+public class _XAxisXSupplier extends MultiMethodTest {
+
+ public XAxisXSupplier oObj = null;
+ boolean result = true;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value that isn't null. <p>
+ */
+ public void _getXMainGrid() {
+ result = true;
+
+ XPropertySet MGrid = oObj.getXMainGrid();
+ result = (MGrid != null);
+
+ tRes.tested("getXMainGrid()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value that isn't null. <p>
+ */
+ public void _getXAxisTitle() {
+ result = true;
+
+ XShape title = oObj.getXAxisTitle();
+ result = (title != null);
+
+ tRes.tested("getXAxisTitle()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value that isn't null. <p>
+ */
+ public void _getXAxis() {
+ result = true;
+
+ XPropertySet axis = oObj.getXAxis();
+ result = (axis != null);
+
+ tRes.tested("getXAxis()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value that isn't null. <p>
+ */
+ public void _getXHelpGrid() {
+ result = true;
+
+ XPropertySet HGrid = oObj.getXHelpGrid();
+ result = (HGrid != null);
+
+ tRes.tested("getXHelpGrid()", result);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XAxisYSupplier.java b/qadevOOo/tests/java/ifc/chart/_XAxisYSupplier.java
new file mode 100644
index 000000000000..5d838dd21288
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XAxisYSupplier.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAxisYSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XAxisYSupplier;
+import com.sun.star.drawing.XShape;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.chart.XAxisYSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getYMainGrid()</code></li>
+* <li><code> getYAxisTitle()</code></li>
+* <li><code> getYAxis()</code></li>
+* <li><code> getYHelpGrid()</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.XAxisYSupplier
+*/
+public class _XAxisYSupplier extends MultiMethodTest {
+
+ public XAxisYSupplier oObj = null;
+ boolean result = true;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if the method returns
+ * value that isn't null. <p>
+ */
+ public void _getYMainGrid() {
+ result = true;
+
+ XPropertySet MGrid = oObj.getYMainGrid();
+ result = (MGrid != null);
+
+ tRes.tested("getYMainGrid()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if the method returns
+ * value that isn't null. <p>
+ */
+ public void _getYAxisTitle() {
+ result = true;
+
+ XShape title = oObj.getYAxisTitle();
+ result = (title != null);
+
+ tRes.tested("getYAxisTitle()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if the method returns
+ * value that isn't null. <p>
+ */
+ public void _getYAxis() {
+ result = true;
+
+ XPropertySet axis = oObj.getYAxis();
+ result = (axis != null);
+
+ tRes.tested("getYAxis()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if the method returns
+ * value that isn't null. <p>
+ */
+ public void _getYHelpGrid() {
+ result = true;
+
+ XPropertySet HGrid = oObj.getYHelpGrid();
+ result = (HGrid != null);
+
+ tRes.tested("getYHelpGrid()", result);
+ }
+} // EOF XAxisYSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XAxisZSupplier.java b/qadevOOo/tests/java/ifc/chart/_XAxisZSupplier.java
new file mode 100644
index 000000000000..acaf88d32ba5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XAxisZSupplier.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAxisZSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XAxisZSupplier;
+import com.sun.star.drawing.XShape;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.chart.XAxisZSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getZMainGrid()</code></li>
+* <li><code> getZAxisTitle()</code></li>
+* <li><code> getZAxis()</code></li>
+* <li><code> getZHelpGrid()</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.XAxisZSupplier
+*/
+public class _XAxisZSupplier extends MultiMethodTest {
+ public XAxisZSupplier oObj = null;
+ boolean result = true;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if the method returns
+ * value that isn't null. <p>
+ */
+ public void _getZMainGrid() {
+ result = true;
+
+ XPropertySet MGrid = oObj.getZMainGrid();
+ result = (MGrid != null);
+
+ tRes.tested("getZMainGrid()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if the method returns
+ * value that isn't null. <p>
+ */
+ public void _getZAxisTitle() {
+ result = true;
+
+ XShape title = oObj.getZAxisTitle();
+ result = (title != null);
+
+ tRes.tested("getZAxisTitle()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if the method returns
+ * value that isn't null. <p>
+ */
+ public void _getZAxis() {
+ result = true;
+
+ XPropertySet axis = oObj.getZAxis();
+ result = (axis != null);
+
+ tRes.tested("getZAxis()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if the method returns
+ * value that isn't null. <p>
+ */
+ public void _getZHelpGrid() {
+ result = true;
+
+ XPropertySet HGrid = oObj.getZHelpGrid();
+ result = (HGrid != null);
+
+ tRes.tested("getZHelpGrid()", result);
+ }
+
+} // EOF XAxisZSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XChartData.java b/qadevOOo/tests/java/ifc/chart/_XChartData.java
new file mode 100644
index 000000000000..282a462e7a00
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XChartData.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XChartData.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.chart.ChartDataChangeEvent;
+import com.sun.star.chart.XChartData;
+import com.sun.star.chart.XChartDataArray;
+import com.sun.star.chart.XChartDataChangeEventListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.chart.XChartData</code>
+* interface methods :
+* <ul>
+* <li><code> addChartDataChangeEventListener()</code></li>
+* <li><code> removeChartDataChangeEventListener()</code></li>
+* <li><code> getNotANumber()</code></li>
+* <li><code> isNotANumber()</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.XChartData
+*/
+public class _XChartData extends MultiMethodTest {
+
+ public XChartData oObj = null;
+ boolean result = true;
+ double nan = 0;
+ XChartDataArray dataArray = null;
+
+ boolean dataChanged[] = new boolean[2];
+
+ class MyEventListener implements XChartDataChangeEventListener {
+ public void disposing ( EventObject oEvent ) {
+ System.out.println("Listener1 disposed");
+ }
+ public void chartDataChanged(ChartDataChangeEvent ev) {
+ dataChanged[0] = true;
+ }
+ }
+
+ class MyEventListener2 implements XChartDataChangeEventListener {
+ public void disposing ( EventObject oEvent ) {
+ System.out.println("Listener2 disposed");
+ }
+ public void chartDataChanged(ChartDataChangeEvent ev) {
+ dataChanged[1] = true;
+ }
+ }
+
+ XChartDataChangeEventListener listener1 = new MyEventListener();
+ XChartDataChangeEventListener listener2 = new MyEventListener2();
+
+ /**
+ * Test calls the method adding two listeners and then changes data. <p>
+ * Has <b> OK </b> status if after data were changed
+ * listeners were called. <p>
+ */
+ public void _addChartDataChangeEventListener() {
+ dataChanged[0] = false;
+ dataChanged[1] = false;
+
+ oObj.addChartDataChangeEventListener( listener1 );
+ oObj.addChartDataChangeEventListener( listener2 );
+
+ dataArray = (XChartDataArray)
+ UnoRuntime.queryInterface(XChartDataArray.class, oObj);
+ double data[][] = dataArray.getData();
+ data[0][0] += 0.1;
+ dataArray.setData(data);
+ if (!dataChanged[0]) log.println("ChartDataChangeEventListener1 "+
+ "isn't called after changing data");
+ if (!dataChanged[1]) log.println("ChartDataChangeEventListener2 "+
+ "isn't called after changing data");
+ tRes.tested("addChartDataChangeEventListener()",
+ dataChanged[0] && dataChanged[1]);
+ }
+
+ /**
+ * Test calls the method for one listener, changes data,
+ * calls the method for other listener and again changes data. <p>
+ * Has <b> OK </b> status if listener is not called after removing. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>addChartDataChangeEventListener</code> : to have listeners
+ * that must be removed by the method </li>
+ * </ul>
+ */
+ public void _removeChartDataChangeEventListener() {
+ requiredMethod("addChartDataChangeEventListener()");
+
+ dataChanged[0] = false;
+ dataChanged[1] = false;
+
+ oObj.removeChartDataChangeEventListener( listener1 );
+ dataArray = (XChartDataArray)
+ UnoRuntime.queryInterface(XChartDataArray.class, oObj);
+ double data[][] = dataArray.getData();
+ data[0][0] += 0.1;
+ dataArray.setData(data);
+ oObj.removeChartDataChangeEventListener( listener2 );
+ if (dataChanged[0]) log.println("ChartDataChangeEventListener1 is "+
+ "called after removing listener");
+ tRes.tested("removeChartDataChangeEventListener()",
+ ((!dataChanged[0]) && (dataChanged[1])));
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if the return value isn't equal to 1. <p>
+ */
+ public void _getNotANumber() {
+ result = true;
+
+ nan = oObj.getNotANumber();
+ log.println("Current NotANumber is " + nan);
+ result = nan!=1;
+
+ tRes.tested("getNotANumber()", result);
+ }
+
+ /**
+ * Test calls the method with NAN value and with non NAN value. <p>
+ * Has <b> OK </b> status if the method returns true for NAN value and
+ * returns false for other value<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>getNotANumber</code> : to have the current NAN value </li>
+ * </ul>
+ */
+ public void _isNotANumber() {
+ requiredMethod("getNotANumber()");
+ result = true;
+
+ result = (oObj.isNotANumber(nan) && !oObj.isNotANumber(nan + 1));
+
+ tRes.tested("isNotANumber()", result);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java b/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java
new file mode 100644
index 000000000000..d5b0531f63a3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java
@@ -0,0 +1,234 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XChartDataArray.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.chart.XChartDataArray;
+import lib.MultiMethodTest;
+import lib.StatusException;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.chart.XChartDataArray</code>
+* interface methods :
+* <ul>
+* <li><code> getColumnDescriptions()</code></li>
+* <li><code> getData()</code></li>
+* <li><code> getRowDescriptions()</code></li>
+* <li><code> setColumnDescriptions()</code></li>
+* <li><code> setData()</code></li>
+* <li><code> setRowDescriptions()</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.XChartDataArray
+*/
+public class _XChartDataArray extends MultiMethodTest {
+
+ public XChartDataArray oObj = null;
+ boolean bResult = true;
+ String[] colDscs = new String[3];
+ String[] rowDscs = new String[3];
+ double[][] data = null;
+
+ /**
+ * Test calls the method and restores new values. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setColumnDescriptions() {
+ bResult = true;
+
+ colDscs = oObj.getColumnDescriptions();
+ Object crdesc = tEnv.getObjRelation("CRDESC");
+ if (crdesc != null) {
+ log.println(crdesc);
+ throw new StatusException(Status.skipped(true));
+ }
+ for (int i = 0; i < colDscs.length; i++) {
+ colDscs[i] = "Col" + i;
+ }
+ oObj.setColumnDescriptions(colDscs);
+
+ tRes.tested("setColumnDescriptions()", bResult);
+ }
+
+ /**
+ * Test calls the method and restores new values. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setColumnDescriptions </code></li>
+ * </ul>
+ */
+ public void _setRowDescriptions() {
+ bResult = true;
+
+ rowDscs = oObj.getRowDescriptions();
+ Object crdesc = tEnv.getObjRelation("CRDESC");
+ if (crdesc != null) {
+ log.println(crdesc);
+ throw new StatusException(Status.skipped(true));
+ }
+ for (int i = 0; i < rowDscs.length; i++) {
+ rowDscs[i] = "Row" + i;
+ }
+ oObj.setRowDescriptions(rowDscs);
+
+ tRes.tested("setRowDescriptions()", bResult);
+ }
+
+ /**
+ * Test calls the method and restores new values. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setRowDescriptions </code></li>
+ * </ul>
+ */
+ public void _setData() {
+ rowDscs = oObj.getRowDescriptions();
+ colDscs = oObj.getColumnDescriptions();
+
+ bResult = true;
+ double[][] _data = oObj.getData();
+ data = _data;
+
+ for (int i = 0; i < rowDscs.length; i++) {
+ for (int j = 0; j < colDscs.length; j++)
+ data[i][j] = i * (j + 1);
+ }
+ oObj.setData(data);
+
+ tRes.tested("setData()", bResult);
+ }
+
+ /**
+ * Test calls the method and compare returned values with values restored
+ * after method <code>setColumnDescriptions</code>. <p>
+ * Has <b> OK </b> status if the returned values equils to restored values. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setData </code> : to set and restore new values </li>
+ * </ul>
+ */
+ public void _getColumnDescriptions() {
+ requiredMethod("setColumnDescriptions()");
+ bResult = true;
+
+ String[] dscs = oObj.getColumnDescriptions();
+ bResult &= dscs.length == colDscs.length;
+ if (bResult) {
+ for (int i = 0; i < dscs.length; i++) {
+ bResult &= dscs[i].equals(colDscs[i]);
+ }
+ }
+
+ tRes.tested("getColumnDescriptions()", bResult);
+ }
+
+ /**
+ * Test calls the method and compare returned values with values restored
+ * after method <code>setRowDescriptions</code>. <p>
+ * Has <b> OK </b> status if the returned values equils to restored values. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setData </code> : to set and restore new values </li>
+ * </ul>
+ */
+ public void _getRowDescriptions() {
+ requiredMethod("setRowDescriptions()");
+ bResult = true;
+
+ String[] dscs = oObj.getRowDescriptions();
+ bResult &= dscs.length == rowDscs.length;
+ if (bResult) {
+ for (int i = 0; i < dscs.length; i++) {
+ bResult &= dscs[i].equals(rowDscs[i]);
+ }
+ }
+
+ tRes.tested("getRowDescriptions()", bResult);
+ }
+
+ /**
+ * Test calls the method and compare returned values with values restored
+ * after method <code>setData</code>. <p>
+ * Has <b> OK </b> status if the returned values equils to restored values. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setData </code> : to set and restore new values </li>
+ * </ul>
+ */
+ public void _getData() {
+ requiredMethod("setData()");
+ bResult = true;
+
+ double[][] _data = oObj.getData();
+ data = _data;
+ for (int i = 0; i < rowDscs.length; i++) {
+ for (int j = 0; j < colDscs.length; j++) {
+ bResult &= data[i][j] == _data[i][j];
+ }
+ }
+
+ tRes.tested("getData()", bResult);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XChartDocument.java b/qadevOOo/tests/java/ifc/chart/_XChartDocument.java
new file mode 100644
index 000000000000..27be840665c3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XChartDocument.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XChartDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartData;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.drawing.XShape;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.chart.XChartDocument</code>
+* interface methods :
+* <ul>
+* <li><code> getTitle()</code></li>
+* <li><code> getSubTitle()</code></li>
+* <li><code> getLegend()</code></li>
+* <li><code> getArea()</code></li>
+* <li><code> getDiagram()</code></li>
+* <li><code> setDiagram()</code></li>
+* <li><code> getData()</code></li>
+* <li><code> attachData()</code></li>
+* </ul> <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DIAGRAM'</code> (of type <code>XDiagram</code>):
+* is used as parameter for method <code>setDiagram</code> </li>
+* <li> <code>'CHARTDATA'</code> (of type <code>XChartData</code>):
+* is used as parameter for method <code>attachData</code> </li>
+* </ul>
+*
+* @see com.sun.star.chart.XChartDocument
+*/
+public class _XChartDocument extends MultiMethodTest {
+
+ public XChartDocument oObj = null;
+ boolean result = true;
+ XDiagram diagram = null;
+ XChartData ChartData = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getTitle() {
+ XShape title = oObj.getTitle();
+ tRes.tested("getTitle()", title != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getSubTitle() {
+ XShape subtitle = oObj.getSubTitle();
+ tRes.tested("getSubTitle()", subtitle != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getLegend() {
+ XShape legend = oObj.getLegend();
+ tRes.tested("getLegend()", legend != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getArea() {
+ XPropertySet area = oObj.getArea();
+ tRes.tested("getArea()", area != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getDiagram() {
+ diagram = oObj.getDiagram();
+ tRes.tested("getDiagram()", diagram != null);
+ }
+
+ /**
+ * Test compares type of diagram before method call and after.<p>
+ * Has <b> OK </b> status if diagram types are not equal. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDiagram </code> : to have diagram before method call</li>
+ * </ul>
+ *
+ * @see com.sun.star.chart.XDiagram
+ */
+ public void _setDiagram() {
+ requiredMethod("getDiagram()");
+ String oldType = diagram.getDiagramType();
+ XDiagram diag = (XDiagram)tEnv.getObjRelation("DIAGRAM");
+ oObj.setDiagram(diag);
+ String newType = oObj.getDiagram().getDiagramType();
+ tRes.tested("setDiagram()", !(oldType.equals(newType)));
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getData() {
+ ChartData = oObj.getData();
+ tRes.tested("getData()", ChartData != null);
+ }
+
+ /**
+ * Test compares data before method call and after. <p>
+ * Has <b> OK </b> status if the data before method call and
+ * after are not equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getData </code> : to have data before method call </li>
+ * </ul>
+ * @see com.sun.star.chart.XChartData
+ */
+ public void _attachData() {
+ requiredMethod("getData()");
+ XChartData data = (XChartData)tEnv.getObjRelation("CHARTDATA");
+ oObj.attachData(data);
+ XChartData newdata = oObj.getData();
+
+ tRes.tested("attachData()", !(newdata.equals(ChartData)));
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XDiagram.java b/qadevOOo/tests/java/ifc/chart/_XDiagram.java
new file mode 100644
index 000000000000..1dc17830d18a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XDiagram.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDiagram.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XDiagram;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.chart.XDiagram</code>
+* interface methods :
+* <ul>
+* <li><code> getDiagramType()</code></li>
+* <li><code> getDataRowProperties()</code></li>
+* <li><code> getDataPointProperties()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'ROWAMOUNT'</code> (of type <code>Integer</code>):
+* to have amount of rows </li>
+* <li> <code>'COLAMOUNT'</code> (of type <code>Integer</code>):
+* to have amount of columns </li>
+* <ul> <p>
+* @see com.sun.star.chart.XDiagram
+*/
+public class _XDiagram extends MultiMethodTest {
+
+ public XDiagram oObj = null;
+ boolean result = true;
+ Integer rowamount = null;
+ Integer colamount = null;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ rowamount = (Integer)tEnv.getObjRelation("ROWAMOUNT");
+ if (rowamount == null) throw new StatusException(Status.failed
+ ("Relation 'ROWAMOUNT' not found"));
+
+ colamount = (Integer)tEnv.getObjRelation("COLAMOUNT");
+ if (colamount == null) throw new StatusException(Status.failed
+ ("Relation 'COLAMOUNT' not found"));
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value start from 'com.sun.star.chart.' <p>
+ */
+ public void _getDiagramType() {
+ result = true;
+
+ String stype = oObj.getDiagramType();
+ log.println("Current Diagram Type is " + stype);
+ result = (stype.startsWith("com.sun.star.chart."));
+
+ tRes.tested("getDiagramType()", result);
+ }
+
+ /**
+ * Test calls the method for every row and checks returned value. <p>
+ * Has <b> OK </b> status if returned value for every row isn't null and
+ * no exceptions were thrown. <p>
+ */
+ public void _getDataRowProperties() {
+ result = true;
+
+ int rows = rowamount.intValue();
+ rows -= 1;
+ XPropertySet props = null;
+
+ log.println("There are " + rows + " rows.");
+ try {
+ for (int i = 0; i < rows; i++) {
+ props = oObj.getDataRowProperties(i);
+ if (props != null) {
+ log.println("Row " + i + " - OK");
+ } else {
+ log.println("Row " + i + " - FAILED");
+ result = false;
+ }
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception while get data row properties");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("getDataRowProperties()", result);
+ }
+
+ /**
+ * Test calls the method for every point and checks returned value. <p>
+ * Has <b> OK </b> status if returned value for every point isn't null and
+ * no exceptions were thrown. <p>
+ */
+ public void _getDataPointProperties() {
+ result = true;
+
+ int rows = rowamount.intValue();
+ int cols = colamount.intValue();
+ XPropertySet props = null;
+
+ log.println("There are " + rows + " rows and " + cols + " cols.");
+
+ try {
+ for (int i = 0; i < rows; i++)
+ for (int j = 0; j < cols; j++) {
+ props = oObj.getDataPointProperties(i, j);
+ if (props != null) {
+ log.println("Row " + i + " Col " + j + " - OK");
+ } else {
+ log.println("Row " + i + " Col " + j + " - FAILED");
+ result = false;
+ }
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception while get data point properties");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("getDataPointProperties()", result);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XStatisticDisplay.java b/qadevOOo/tests/java/ifc/chart/_XStatisticDisplay.java
new file mode 100644
index 000000000000..e94e4dd0be4b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XStatisticDisplay.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XStatisticDisplay.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XStatisticDisplay;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.chart.XStatisticDisplay</code>
+* interface methods :
+* <ul>
+* <li><code> getMinMaxLine()</code></li>
+* <li><code> getUpBar()</code></li>
+* <li><code> getDownBar()</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.XStatisticDisplay
+*/
+public class _XStatisticDisplay extends MultiMethodTest {
+
+ public XStatisticDisplay oObj = null;
+ boolean result = true;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getMinMaxLine() {
+ result = true;
+
+ XPropertySet MinMaxLine = oObj.getMinMaxLine();
+ result = (MinMaxLine != null);
+
+ tRes.tested("getMinMaxLine()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getUpBar() {
+ result = true;
+
+ XPropertySet UpBar = oObj.getUpBar();
+ result = (UpBar != null);
+
+ tRes.tested("getUpBar()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getDownBar() {
+ result = true;
+
+ XPropertySet DownBar = oObj.getDownBar();
+ result = (DownBar != null);
+
+ tRes.tested("getDownBar()", result);
+ }
+
+} // EOF XStatisticDisplay
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XTwoAxisXSupplier.java b/qadevOOo/tests/java/ifc/chart/_XTwoAxisXSupplier.java
new file mode 100644
index 000000000000..b504fa1e1fbf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XTwoAxisXSupplier.java
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTwoAxisXSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XTwoAxisXSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.chart.XTwoAxisXSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getSecondaryXAxis()</code></li>
+* </ul> <p>
+* @see com.sun.star.chart.XTwoAxisXSupplier
+*/
+public class _XTwoAxisXSupplier extends MultiMethodTest {
+
+ public XTwoAxisXSupplier oObj = null;
+ boolean result = true;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getSecondaryXAxis() {
+ result = true;
+
+ XPropertySet SecXAxis = oObj.getSecondaryXAxis();
+ result = (SecXAxis != null);
+
+ tRes.tested("getSecondaryXAxis()", result);
+ }
+
+} // EOF XTwoAxisXSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/chart/_XTwoAxisYSupplier.java b/qadevOOo/tests/java/ifc/chart/_XTwoAxisYSupplier.java
new file mode 100644
index 000000000000..8caed2a6aac8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/chart/_XTwoAxisYSupplier.java
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTwoAxisYSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XTwoAxisYSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.chart.XTwoAxisYSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getSecondaryYAxis()</code></li>
+* </ul> <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.chart.XTwoAxisYSupplier
+*/
+public class _XTwoAxisYSupplier extends MultiMethodTest {
+
+ public XTwoAxisYSupplier oObj = null;
+ boolean result = true;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getSecondaryYAxis() {
+ result = true;
+
+ XPropertySet SecYAxis = oObj.getSecondaryYAxis();
+ result = (SecYAxis != null);
+
+ tRes.tested("getSecondaryYAxis()", result);
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+} // EOF XTwoAxisYSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/connection/_XAcceptor.java b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java
new file mode 100644
index 000000000000..f97fe1d02378
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java
@@ -0,0 +1,353 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAcceptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.connection;
+
+import com.sun.star.connection.XAcceptor;
+import com.sun.star.connection.XConnection;
+import com.sun.star.connection.XConnector;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Tests methods of <code>XAcceptor</code> interface. <p>
+* Required relations :
+* <ul>
+* <li> <code>'XAcceptor.connectStr'</code> : String variable. Has
+* the following format :
+* <code>'socket,host=<SOHost>,port=<UniquePort>' where <SOHost> is
+* the host where StarOffice is started. This string must be passed
+* as parameter to <code>accept()</code> method. </li>
+* <ul> <p>
+* This test <b>can not</b> be run in multiply threads.
+*/
+public class _XAcceptor extends MultiMethodTest {
+
+ protected PrintWriter log_ ;
+
+ /**
+ * 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 ;
+ /**
+ * 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) {
+ this.acc = acc ;
+ }
+
+ /**
+ * Call <code>accept()</code> method.
+ */
+ 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 ;
+ }
+ }
+ }
+
+ public XAcceptor oObj = null;
+ protected String connectString = null ;
+
+ /**
+ * Retrieves object relation.
+ */
+ public void before() throws StatusException {
+ connectString = (String)
+ tEnv.getObjRelation("XAcceptor.connectStr") ;
+
+ log_ = log ;
+
+ if (connectString == null)
+ throw new StatusException("No object relation found",
+ new NullPointerException()) ;
+ }
+
+ /**
+ * First part : Thread with acceptor created, and it starts listening.
+ * The main thread tries to connect to acceptor. Acception thread must
+ * return and valid connection must be returned by Acceptor. <p>
+ *
+ * Second part : Trying to create second acceptor which listen on
+ * the same port. Calling <code>accept()</code> method of the second
+ * Acceptor must rise appropriate exception. <p>
+ *
+ * Has OK status if both test parts executed properly.
+ */
+ public void _accept() {
+ boolean result = true ;
+ AcceptorThread acception = null,
+ dupAcception = null ;
+ XAcceptor dupAcceptor = null ;
+ XConnector xConnector = null ;
+
+ // creating services requierd
+ try {
+ Object oConnector = tParam.getMSF().createInstance
+ ("com.sun.star.connection.Connector") ;
+
+ xConnector = (XConnector) UnoRuntime.queryInterface
+ (XConnector.class, oConnector) ;
+
+ XInterface acceptor = (XInterface) tParam.getMSF().createInstance
+ ("com.sun.star.connection.Acceptor") ;
+
+ dupAcceptor = (XAcceptor) UnoRuntime.queryInterface
+ (XAcceptor.class, acceptor) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create service", e) ;
+ }
+
+ // Testing connection to the acceptor
+ try {
+ acception = new AcceptorThread(oObj) ;
+ acception.start() ;
+
+ try {
+ Thread.sleep(500);
+ }
+ catch (java.lang.InterruptedException e) {}
+
+ XConnection con = xConnector.connect(connectString) ;
+
+ if (con == null)
+ log.println("Connector returned : null") ;
+ else
+ log.println("Connector returned : " + con.getDescription()) ;
+
+ try {
+ acception.join(5 * 1000) ;
+ } catch(InterruptedException e) {}
+
+ if (acception.isAlive()) {
+
+ result = false ;
+ log.println("Method call haven't returned") ;
+
+ if (acception.acceptedCall == null)
+ log.println("Acceptor returned : null") ;
+ else
+ log.println("Acceptor returned : " +
+ acception.acceptedCall.getDescription()) ;
+ } else {
+ if (acception.ex != null) {
+ log.println("Exception occured in accept() thread :") ;
+ acception.ex.printStackTrace(log) ;
+ }
+
+ if (acception.acceptedCall == null)
+ log.println("Method returned : null") ;
+ else
+ log.println("Method returned : " +
+ acception.acceptedCall.getDescription()) ;
+
+ result &= acception.acceptedCall != null ;
+ }
+ } catch (com.sun.star.connection.ConnectionSetupException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.connection.NoConnectException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ } finally {
+ oObj.stopAccepting();
+ if (acception.isAlive()) {
+ acception.interrupt();
+ }
+ }
+
+ // duplicate acceptor test
+ // creating the additional acceptor which listens
+ // on the same port
+
+ log.println("___ Testing for accepting on the same port ...") ;
+
+ try {
+ dupAcception = new AcceptorThread(dupAcceptor) ;
+ dupAcception.start() ;
+
+ try {
+ dupAcception.join(1 * 1000) ;
+ } catch(InterruptedException e) {}
+
+
+ if (dupAcception.isAlive()) {
+ log.println("Duplicate acceptor is listening ...") ;
+
+ // now trying to accept on the same port as additional
+ // acceptor
+ acception = new AcceptorThread(oObj) ;
+ acception.start() ;
+
+ try {
+ acception.join(3 * 1000) ;
+ } catch(InterruptedException e) {}
+
+ if (acception.isAlive()) {
+ oObj.stopAccepting() ;
+ acception.interrupt() ;
+
+ log.println("Acceptor with the same port must cause"+
+ " an error but didn't") ;
+ result = false ;
+ } else {
+ log.println("Accepted call = " + acception.acceptedCall) ;
+ if (acception.ex == null) {
+ //result = false ;
+ log.println("No exception was thrown when trying"+
+ " to listen on the same port") ;
+ } else {
+ if (acception.ex instanceof
+ com.sun.star.connection.AlreadyAcceptingException ||
+ acception.ex instanceof
+ com.sun.star.connection.ConnectionSetupException) {
+
+ log.println("Rigth exception was thrown when trying"+
+ " to listen on the same port") ;
+ } else {
+ result = false ;
+ log.println("Wrong exception was thrown when trying"+
+ " to listen on the same port :") ;
+ acception.ex.printStackTrace(log) ;
+ }
+ }
+ }
+ }
+ } finally {
+ dupAcceptor.stopAccepting() ;
+ if (dupAcception.isAlive()) {
+ dupAcception.interrupt() ;
+ }
+ }
+
+ tRes.tested("accept()", result) ;
+ }
+
+ /**
+ * Starts thread with Acceptor and then calls <code>stopListening</code>
+ * method. <p>
+ * Has OK status if <code>accept</code> method successfully returns and
+ * rises no exceptions.
+ */
+ public void _stopAccepting() {
+ boolean result = true ;
+
+
+ AcceptorThread acception = new AcceptorThread(oObj) ;
+
+ acception.start() ;
+
+ oObj.stopAccepting() ;
+
+ try {
+ acception.join(3 * 1000) ;
+ } catch (InterruptedException e) {}
+
+ if (acception.isAlive()) {
+ acception.interrupt() ;
+
+ result = false ;
+ log.println("Method call haven't returned") ;
+
+ } else {
+ if (acception.ex != null) {
+ log.println("Exception occured in accept() thread :") ;
+ acception.ex.printStackTrace(log) ;
+ result = false ;
+ } else {
+ result = true ;
+ }
+
+ if (acception.acceptedCall == null)
+ log.println("accept() returned : null") ;
+ else
+ log.println("accept() returned : " +
+ acception.acceptedCall.getDescription()) ;
+ }
+
+ tRes.tested("stopAccepting()", result) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/connection/_XConnector.java b/qadevOOo/tests/java/ifc/connection/_XConnector.java
new file mode 100644
index 000000000000..55f565ec4fda
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/connection/_XConnector.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XConnector.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.connection;
+
+import com.sun.star.connection.XAcceptor;
+import com.sun.star.connection.XConnection;
+import com.sun.star.connection.XConnector;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Tests methods of <code>XConnector</code> interface. <p>
+* Required relations :
+* <ul>
+* <li> <code>'XConnector.connectStr'</code> : String variable. Has
+* the following format :
+* <code>'socket,host=<SOHost>,port=<UniquePort>' where <SOHost> is
+* the host where StarOffice is started. This string must be passed
+* as parameter to <code>accept()</code> method. </li>
+* <ul> <p>
+* This test <b>can not</b> be run in multiply threads.
+*/
+public class _XConnector extends MultiMethodTest {
+
+ /**
+ * 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 {
+ /**
+ * the acceptor
+ */
+ private XAcceptor acc = null ;
+ /**
+ * If exception occured during method call it is
+ * stored in this field.
+ */
+ public Exception ex = null ;
+ /**
+ * If method call returns some value it stores in this field.
+ */
+ public XConnection acceptedCall = null ;
+
+ /**
+ * Gets an object which can call <code>accept</code> method.
+ */
+ public AcceptorThread(XAcceptor acc) {
+ this.acc = acc ;
+ }
+
+ /**
+ * Call <code>accept()</code> method.
+ */
+ 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 ;
+ }
+ }
+ }
+
+ public XConnector oObj = null;
+ protected String connectString = null ;
+
+ /**
+ * Retrieves object relation.
+ */
+ public void before() throws StatusException {
+ connectString = (String)
+ tEnv.getObjRelation("XConnector.connectStr") ;
+ if (connectString == null)
+ throw new StatusException("No object relation found",
+ new NullPointerException()) ;
+ }
+
+ /**
+ * Thread with acceptor is created, and it starts listening.
+ * The main thread tries to connect to acceptor. Acception thread must
+ * return and a valid connection must be returned by Acceptor. <p>
+ *
+ */
+ public void _connect() {
+ boolean result = true ;
+ AcceptorThread acceptorThread = null;
+ XAcceptor xAcceptor = null ;
+ XConnector xConnector = null ;
+ XConnection aCon = null;
+ XInterface x = null;
+
+ // create the acceptor
+ try {
+ x = (XInterface) tParam.getMSF().createInstance
+ ("com.sun.star.connection.Acceptor") ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create service", e) ;
+ }
+
+ xAcceptor = (XAcceptor)UnoRuntime.queryInterface(XAcceptor.class, x);
+
+ acceptorThread = new AcceptorThread(xAcceptor) ;
+ acceptorThread.start() ;
+
+ try {
+ Thread.sleep(500);
+ }
+ catch (java.lang.InterruptedException e) {}
+
+ // connect to acceptor
+ try {
+ aCon = oObj.connect(connectString);
+
+ if (aCon == null)
+ log.println("Connector returned: null") ;
+ else
+ log.println("Connector returned: " + aCon.getDescription()) ;
+
+ try {
+ acceptorThread.join(30 * 1000) ;
+ } catch(InterruptedException e) {}
+
+ // connection not established
+ if (acceptorThread.isAlive()) {
+
+ result = false ;
+ log.println("Method call hasn't returned") ;
+
+ if (acceptorThread.acceptedCall == null)
+ log.println("Acceptor returned : null") ;
+ else
+ log.println("Acceptor returned : " +
+ acceptorThread.acceptedCall.getDescription()) ;
+ } else {
+ if (acceptorThread.ex != null) {
+ log.println("Exception occured in accept() thread :") ;
+ acceptorThread.ex.printStackTrace(log) ;
+ }
+
+ if (acceptorThread.acceptedCall == null)
+ log.println("Method returned : null") ;
+ else
+ log.println("Method returned : " +
+ acceptorThread.acceptedCall.getDescription()) ;
+
+ result &= acceptorThread.acceptedCall != null ;
+ }
+ } catch (com.sun.star.connection.ConnectionSetupException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.connection.NoConnectException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ } finally {
+ acceptorThread.acc.stopAccepting();
+ if (acceptorThread.isAlive()) {
+ acceptorThread.interrupt();
+ }
+ }
+
+ tRes.tested("connect()", result) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/container/_XChild.java b/qadevOOo/tests/java/ifc/container/_XChild.java
new file mode 100644
index 000000000000..0a1b62a295b4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XChild.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XChild.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XChild;
+import com.sun.star.container.XNamed;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/*
+* Testing <code>com.sun.star.container.XChild</code>
+* interface methods :
+* <ul>
+* <li><code> getParent()</code></li>
+* <li><code> setParent()</code></li>
+* </ul>
+* @see com.sun.star.container.XChild
+*/
+public class _XChild extends MultiMethodTest {
+
+ public XChild oObj = null;
+ public Object gotten = null;
+
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. Parent returned is stored.<p>
+ * Has <b> OK </b> status if the method returns not null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getParent() {
+ gotten = oObj.getParent();
+ XNamed the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class,gotten);
+ if (the_name != null)
+ log.println("Parent:"+the_name.getName());
+ tRes.tested("getParent()",gotten != null);
+ }
+
+ /**
+ * Sets existing parent and checks that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getParent() </code> : to get the parent. </li>
+ * </ul>
+ */
+ public void _setParent() {
+ requiredMethod("getParent()") ;
+
+ try {
+ oObj.setParent(gotten);
+ tRes.tested("setParent()",true);
+ }
+ catch (com.sun.star.lang.NoSupportException ex) {
+ log.println("Exception occured during setParent()");
+ ex.printStackTrace(log);
+ tRes.tested("setParent()",false);
+ }
+
+ }
+
+} // finish class _XChild
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XContainer.java b/qadevOOo/tests/java/ifc/container/_XContainer.java
new file mode 100644
index 000000000000..0ba52dfb32a8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XContainer.java
@@ -0,0 +1,348 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControl;
+import com.sun.star.container.ContainerEvent;
+import com.sun.star.container.XContainer;
+import com.sun.star.container.XContainerListener;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.EventObject;
+import com.sun.star.uno.UnoRuntime;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import com.sun.star.uno.XNamingService;
+
+
+/**
+* Testing <code>com.sun.star.container.XContainer</code>
+* interface methods :
+* <ul>
+* <li><code> addContainerListener()</code></li>
+* <li><code> removeContainerListener()</code></li>
+* </ul>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'INSTANCE'</code> : Object which can be inserted into
+* container.</li>
+* <li> <code>'INSTANCE2'</code> : <b>(optional)</b>
+* Object which can be inserted into container. The relation
+* must be specified when container cann't contain two
+* identical objects. Replaces the first instance.</li>
+* <li> <code>'XContainer.Container'</code> (of type
+* <code>com.sun.star.container.XNameContainer</code>)
+* <b>optional</b> : is required when the tested component
+* doesn't implement <code>XNameContainer</code> and is used
+* for adding and removing elements.</li>
+* <ul> <p>
+* Object <b>must implement</b>
+* <code>com.sun.star.container.XNameContainer</code>.
+* <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.container.XContainer
+*/
+public class _XContainer extends MultiMethodTest {
+
+ public XContainer oObj = null;
+ private boolean bElementInserted = false;
+ private boolean bElementRemoved = false;
+ private boolean bElementReplaced = false;
+ private PrintWriter _log = null;
+ private XNameContainer NC = null ;
+ private XControlContainer CC = null ;
+ private XNamingService NV = null ;
+ private Object inst = null ;
+ private Object inst2 = null ;
+
+ /**
+ * Retrieves object relations, and tries to query object for
+ * <code>XNameContainer</code> interface.
+ * @throws StatusException If one of relations not found or
+ * object doesn't implement <code>XNameContainer</code> interface.
+ */
+ public void before() throws StatusException {
+ _log = log;
+ NC = (XNameContainer) UnoRuntime.queryInterface
+ (XNameContainer.class, oObj) ;
+
+ Object container = null;
+ if (NC == null) {
+ container = tEnv.getObjRelation("XContainer.Container") ;
+ }
+
+ if (container != null) {
+ if (container instanceof com.sun.star.awt.XControlContainer) {
+ CC = (XControlContainer) container;
+ } else if (container instanceof com.sun.star.uno.XNamingService) {
+ NV = (XNamingService) container;
+ } else {
+ NC = (XNameContainer) container;
+ }
+ }
+
+
+ if (NC == null && CC == null && NV == null)
+ throw new StatusException(
+ Status.failed("Neither object implements XNameContainer" +
+ " nore relation 'XContainer.Container' found.")) ;
+
+ inst = tEnv.getObjRelation("INSTANCE");
+ if (inst == null) {
+ log.println("No INSTANCE ObjRelation!!! ");
+ throw new StatusException(Status.failed("No INSTANCE ObjRelation!!!")) ;
+ }
+ inst2 = tEnv.getObjRelation("INSTANCE2");
+ }
+
+ /**
+ * Listener implementation which just set flags on appropriate
+ * events.
+ */
+ public class MyListener implements XContainerListener {
+ public void elementInserted(ContainerEvent e) {
+ //_log.println("Element was inserted");
+ bElementInserted = true;
+ }
+ public void elementRemoved(ContainerEvent e) {
+ //_log.println("Element was removed");
+ bElementRemoved = true;
+ }
+ public void elementReplaced(ContainerEvent e) {
+ //_log.println("Element was replaced");
+ bElementReplaced = true;
+ }
+ public void disposing (EventObject obj) {}
+ };
+
+ MyListener listener = new MyListener();
+
+ /**
+ * Adds <code>MyListener</code> and performs all possible changes
+ * (insert, replace, remove) with container. The checks which
+ * events were called. <p>
+ * Has <b>OK</b> status if all methods of the listener were called.
+ */
+ public void _addContainerListener() {
+ boolean bResult = true;
+
+ oObj.addContainerListener(listener);
+ bResult &= performChanges();
+ //we can't replace if the container is XControlContainer
+ if (NC != null) bResult &= bElementReplaced;
+ bResult &= bElementRemoved;
+ bResult &= bElementInserted;
+
+ if (!bResult) {
+ log.println("inserted was " + (bElementInserted ? "" : "NOT")
+ + " called.");
+
+ if (NC != null) {
+ log.println("replaced was " + (bElementReplaced ? "" : "NOT")
+ + " called.");
+ }
+ log.println("removed was " + (bElementRemoved ? "" : "NOT")
+ + " called.");
+ }
+
+ tRes.tested("addContainerListener()", bResult);
+ }
+
+ /**
+ * Removes listener added before and performs all possible changes
+ * (insert, replace, remove) with container. The checks which
+ * events were called. <p>
+ * Has <b>OK</b> status if no methods of the listener were called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addContainerListener() </code> : to remove it now. </li>
+ * </ul>
+ */
+ public void _removeContainerListener() {
+ requiredMethod("addContainerListener()") ;
+
+ boolean bResult = true;
+ bElementReplaced = bElementRemoved = bElementInserted = false;
+
+ oObj.removeContainerListener(listener);
+ bResult &= performChanges();
+ bResult &= !bElementReplaced;
+ bResult &= !bElementRemoved;
+ bResult &= !bElementInserted;
+
+ tRes.tested("removeContainerListener()", bResult);
+ }
+
+ /**
+ * Inserts, replaces and finally removes object from container.
+ * Object is gotten from <code>'INSTANCE'</code> relation. If
+ * the relation <code>'INSTANCE2'</code> exists then the first
+ * instance is replaced with second.
+ */
+ protected boolean performChanges() {
+ if (CC != null) return performChanges2();
+ if (NV != null) return performChanges3();
+ boolean bResult = true;
+ try {
+ String[] names = NC.getElementNames();
+ log.println("Elements count = " + names.length);
+ NC.insertByName("XContainer_dummy", inst);
+ names = NC.getElementNames();
+ log.println("Elements count = " + names.length);
+ if (inst2 == null) {
+ NC.replaceByName("XContainer_dummy", inst);
+ } else {
+ NC.replaceByName("XContainer_dummy", inst2);
+ }
+ NC.removeByName("XContainer_dummy");
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured ");
+ ex.printStackTrace(log);
+ bResult = false;
+ } catch (com.sun.star.lang.WrappedTargetException ex) {
+ log.println("Exception occured ");
+ ex.printStackTrace(log);
+ bResult = false;
+ } catch (com.sun.star.container.NoSuchElementException ex) {
+ log.println("Exception occured ");
+ ex.printStackTrace(log);
+ bResult = false;
+ } catch (com.sun.star.container.ElementExistException ex) {
+ log.println("Exception occured ");
+ ex.printStackTrace(log);
+ bResult = false;
+ }
+
+ return bResult;
+ }
+
+ /**
+ * In case no XNameContainer is available, but a XControlContainer
+ * instead.
+ * the XControl instance is inserted
+ * Method returns true if the count of Controls is changed afterwards
+ */
+ protected boolean performChanges2() {
+ int precount = CC.getControls().length;
+ CC.addControl("NewControl",(XControl) inst);
+ shortWait();
+ int count = CC.getControls().length;
+ CC.removeControl(CC.getControl("NewControl"));
+ shortWait();
+ return count>precount;
+ }
+
+ /**
+ * In case no XNameContainer is available, but a XNamingService
+ * instead.
+ * the instance is registered and revoked again
+ * Method return true if getRegisteredObject() works after
+ * registering and doesn't after revoke
+ */
+ protected boolean performChanges3() {
+ boolean res = true;
+
+ try {
+ Object reg = NV.getRegisteredObject("MyFactory");
+ NV.revokeObject("MyFactory");
+ } catch (Exception e) {
+
+ }
+
+ try {
+ NV.registerObject("MyFactory", inst);
+ Object reg = NV.getRegisteredObject("MyFactory");
+ res &= (reg != null);
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ log.println("registerObject failed");
+ res &= false;
+ }
+
+ try {
+ NV.revokeObject("MyFactory");
+ Object reg = NV.getRegisteredObject("MyFactory");
+ log.println("revokeObject failed");
+ res &= false;
+ } catch (Exception e) {
+ res &= true;
+ }
+
+ return res;
+ }
+
+ /**
+ * 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) ;
+ }
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XContentEnumerationAccess.java b/qadevOOo/tests/java/ifc/container/_XContentEnumerationAccess.java
new file mode 100644
index 000000000000..105fc885dad6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XContentEnumerationAccess.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XContentEnumerationAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XContentEnumerationAccess;
+import com.sun.star.container.XEnumeration;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.container.XContentEnumerationAccess</code>
+* interface methods :
+* <ul>
+* <li><code> createContentEnumeration()</code></li>
+* <li><code> getAvailableServiceNames()</code></li>
+* </ul> <p>
+* @see com.sun.star.container.XContentEnumerationAccess
+*/
+public class _XContentEnumerationAccess extends MultiMethodTest{
+ public XContentEnumerationAccess oObj = null;
+ String[] serviceNames = null;
+
+ /**
+ * Retrieves service names and stores them. <p>
+ * Has <b> OK </b> status if not <code>null</code>
+ * value returned.
+ */
+ public void _getAvailableServiceNames(){
+ boolean bResult = true;
+ try {
+ serviceNames = oObj.getAvailableServiceNames();
+ bResult = serviceNames != null ;
+ } catch (Exception e) {
+ log.println("Exception occured. " + e);
+ bResult = false;
+ }
+ tRes.tested("getAvailableServiceNames()", bResult);
+ }
+
+ /**
+ * If at least one service available then an enumeration for
+ * it created. <p>
+ * Has <b> OK </b> status if no services available or enumeration
+ * created for available service is not <code>null</code>.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>getAvailableServiceNames()</code> :
+ * to have at least one service name for enumeration to create for.</li>
+ * </ul>
+ */
+ public void _createContentEnumeration(){
+ requiredMethod("getAvailableServiceNames()");
+
+ if (serviceNames.length == 0) {
+ log.println("No service name available") ;
+ tRes.tested("createContentEnumeration()", true) ;
+ return ;
+ }
+
+ boolean bResult = true;
+
+ log.println( "creating Enumeration" );
+ XEnumeration oEnum = oObj.createContentEnumeration(serviceNames[0]);
+ bResult &= oEnum != null;
+
+ tRes.tested( "createContentEnumeration()", bResult);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XElementAccess.java b/qadevOOo/tests/java/ifc/container/_XElementAccess.java
new file mode 100644
index 000000000000..2b98e57e3af8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XElementAccess.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XElementAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XElementAccess;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.container.XElementAccess</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getElementType()</code></li>
+ * <li><code> hasElements()</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.container.XElementAccess
+ */
+public class _XElementAccess extends MultiMethodTest {
+ public XElementAccess oObj = null;
+
+ /**
+ * Test calls the method and checks return value. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>,
+ * only in the case the container is not empty.<p>
+ */
+ public void _hasElements(){
+ // Testing hasElements() method
+ tRes.tested( "hasElements()", oObj.hasElements() );
+ } // end hasElements
+
+ /**
+ * Test calls the method and checks return value. <p>
+ * Has <b> OK </b> status if the method returns not null value.<p>
+ */
+ public void _getElementType(){
+ // Testing getElementType() method
+ com.sun.star.uno.Type type = oObj.getElementType();
+ tRes.tested( "getElementType()", type != null );
+ } // end ElementType
+
+} /// finished class _XElementAccess
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XEnumeration.java b/qadevOOo/tests/java/ifc/container/_XEnumeration.java
new file mode 100644
index 000000000000..54b61443b6d0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XEnumeration.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.container.XEnumeration</code>
+* interface methods :
+* <ul>
+* <li><code> hasMoreElements()</code></li>
+* <li><code> nextElement()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'ENUM'</code> (of type <code>XEnumerationAccess</code>):
+* This test creates its own oObj because the method nextElement()
+* will be modified this Object directly so other threads may be faild.
+* </li>
+* <ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.container.XEnumeration
+*/
+public class _XEnumeration extends MultiMethodTest {
+
+ public XEnumeration oObj = null;
+ public XEnumerationAccess Enum = null;
+
+ /**
+ * Retrieves relation and sets oObj to a separate enumeration
+ * created. Retrieves all elements from enumeration.<p>
+ * Has <b> OK </b> status if all elements successfully retrieved
+ * and exceptions occured.
+ */
+ public void _hasMoreElements() {
+ boolean result = true;
+ // this method runs twice so look if holder.Enum is empty
+ if ( Enum == null ) {
+ Enum = (XEnumerationAccess) tEnv.getObjRelation("ENUM");
+ if ( Enum == null ) {
+ // SKIPPED.FAILED - the ObjectRelation is not available
+ Status.failed("ObjectRelation('ENUM') XEnumerationAccess n.a.");
+ return;
+ } else {
+ // create an enumeration
+ oObj = Enum.createEnumeration();
+ }
+ }
+ log.println("get all elements");
+ while ( oObj.hasMoreElements() ) {
+ try {
+ Object oAny = oObj.nextElement();
+ } catch (WrappedTargetException e) {
+ log.println("hasMoreElements() : " + e);
+ result = false;
+ break;
+ } catch (NoSuchElementException e) {
+ log.println("hasMoreElements() : " + e);
+ result = false;
+ break;
+ }
+ }
+
+ tRes.tested("hasMoreElements()", result);
+ return;
+ } // end hasMoreElements
+
+ /**
+ * Calls the method (on starting this method there is no more elements
+ * in the enumeration. <p>
+ * Has <b> OK </b> status if only <code>NoSuchElementException</code>
+ * exception rises. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> hasMoreElements() </code> : it retrieves all elements </li>
+ * </ul>
+ */
+ public void _nextElement(){
+ requiredMethod("hasMoreElements()");
+ boolean result = true;
+ log.println("additional call must throw NoSuchElementException");
+
+ try {
+ XInterface oAny = (XInterface)oObj.nextElement();
+ log.println("nextElement: no exception!");
+ result = false;
+ } catch (WrappedTargetException e) {
+ log.println("nextElement: wrong exception!");
+ result = false;
+ } catch (NoSuchElementException e) {
+ log.println("nextElement: correct exception");
+ }
+
+ tRes.tested("nextElement()", result);
+
+ return;
+
+ } // end NextElement
+
+} //end XEnumeration
+
diff --git a/qadevOOo/tests/java/ifc/container/_XEnumerationAccess.java b/qadevOOo/tests/java/ifc/container/_XEnumerationAccess.java
new file mode 100644
index 000000000000..b29443816004
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XEnumerationAccess.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XEnumerationAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.container.XEnumerationAccess</code>
+* interface methods. <p>
+* Test is multithread compilant. <p>
+*/
+public class _XEnumerationAccess extends MultiMethodTest{
+ public XEnumerationAccess oObj = null;
+
+ /**
+ * Test calls the method and checks return value. <p>
+ * Has <b> OK </b> status if the method returns not null value. <p>
+ */
+ public void _createEnumeration(){
+ log.println( "createing Enumeration" );
+ XEnumeration oEnum = oObj.createEnumeration();
+ tRes.tested( "createEnumeration()", oEnum != null );
+ return;
+ } // end createEnumeration()
+} // finish class _XEnumerationAccess
+
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XHierarchicalNameAccess.java b/qadevOOo/tests/java/ifc/container/_XHierarchicalNameAccess.java
new file mode 100644
index 000000000000..5e405bb8c45d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XHierarchicalNameAccess.java
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XHierarchicalNameAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.container.XHierarchicalNameAccess;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.container.XHierarchicalNameAccess</code>
+* interface methods :
+* <ul>
+* <li><code> getByHierarchicalName()</code></li>
+* <li><code> hasByHierarchicalName()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'ElementName'</code> (of type <code>String</code>):
+* name of the element which exists in the container. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.container.XHierarchicalNameAccess
+*/
+public class _XHierarchicalNameAccess extends MultiMethodTest{
+ public XHierarchicalNameAccess oObj = null;
+
+ /**
+ * Calls the method with existing and nonexisting
+ * element names. <p>
+ * Has <b>OK</b> status if for existing name <code>true</code>
+ * is returned and for nonexisting - <code>false</code>.
+ */
+ public void _hasByHierarchicalName(){
+ String name = (String) tEnv.getObjRelation("ElementName") ;
+ boolean res = oObj.hasByHierarchicalName(name) ;
+ name +="ItMakesThisNameNonExistantForSure";
+ boolean res2 = oObj.hasByHierarchicalName(name);
+ res &= !res2;
+ tRes.tested("hasByHierarchicalName()", res) ;
+ } // end _hasByHierarchicalName()
+
+ /**
+ * Tries to retrieve an element with existing name. <p>
+ * Has <b>OK</b> status if non null object is returned.
+ */
+ public void _getByHierarchicalName(){
+ String name = (String) tEnv.getObjRelation("ElementName") ;
+ Object res ;
+
+ try {
+ res = oObj.getByHierarchicalName(name) ;
+
+ } catch (NoSuchElementException e) {
+ log.println("Element with name '" + name +
+ "' doesn't exist in this container") ;
+ res = null ;
+ }
+
+ tRes.tested("getByHierarchicalName()", res != null) ;
+
+ } // end _getByHierarchicalName()
+
+} // finish class _XHierarchicalNameAccess
+
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XIndexAccess.java b/qadevOOo/tests/java/ifc/container/_XIndexAccess.java
new file mode 100644
index 000000000000..2df36f71a62c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XIndexAccess.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XIndexAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import com.sun.star.lang.WrappedTargetException;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.container.XIndexAccess</code>
+* interface methods :
+* <ul>
+* <li><code> getCount()</code></li>
+* <li><code> getByIndex()</code></li>
+* </ul> <p>
+* Test seems to work properly in multithreaded environment.
+* @see com.sun.star.container.XIndexAccess
+*/
+public class _XIndexAccess extends MultiMethodTest {
+
+ public XIndexAccess oObj = null;
+
+ /**
+ * Number of elements in the container.
+ */
+ public int count = 0;
+
+ /**
+ * Get number of element in the container. <p>
+ * Has <b> OK </b> status if method returns number lager than -1.
+ */
+ public void _getCount() {
+ boolean result = true;
+ log.println("getting the number of the elements");
+ // hope we haven't a count lower than zerro ;-)
+ count = -1;
+ count = oObj.getCount();
+ result = (count != -1);
+ tRes.tested("getCount()", result);
+ } //end getCount()
+
+ /**
+ * This method tests the IndexAccess from the first element,
+ * the middle element and the last element. Finaly it test
+ * Exceptions which throws by a not available index. <p>
+ * Has <b> OK </b> status if first, middle and last elements
+ * successfully returned and has non null value; and if on
+ * invalid index parameter <code>IndexOutOfBoundException</code>
+ * is thrown.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getCount() </code> : to have number of elements
+ * in container. </li>
+ * </ul>
+ */
+ public void _getByIndex() {
+ requiredMethod("getCount()");
+ // get count from holder
+
+ try {
+ Thread.sleep(200);
+ }
+ catch(java.lang.InterruptedException e) {}
+
+ boolean result = true;
+ boolean loc_result = true;
+ Object o = null;
+ log.println("Testing getByIndex()");
+
+ if (count > 0) {
+ // Check the first element
+ log.println("Check the first element");
+ try {
+ log.println("getByIndex(0)");
+ o = oObj.getByIndex(0);
+ loc_result = (o != null);
+ if (loc_result) log.println("OK"); else log.println("FAILED");
+ result &= loc_result;
+ } catch (WrappedTargetException e) {
+ log.println("Exception! " + e);
+ result = false;
+ } catch (IndexOutOfBoundsException e) {
+ log.println("Exception! " + e);
+ result = false;
+ }
+
+ // Check the middle element
+ log.println("Check the middle element");
+ try {
+ log.println("getByIndex(" + count / 2 + ")");
+ o = oObj.getByIndex(count / 2);
+ loc_result = (o != null);
+ if (loc_result) log.println("OK"); else log.println("FAILED");
+ result &= loc_result;
+ } catch (WrappedTargetException e) {
+ log.println("Exception! " + e);
+ result = false;
+ } catch (IndexOutOfBoundsException e) {
+ log.println("Exception! " + e);
+ result = false;
+ }
+
+ // Check the last element
+ log.println("Check the last element");
+ try {
+ log.println("getByIndex(" + (count - 1) + ")");
+ o = oObj.getByIndex(count - 1);
+ loc_result = (o != null);
+ if (loc_result) log.println("OK"); else log.println("FAILED");
+ result &= loc_result;
+ } catch (WrappedTargetException e) {
+ log.println("Exception! " + e);
+ result = false;
+ } catch (IndexOutOfBoundsException e) {
+ log.println("Exception! " + e);
+ result = false;
+ }
+
+ // Testing getByIndex with wrong params.
+ log.println("Testing getByIndex with wrong params.");
+ try {
+ log.println("getByIndex(" + count + ")");
+ loc_result = oObj.getByIndex(count) == null;
+ log.println("no exception thrown - FAILED");
+ result = false;
+ } catch (IndexOutOfBoundsException e) {
+ log.println("Expected exception cought! " + e + " OK");
+ } catch (WrappedTargetException e) {
+ log.println("Wrong exception! " + e + " FAILED");
+ result = false;
+ }
+ }
+
+ tRes.tested("getByIndex()", result);
+
+ } // end getByIndex
+
+} // end XIndexAccess
+
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XIndexContainer.java b/qadevOOo/tests/java/ifc/container/_XIndexContainer.java
new file mode 100644
index 000000000000..d5c944b68233
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XIndexContainer.java
@@ -0,0 +1,243 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XIndexContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.container.XIndexContainer</code>
+* interface methods :
+* <ul>
+* <li><code> insertByIndex()</code></li>
+* <li><code> removeByIndex()</code></li>
+* </ul> <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> : N relations
+* which represents objects to be inserted. See below
+* for more information.</li>
+* <li> <code>'XIndexContainerINDEX'</code> : For internal test
+* usage. Contains current thread number. </li>
+* <li> Test environment variable <code>'THRCNT'</code> : number
+* of interface threads running concurently. </li>
+* <ul> <p>
+* XIndexComtainer needs n ObjectRelations "INSTANCEn" , where n=1, ...,
+* THRCNT.<p>
+* When this interface tested by different threads, it must use different
+* instances to insert/remove - one for each thread.
+* <p>
+* That's why we use objRelation "XIndexComtainerINDEX" to store the number of
+* last taken instance. If there is no such relation, it initialize with 1.
+* <p>
+* This ObjectRelations should be necessary to create an Object,
+* which is insertable by insterByIndex()
+* INSTANCEn are n Objectrelations so that every thread can isert it's own
+* object. n depends on the variable THRCNT which and comes from API.INI
+* <p>
+* Why that:
+* If you insert the same Object by insertByIndex() several times you
+* don't insert the Object several times. The first insertByIndex() inserts
+* the Object to the Container but all other insertByIndex() changes
+* the Index in the Continer because it's the same Object. <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.container.XIndexContainer
+*/
+
+public class _XIndexContainer extends MultiMethodTest {
+ public XIndexContainer oObj = null;
+
+ int Index = 0;
+
+ /**
+ * First tries to insert proper object. Second tries to insert
+ * null value. For each test thread different objects are inserted
+ * on different indexes. For exmaple for the first started test index
+ * is 0 and object is get from relation 'INCTANCE1', and so on. <p>
+ * Has <b>OK</b> status if in the first case <code>getByIndex</code>
+ * method returns non null value and in the second <code>
+ * IndexOutOfBoundsException</code> was thrown.
+ */
+ public void _insertByIndex() {
+ boolean result = true;
+
+ log.println("get ObjRelation(\"XIndexContainerINDEX\")");
+ String sIndex = (String)tEnv.getObjRelation("XIndexContainerINDEX");
+ if (sIndex == null) {
+ log.println("No XIndexContainerINDEX - so set it to 1.");
+ tEnv.addObjRelation("XIndexContainerINDEX", Integer.toString(1));
+ Index = 1;
+ } else {
+ Index = Integer.parseInt(sIndex);
+ Index++;
+ tEnv.addObjRelation("XIndexContainerINDEX",
+ Integer.toString(Index));
+ }
+
+
+ log.println("get ObjRelation(\"INSTANCE" + Index +"\")");
+ Object oInstance = tEnv.getObjRelation("INSTANCE"+ Index);
+ if (oInstance == null) {
+ log.println("ObjRelation(\"INSTANCE" + Index +"\") Object n.a.");
+ }
+
+ log.println("testing insertByIndex(\"" + Index + "\")...");
+ try {
+ oObj.insertByIndex(Index, oInstance);
+ result &= oObj.getByIndex(Index) != null ;
+ log.println("insertByIndex(\""+Index+"\")...OK");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("insertByIndex(\""+Index+"\"): " + e + " FLASE");
+ result = false;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("insertByIndex(\""+Index+"\"): " + e + " FLASE");
+ result = false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("insertByIndex(\""+Index+"\"): " + e + " FLASE");
+ result = false;
+ }
+
+ log.println("inserting a wrong Object occurs Exceptions ...");
+ try {
+ Object dummy = null;
+ oObj.insertByIndex(0, dummy);
+ log.println("No Exception: -> FALSE");
+ result = false;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Dummy-Exception: " + e + " -> OK");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("!!! Wrong Exception: " + e + " -> FAILED");
+ result = false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("!!! Wrong Exception: " + e + " -> FAILED");
+ result = false;
+ }
+
+ tRes.tested("insertByIndex()", result);
+ }
+
+ /**
+ * Removes the element inserted by <code>insertByIndex</code> method test.
+ * The number of elements is checked before and after removing.
+ * Then tries to remove an element with invalid index and checks exceptions.
+ * <p>
+ * Has <b>OK</b> status if after removing number of elements decreases by
+ * one and <code>IndexOutOfBoundsException</code> is thrown on invalid index
+ * removing.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertByIndex </code> : to have an object which can be
+ * removed.</li>
+ * </ul>
+ */
+ public void _removeByIndex() {
+ requiredMethod("insertByIndex()");
+ boolean result = true;
+
+ log.println("testing removeByIndex() ...");
+
+ try {
+ log.println("remove " +Index);
+ int cnt1 = -1 , cnt2 = -1 ;
+ synchronized (oObj) {
+ cnt1 = oObj.getCount() ;
+ oObj.removeByIndex(Index);
+ cnt2 = oObj.getCount() ;
+ }
+ log.println("Count before removing : " + cnt1 +
+ ", and after : " + cnt2) ;
+
+ result &= cnt1 == cnt2 + 1 ;
+
+ log.println("1. removeByIndex(\""+Index+"\") ...OK");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ result = false;
+ log.println("1. removeByIndex:(\""+Index+"\") " +
+ e + " - FAILED");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ result = false;
+ log.println("1. removeByIndex:(\""+Index+"\") " +
+ e + " - FAILED");
+ }
+
+ log.println("removing a non existent object to get an exception");
+ try {
+ oObj.removeByIndex(100);
+ result = false;
+ log.println("2. removeByIndex(): Exception expected! - FAILED");
+ } catch (IndexOutOfBoundsException e) {
+ log.println("2. removeByIndex(): Expected exception - OK");
+ result &= true;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ result = false;
+ log.println("2. removeByIndex(): Unexpected exception! - " +
+ e + " - FAILED");
+ }
+
+ tRes.tested("removeByIndex()", result);
+ }
+}
+
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XIndexReplace.java b/qadevOOo/tests/java/ifc/container/_XIndexReplace.java
new file mode 100644
index 000000000000..139785582675
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XIndexReplace.java
@@ -0,0 +1,244 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XIndexReplace.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XIndexReplace;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+
+/**
+* Testing <code>com.sun.star.container.XIndexReplace</code>
+* interface methods :
+* <ul>
+* <li><code> replaceByIndex()</code></li>
+* </ul>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> : N relations
+* which represents objects to be replaced with. See below
+* for more information.</li>
+* <li> <code>'XIndexReplaceINDEX'</code> : For internal test
+* usage. Contains current thread number. </li>
+* <li> Test environment variable <code>'THRCNT'</code> : number
+* of interface threads running concurently. </li>
+* <ul> <p>
+* XIndexReplace needs n ObjectRelations "INSTANCEn" , where n = 1, ..., THRCNT.
+* <p>
+* When this interface tested by different threads, it must use different
+* instances to replace - one for each thread.<p>
+* That's why we use objRelation "XIndexReplaceINDEX" to store the number of
+* last taken instance. If there is no such relation, it initialize with 1.
+* <p>
+* This ObjectRelations should be necessary to create an Object,
+* which is can be replaced by index
+* INSTANCEn are n Objectrelations so that every thread can isert it's own
+* object. n depends on the variable THRCNT which and comes from API.INI
+* <p>
+* Why that:
+* If you insert the same Object by replaceByIndex() several times you
+* don't insert the Object several times. The first replaceByIndex() inserts
+* the Object to the Container but all other replaceByIndex() changes
+* the Index in the Continer because it's the same Object. <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.container.XIndexReplace
+*/
+
+public class _XIndexReplace extends MultiMethodTest {
+ public XIndexReplace oObj = null;
+
+ /**
+ * Primarily tries to replace elements in a proper way :
+ * replaces the first, middle and the last element then
+ * checks if elements were properly replaced.
+ * Then wrong parameters are passed : invalid index and
+ * null value for replacing, and test checks for proper
+ * exceptions to be thrown. <p>
+ * In different threads it replaces elements with different
+ * objects.
+ * Has <b>OK</b> status if in the first (correct) case
+ * elements were successfully replaced (i.e. values got
+ * after replacing must be equal to those replaced with),
+ * and in the second case proper exceptions were thrown.
+ */
+ public void _replaceByIndex() {
+ boolean result = true;
+ Object old = null;
+ Object oInstance = null;
+ int Index = 0;
+
+ //get for every thread its own Object to insert it
+ log.println("get ObjRelation(\"XIndexReplaceINDEX\")");
+ String sIndex = (String)tEnv.getObjRelation("XIndexReplaceINDEX");
+ if (sIndex == null) {
+ log.println("No XIndexReplaceINDEX - so set it to 1.");
+ tEnv.addObjRelation("XIndexReplaceINDEX", Integer.toString(1));
+ Index = 1;
+ } else {
+ Index = Integer.parseInt(sIndex);
+ Index++;
+ tEnv.addObjRelation("XIndexReplaceINDEX", Integer.toString(Index));
+ }
+
+
+ log.println("get ObjRelation(\"INSTANCE" + Index +"\")");
+ oInstance = tEnv.getObjRelation("INSTANCE"+ Index);
+ if (oInstance == null) {
+ log.println("ObjRelation(\"INSTANCE" + Index +"\") Object n.a.");
+ }
+
+ log.println("testing replaceByIndex(0)...");
+
+ try {
+
+ log.println("Getting old object");
+ old = oObj.getByIndex(0);
+ oObj.replaceByIndex(0, oInstance);
+ result = !(oObj.getByIndex(0)).equals(old);
+ result = ! ValueComparer.equalValue(oObj,old);
+
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log) ;
+ result = false;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ result = false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ result = false;
+ }
+
+
+ log.println("replace with a wrong Object occurs Exceptions ...");
+ try {
+ oObj.replaceByIndex(999, oInstance);
+ result = false;
+ log.println("1. replaceByIndex(): Exception expected! - FAILED");
+
+
+ XNameContainer xNC = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oObj) ;
+ String[] names = xNC.getElementNames() ;
+ log.println("Element names :") ;
+ for (int i = 0; i<names.length; i++) {
+ log.println(" '" + names[i] + "'") ;
+ }
+ } catch (IndexOutOfBoundsException e) {
+ log.println("1. replaceByIndex(): Expected exception - OK");
+ result &= true;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ result = false;
+ log.println("1. replaceByIndex(): Unexpected exception! - " +
+ e + " - FAILED");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ result = false;
+ log.println("1. replaceByIndex(): Unexpected exception! - " +
+ e + " - FAILED");
+ }
+
+ log.println("replace with a wrong Object occurs Exceptions ...");
+ try {
+ oObj.replaceByIndex(0, null);
+ result = false;
+ log.println("2. replaceByIndex(): Exception expected! - FAILED");
+
+
+ XNameContainer xNC = (XNameContainer)
+ UnoRuntime.queryInterface(XNameContainer.class, oObj) ;
+ String[] names = xNC.getElementNames() ;
+ log.println("Element names :") ;
+ for (int i = 0; i<names.length; i++) {
+ log.println(" '" + names[i] + "'") ;
+ }
+ } catch (IllegalArgumentException e) {
+ log.println("2. replaceByIndex(): Expected exception - OK");
+ result &= true;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ result = false;
+ log.println("2. replaceByIndex(): Unexpected exception! - " +
+ e + " - FAILED");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ result = false;
+ log.println("2. replaceByIndex(): Unexpected exception! - " +
+ e + " - FAILED");
+ }
+
+ log.println("replace with the old object");
+ try {
+ oObj.replaceByIndex(0, old);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log) ;
+ }
+
+ tRes.tested("replaceByIndex()", result);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XNameAccess.java b/qadevOOo/tests/java/ifc/container/_XNameAccess.java
new file mode 100644
index 000000000000..a83fc4380f67
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XNameAccess.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNameAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.container.XNameAccess;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.container.XNameAccess</code> interface methods. <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+*/
+public class _XNameAccess extends MultiMethodTest {
+ public XNameAccess oObj = null;
+ public String[] Names = null;
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * not null value and no exceptions were thrown. <p>
+ */
+ public void _getElementNames() {
+ boolean result = true;
+ log.println("getting elements names");
+ Names = oObj.getElementNames();
+
+ result = (Names != null);
+ tRes.tested("getElementNames()", result);
+ return;
+ } // end getElementNames()
+
+ /**
+ * First test calls the method with existing element name,
+ * then with non existing. <p>
+ * Has <b> OK </b> status if in the first case the method returns
+ * true and in the second - false. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getElementNames </code> : to retrieve at least one
+ * element name. </li>
+ * </ul>
+ */
+ public void _hasByName() {
+ requiredMethod("getElementNames()");
+ log.println("testing hasByName() ...");
+
+ boolean result = true;
+ boolean loc_result = true;
+
+ String name = null;
+
+ if (Names.length != 0) {
+ log.println("testing hasByName() with valid name");
+ name = Names[0];
+ loc_result = oObj.hasByName(name);
+ log.println("hasByName with valid names: " + loc_result);
+ result &= loc_result;
+ }
+
+ name = "non_existant_name__1234";
+ log.println("testing hasByName() with invalid name");
+ try {
+ loc_result = !oObj.hasByName(name);
+ } catch ( Exception nsee) {
+ log.println("Expected exception was thrown");
+ }
+ log.println("hasByName with invalid names: " + loc_result);
+ result &= loc_result;
+
+ tRes.tested("hasByName()", result);
+
+ return;
+ } // end hasByName()
+
+
+ /**
+ * First test calls the method with existing element name,
+ * then with non existing. <p>
+ * Has <b> OK </b> status if in the first case the method returns
+ * not null value and no exceptions were thrown,
+ * and in the second case <code>NoSuchElementException</code> was
+ * thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getElementNames </code> : to retrieve at least one
+ * element name. </li>
+ * </ul>
+ */
+ public void _getByName() {
+ log.println("reqiure getElementNames() ...");
+ requiredMethod("getElementNames()");
+ log.println("require getElementNames() ...OK");
+ log.println("testing getByName() ...");
+
+ boolean result = true;
+ boolean loc_result = true;
+
+ String name = null;
+
+ if (Names.length != 0) {
+ log.println("testing with valid name");
+ name = Names[0];
+ try {
+ loc_result = (null != oObj.getByName(name));
+ } catch (Exception e) {
+ log.println("Exception! - FAILED");
+ loc_result = false;
+ }
+ log.println("getByName with valid name: " + loc_result);
+ result &= loc_result;
+ }
+
+ log.println("testing with non-existant name");
+ name = "non_existant_name__1234";
+ try {
+ loc_result = (null != oObj.getByName(name));
+ loc_result = false;
+ log.println("getByName: Exception expected - FAILED");
+ } catch (NoSuchElementException e) {
+ log.println("getByName: Expected exception - OK");
+ loc_result = true;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("getByName: Wrong exception - " + e + " - FAILED");
+ loc_result = false;
+ }
+
+ result &= loc_result;
+ tRes.tested("getByName()", result);
+
+ return;
+
+ } // end getByName()
+} /// finished class _XNameAccess
+
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XNameContainer.java b/qadevOOo/tests/java/ifc/container/_XNameContainer.java
new file mode 100644
index 000000000000..0c8fc60101ca
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XNameContainer.java
@@ -0,0 +1,295 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNameContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.container.XNameContainer;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.container.XNameContainer</code>
+* interface methods :
+* <ul>
+* <li><code> insertByName()</code></li>
+* <li><code> removeByName()</code></li>
+* </ul>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> : N relations
+* which represents objects to be inserted. See below
+* for more information.</li>
+* <li> <code>'XNameContainerINDEX'</code> : For internal test
+* usage. Contains current thread number. </li>
+* <li> <code>'XNameContainer.AllowDuplicateNames'</code> <b>optional</b>:
+* if this relation exists then container elements can have duplicate
+* names. </li>
+* <li> Test environment variable <code>'THRCNT'</code> : number
+* of interface threads running concurently. </li>
+* <ul> <p>
+* XNameComtainer needs n ObjectRelations "INSTANCEn" , where n=1, ..., THRCNT.
+*
+* When this interface tested by different threads, it must use different
+* instances to insert/remove - one for each thread.
+*
+* That's why we use objRelation "XNameContainerINDEX" to store the number of
+* last taken instance. If there is no such relation, it initialize with 1.
+*
+* If you insert the same Object by insertByName() several times you
+* don't insert the Object several times. The first insertByName() inserts
+* the Object to the Container but all other insertByName() changes
+* the Name in the Continer because it's the same Object.
+* @see com.sun.star.container.XNameContainer
+*/
+
+public class _XNameContainer extends MultiMethodTest {
+ public XNameContainer oObj = null;
+ String Name = "XNameContainer";
+
+ /**
+ * First inserts object by name (different objects for different threads)
+ * and checks if it exists. Second, if duplicate names are not allowed
+ * test tries to insert element with the same name and checks for
+ * proper exception. Third, tries to add <code>null</code> element and
+ * checks for proper exception. <p>
+ * Has <b>OK</b> status if in the first case element added exists in
+ * the container, in the second case <code>ElementExistException</code>
+ * is thrown, and in the third case <code>IllegalArgumentException</code>
+ * is thrown.
+ */
+ public void _insertByName() {
+ boolean result = true;
+ int Index = 0;
+
+ //get for every thread its own Object to insert it
+ log.println("get ObjRelation(\"XNameContainerINDEX\")");
+ String sIndex = null ;
+ synchronized (tEnv) {
+ sIndex = (String)tEnv.getObjRelation("XNameContainerINDEX");
+ if (sIndex == null) {
+ log.println("No XNameContainerINDEX - so set it to 1.");
+ tEnv.addObjRelation("XNameContainerINDEX",Integer.toString(1));
+ Index = 1;
+ } else {
+ Index = Integer.parseInt(sIndex);
+ Index++;
+ tEnv.addObjRelation("XNameContainerINDEX",
+ Integer.toString(Index));
+ }
+ }
+ Name += Index ;
+
+ log.println("get ObjRelation(\"INSTANCE" + Index +"\")");
+ Object oInstance = tEnv.getObjRelation("INSTANCE"+ Index);
+ if (oInstance == null) {
+ log.println("ObjRelation(\"INSTANCE" + Index +"\") Object n.a.");
+ }
+
+
+ log.println("testing insertByName(\""+Name+"\")...");
+ try {
+ String[] names = oObj.getElementNames() ;
+ log.println("Element names :") ;
+ for (int i = 0; i<names.length; i++) {
+ log.println(" '" + names[i] + "'") ;
+ }
+
+ oObj.insertByName(Name, oInstance);
+
+ names = oObj.getElementNames() ;
+ log.println("Element names :") ;
+ for (int i = 0; i<names.length; i++) {
+ log.println(" " + names[i]) ;
+ }
+
+ result &= oObj.hasByName(Name) ;
+ log.println("insertByName(\""+Name+"\")...OK");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("insertByName(\""+Name+"\"): " + e + " FALSE");
+ result = false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("insertByName(\""+Name+"\"): " + e + " FALSE");
+ result = false;
+ } catch (com.sun.star.container.ElementExistException e) {
+ log.println("insertByName(\""+Name+"\"): " + e + " FALSE");
+ result = false;
+ }
+
+ // if duplicate names is not allowed test for valid exception
+ if (tEnv.getObjRelation("XNameContainer.AllowDuplicateNames")==null) {
+ Object secondInstance = tEnv.getObjRelation("SecondInstance");
+ if (secondInstance != null) {
+ oInstance = secondInstance;
+ }
+ log.println("Trying to add element with the same name ...") ;
+ try {
+ oObj.insertByName(Name, oInstance);
+ result = false ;
+ log.println("!!! No exception were thrown !!!");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("!!! Wrong exception : " + e + " FALSE");
+ result = false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("!!! Wrong exception : " + e + " FALSE");
+ result = false;
+ } catch (com.sun.star.container.ElementExistException e) {
+ log.println("Right exception : " + e + " OK");
+ }
+ }
+
+ log.println("inserting a wrong Object occurs Exceptions ...");
+ try {
+ Object dummy = null;
+ oObj.insertByName("Dummy", dummy);
+ log.println("No Exception: -> FALSE");
+ result = false;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Dummy-Exception: " + e + " -> OK");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("!!! This exception not expected: " +e+ " -> FAILED");
+ result = false;
+ } catch (com.sun.star.container.ElementExistException e) {
+ log.println("!!! This exception not expected: " +e+ " -> FAILED");
+ result = false;
+ }
+
+ tRes.tested("insertByName()", result);
+
+ } // end insertByName()
+
+ /**
+ * Test removes element inserted before and checks if element
+ * still exists in the container. Second test tries to remove
+ * element with non-existing name and checks for proper exception. <p>
+ * Has <b> OK </b> status if in the first case element doesn't
+ * exist anymore (or duplicate names are allowed), and in the
+ * second case <code>NoSuchElementException</code> is thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertByName() </code> : to remove the element inserted
+ * in this test. </li>
+ * </ul>
+ */
+ public void _removeByName() {
+ try {
+ requiredMethod("insertByName()");
+ } catch (StatusException e) {
+ // removing the name anywhere
+ try {
+ oObj.removeByName(Name);
+ } catch (com.sun.star.container.NoSuchElementException e1) {
+ } catch (com.sun.star.lang.WrappedTargetException e1) {
+ } finally {
+ throw (StatusException)e.fillInStackTrace();
+ }
+ }
+
+ boolean result = true;
+
+ log.println("testing removeByName() ...");
+
+ try {
+ log.println("remove " + Name);
+ String[] names = oObj.getElementNames() ;
+ log.println("Element names :") ;
+ for (int i = 0; i<names.length; i++) {
+ log.println(" " + names[i]) ;
+ }
+ oObj.removeByName(Name);
+ boolean loc_res = !oObj.hasByName(Name) || tEnv.getObjRelation
+ ("XNameContainer.AllowDuplicateNames") != null ;
+ result &= loc_res ;
+ if (loc_res)
+ log.println("1. removeByName(\""+Name+"\") ...OK");
+ else
+ log.println("1. !!! Container still has element with name "
+ + Name) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ result = false;
+ log.println("1. removeByName:(\""+Name+"\") " + e + " - FAILED");
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ result = false;
+ log.println("1. removeByName:(\""+Name+"\") " + e + " - FAILED");
+ }
+
+ log.println("removing a non existent object to get an exception");
+ try {
+ oObj.removeByName(Name+ " dummy");
+ result = false;
+ log.println("2. removeByName(): Exception expected! - FAILED");
+ } catch (NoSuchElementException e) {
+ log.println("2. removeByName(): Expected exception - OK");
+ result &= true;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ result = false;
+ log.println("2. removeByName(): Unexpected exception! - " +
+ e + " - FAILED");
+ }
+
+ tRes.tested("removeByName()", result);
+
+ return;
+ } // end removeByName()
+} //XNameContainer
+
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XNameReplace.java b/qadevOOo/tests/java/ifc/container/_XNameReplace.java
new file mode 100644
index 000000000000..7afc6a086207
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XNameReplace.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNameReplace.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameReplace;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+/**
+* Testing <code>com.sun.star.container.XNameReplace</code>
+* interface methods :
+* <ul>
+* <li><code> replaceByName()</code></li>
+* </ul>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'INSTANCE1', ..., 'INSTANCEN'</code> : N relations
+* which represents objects to be replaced with. See below
+* for more information.</li>
+* <li> <code>'NAMEREPLACE'</code> <b>optional</b>: <code>String</code>
+* relation which represents element name to be replaced.
+* Some Objects can't replace the firsr that comes along, i.e.
+* SwXStyleFamily. It have some pool styles which can't be replaced.
+* So the test need a special object to replace it by name. </li>
+* <li> <code>'XNameReplaceINDEX'</code> : For internal test
+* usage. Contains current thread number. </li>
+* <li> Test environment variable <code>'THRCNT'</code> : number
+* of interface threads running concurently. </li>
+* <ul> <p>
+* XNameReplace needs n ObjectRelations "INSTANCEn" , where n = 1, ..., THRCNT.
+* <p>
+* When this interface tested by different threads, it must use different instances
+* to replace - one for each thread.
+* <p>
+* That's why we use objRelation "XNameReplaceINDEX" to store the number of last
+* taken instance. If there is no such relation, it initialize with 1.
+* <p>
+* In one of the last steps the replaced object will be compared with the old
+* object. For that it is necessary that every thread replace it's own object.
+* INSTANCEn are n Objectrelations so that every thread can isert it's own
+* object. n depends on the variable THRCNT which and comes from API.INI
+* Some Object-Container can't replace the first that comes belong. So in
+* NAMEREPLACE you can determine a containerobject, which is replaceable. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.container.XNameReplace
+*/
+public class _XNameReplace extends MultiMethodTest {
+
+ public XNameReplace oObj = null;
+
+ /**
+ * First test retrieves instance to be replaced with for each interface thread.
+ * Then list of element names is retrieved, the first of them will
+ * be replaced. In special case when <code>'NAMEREPLACE'</code> relation
+ * exists, element with the specified name is replaced.
+ * Test replaces element and checks values of element with the
+ * specified name before and after replacement. <p>
+ * Has <b>OK</b> status if values before and after replacement are
+ * different.
+ */
+ public void _replaceByName(){
+ boolean result = true;
+ Object oOldInstance = null;
+ Object oNewInstance = null;
+ String sName = null;
+ String[] oNames = null;
+
+ int Index = 0;
+
+ //get for every thread its own Object to insert it
+ log.println("get ObjRelation(\"XNameReplaceINDEX\")");
+ String sIndex = (String)tEnv.getObjRelation("XNameReplaceINDEX");
+ System.out.println("Index: "+sIndex);
+ if (sIndex == null) {
+ log.println("No XNameReplaceINDEX - so set it to 1.");
+ tEnv.addObjRelation("XNameReplaceINDEX", Integer.toString(1));
+ Index = 1;
+ } else {
+ Index = Integer.parseInt(sIndex);
+ Index++;
+ tEnv.addObjRelation("XNameReplaceINDEX", Integer.toString(Index));
+ }
+
+ log.println("get ObjRelation(\"INSTANCE" + Index +"\")");
+ Object oInstance = tEnv.getObjRelation("INSTANCE"+ Index);
+ if (oInstance == null) {
+ log.println("ObjRelation(\"INSTANCE" + Index +"\") Object n.a.");
+ }
+
+ log.println("getting the existant object's name");
+ XNameAccess oNameAccess = (XNameAccess)UnoRuntime.queryInterface(
+ XNameAccess.class, oObj);
+ oNames = oNameAccess.getElementNames();
+ /* Some Objects can't replace the firsr that comes along, i.e.
+ SwXStyleFamily. It have some pool styles which can't be replaced.
+ So the test need a special object to replace it by name.
+ */
+ log.println("get ObjRelation(\"NAMEREPLACE\")");
+ Object oNameReplace = tEnv.getObjRelation("NAMEREPLACE");
+ if (oNameReplace != null) {
+ oNames[0] = oNameReplace.toString();
+ }
+
+
+ log.println("replaceByName()");
+ try {
+ Object old = oObj.getByName(oNames[0]) ;
+ oObj.replaceByName(oNames[0],oInstance);
+ Object newEl = oObj.getByName(oNames[0]) ;
+ result &= ! ValueComparer.equalValue(old, newEl);
+ } catch (com.sun.star.lang.IllegalArgumentException e ) {
+ result = false;
+ e.printStackTrace(log) ;
+ } catch (com.sun.star.container.NoSuchElementException e ) {
+ result = false;
+ e.printStackTrace(log) ;
+ } catch (com.sun.star.lang.WrappedTargetException e ) {
+ result = false;
+ e.printStackTrace(log) ;
+ }
+
+ tRes.tested("replaceByName()", result);
+
+ } // end replaceByName()
+
+ /**
+ * Forces object environment recreation.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XNamed.java b/qadevOOo/tests/java/ifc/container/_XNamed.java
new file mode 100644
index 000000000000..c7a2aa38f929
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XNamed.java
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNamed.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XNamed;
+import lib.MultiMethodTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.container.XNamed</code>
+* interface methods :
+* <ul>
+* <li><code> getName()</code></li>
+* <li><code> setName()</code></li>
+* </ul>
+* This test need the following object relations :
+* <ul>
+* <li> <code>'setName'</code> : of <code>Boolean</code>
+* type. If it exists then <code>setName</code> method
+* isn't to be tested and result of this test will be
+* equal to relation value.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.container.XNamed
+*/
+public class _XNamed extends MultiMethodTest {
+
+ public XNamed oObj = null; // oObj filled by MultiMethodTest
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if the method returns non null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getName() {
+
+ // write to log what we try next
+ log.println( "test for getName()" );
+
+ boolean result = true;
+ boolean loc_result = true;
+ String name = null;
+ String NewName = null;
+
+ loc_result = ((name = oObj.getName()) != null);
+ log.println("getting the name \"" + name + "\"");
+
+ if (loc_result) log.println("... getName() - OK");
+ else log.println("... getName() - FAILED");
+ result &= loc_result;
+ tRes.tested("getName()", result);
+ }
+
+ /**
+ * Sets a new name for object and checks if it was properly
+ * set. Special cases for the following objects :
+ * <ul>
+ * <li><code>ScSheetLinkObj</code> : name must be in form of URL.</li>
+ * <li><code>ScDDELinkObj</code> : name must contain link to cell in
+ * some external Sheet.</li>
+ * </ul>
+ * Has <b> OK </b> status if new name was successfully set, or if
+ * object environment contains relation <code>'setName'</code> with
+ * value <code>true</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getName() </code> : to be sure the method works</li>
+ * </ul>
+ */
+ public void _setName(){
+ String Oname = tEnv.getTestCase().getObjectName();
+ if (Oname.indexOf("Exporter")>0) {
+ log.println("With "+Oname+" setName() doesn't work");
+ log.println("see idl-file for further information");
+ tRes.tested("setName()",true);
+ return;
+ }
+ requiredMethod("getName()");
+ log.println("testing setName() ... ");
+
+ String oldName = oObj.getName();
+ String NewName = oldName == null ? "XNamed" : oldName + "X" ;
+
+ String testobjname = tEnv.getTestCase().getObjectName();
+ if (testobjname.equals("ScSheetLinkObj")) {
+ // special case, here name is equals to links URL.
+ NewName = "file:///c:/somename/from/XNamed";
+ } else if (testobjname.equals("ScDDELinkObj")) {
+ String fileName = utils.getFullTestDocName("ScDDELinksObj.sdc");
+ NewName = "soffice|" + fileName + "!Sheet1.A2";
+ } else if (testobjname.equals("SwXAutoTextGroup")) {
+ //This avoids a GPF
+ NewName = "XNamed";
+ }
+
+ boolean result = true;
+ boolean loc_result = true;
+ Boolean sName = (Boolean) tEnv.getObjRelation("setName");
+ if (sName == null) {
+ log.println("set the name of object to \"" + NewName + "\"");
+ oObj.setName(NewName);
+ log.println("check that container has element with this name");
+
+ String name = oObj.getName();
+ log.println("getting the name \"" + name + "\"");
+ loc_result = name.equals(NewName);
+
+ if (loc_result) log.println("... setName() - OK");
+ else log.println("... setName() - FAILED");
+ result &= loc_result;
+ }
+ else {
+ log.println("The names for the object '"+testobjname+
+ "' are fixed.");
+ log.println("It is not possible to rename.");
+ log.println("So 'setName()' is always OK");
+ result = sName.booleanValue();
+ }
+ tRes.tested("setName()", result);
+ oObj.setName(oldName);
+ return;
+ }
+
+ /**
+ * Does nothing.
+ */
+ protected void after() {
+ //disposeEnvironment();
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/container/_XSet.java b/qadevOOo/tests/java/ifc/container/_XSet.java
new file mode 100644
index 000000000000..e91dfb3a8ce7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/container/_XSet.java
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.container;
+
+import com.sun.star.container.XSet;
+import com.sun.star.lang.XMultiServiceFactory;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.container.XSet</code>
+* interface methods :
+* <ul>
+* <li><code> has()</code></li>
+* <li><code> insert()</code></li>
+* <li><code> remove()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.container.XSet
+*/
+public class _XSet extends MultiMethodTest {
+
+ public static XSet oObj = null;
+
+ private Object element = null ;
+ private boolean hasResult = true ;
+
+ /**
+ * Inserts the element stored and removed before. <p>
+ * Has <b> OK </b> status if <code>has()</code> method returns
+ * <code>true</code>.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> remove() </code> : element from set is stored and
+ * removed </li>
+ * </ul>
+ */
+ public void _insert() {
+ boolean res = true ;
+ try {
+ XMultiServiceFactory xMSF = tParam.getMSF();
+ element = xMSF.createInstance(
+ "com.sun.star.reflection.TypeDescriptionProvider");
+
+
+ oObj.insert(element) ;
+
+ if (!oObj.has(element)) {
+ res = false ;
+ log.println("After adding element method has()" +
+ " returned false") ;
+ hasResult = false ;
+ }
+ } catch (com.sun.star.container.ElementExistException e) {
+ e.printStackTrace(log) ;
+ res = false ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ res = false ;
+ }
+ catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("insert()", res) ;
+ }
+
+ /**
+ * Through <code>XEnumeration</code> interface an element from the set
+ * is retrieved. Then this element removed.<p>
+ * Has <b> OK </b> status if after removing <code>has()</code> method
+ * returns false.
+ */
+ public void _remove() {
+ requiredMethod("insert()");
+ boolean res = true ;
+
+ try {
+
+ // get an element to be removed/inserted
+
+ oObj.remove(element) ;
+
+ if (oObj.has(element)) {
+ res = false ;
+ log.println("After removing element method has()" +
+ " returned true") ;
+ hasResult = false ;
+ }
+
+
+
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log) ;
+ res = false ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log) ;
+ res = false ;
+ }
+
+ tRes.tested("remove()", res) ;
+ }
+
+ /**
+ * Does nothing. Testing performed in previous methods.<p>
+ * Has <b> OK </b> status if after <code>remove()</code> call
+ * methods returned <code>false</code>, and after <code>remove()</code>
+ * call methods returned <code>true</code>.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insert() </code> : here the method is checked </li>
+ * <li> <code> remove() </code> : here the method is checked </li>
+ * </ul>
+ */
+ public void _has() {
+
+ requiredMethod("insert()") ;
+ requiredMethod("remove()") ;
+
+ tRes.tested("has()", hasResult) ;
+ }
+
+} // finished class _XSet
+
diff --git a/qadevOOo/tests/java/ifc/datatransfer/_XDataFormatTranslator.java b/qadevOOo/tests/java/ifc/datatransfer/_XDataFormatTranslator.java
new file mode 100644
index 000000000000..d99c8bdd5dae
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/datatransfer/_XDataFormatTranslator.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataFormatTranslator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.datatransfer;
+
+import com.sun.star.datatransfer.DataFlavor;
+import com.sun.star.datatransfer.XDataFormatTranslator;
+import com.sun.star.uno.Type;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.datatransfer.XDataFormatTranslator</code>
+* interface methods :
+* <ul>
+* <li><code> getSystemDataTypeFromDataFlavor()</code></li>
+* <li><code> getDataFlavorFromSystemDataType()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.datatransfer.XDataFormatTranslator
+*/
+public class _XDataFormatTranslator extends MultiMethodTest {
+
+ public XDataFormatTranslator oObj = null;
+
+ /**
+ * Get a system data type for 'text/html' MIME type. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned.
+ */
+ public void _getSystemDataTypeFromDataFlavor() {
+ DataFlavor df = new DataFlavor
+ ("text/html","HTML-Documents", new Type());
+ Object res = oObj.getSystemDataTypeFromDataFlavor(df);
+ tRes.tested("getSystemDataTypeFromDataFlavor()",res != null);
+ }
+
+ /**
+ * Gets data flavour from system data type, which was gotten
+ * from 'text/html' MIME type. <p>
+ * Has <b>OK</b> status if DataFlavour returned has 'text/hrml' MIME
+ * type.
+ */
+ public void _getDataFlavorFromSystemDataType() {
+ DataFlavor in = new DataFlavor
+ ("text/html","HTML-Documents", new Type());
+ Object res = oObj.getSystemDataTypeFromDataFlavor(in);
+ DataFlavor out = oObj.getDataFlavorFromSystemDataType(res);
+ tRes.tested("getDataFlavorFromSystemDataType()",
+ out.MimeType.equals("text/html"));
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/datatransfer/_XMimeContentTypeFactory.java b/qadevOOo/tests/java/ifc/datatransfer/_XMimeContentTypeFactory.java
new file mode 100644
index 000000000000..3536f6473b5e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/datatransfer/_XMimeContentTypeFactory.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMimeContentTypeFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.datatransfer;
+
+import com.sun.star.datatransfer.XMimeContentType;
+import com.sun.star.datatransfer.XMimeContentTypeFactory;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.datatransfer.XMimeContentTypeFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createMimeContentType()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.datatransfer.XMimeContentTypeFactory
+*/
+public class _XMimeContentTypeFactory extends MultiMethodTest {
+
+ public XMimeContentTypeFactory oObj = null;
+
+ /**
+ * First tries to create 'image/jpeg' MIME type and checks that
+ * valid <code>XMimeContentType</code> object was created.
+ * Second tries to create type with wrong argument and exception
+ * throwing is checked. <p>
+ * Has <b>OK</b> status if in the first case valid object is
+ * returned and in the second case <code>IllegalArgumentException</code>
+ * was thrown.
+ */
+ public void _createMimeContentType() {
+ boolean result = true ;
+
+ try {
+ XMimeContentType type = oObj.createMimeContentType("image/jpeg") ;
+
+ if (type != null) {
+ String typeS = type.getFullMediaType() ;
+
+ log.println("MediaType = '" + type.getMediaType() + "'") ;
+ log.println("MediaSubType = '" + type.getMediaSubtype() + "'") ;
+ log.println("FullMediaType = '" + typeS + "'") ;
+
+ result = "image/jpeg".equals(typeS) ;
+ } else {
+ log.println("!!! Null was returned !!!") ;
+ result = false ;
+ }
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured : " ) ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ try {
+ XMimeContentType type = oObj.createMimeContentType("nosuchtype") ;
+
+ log.println("!!! No exception was thrown on wrong MIME type !!!") ;
+ result = false ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Right exception was thrown." ) ;
+ }
+
+ tRes.tested("createMimeContentType()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboard.java b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboard.java
new file mode 100644
index 000000000000..d30fe4625af6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboard.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XClipboard.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.datatransfer.clipboard;
+
+import com.sun.star.datatransfer.DataFlavor;
+import com.sun.star.datatransfer.XTransferable;
+import com.sun.star.datatransfer.clipboard.XClipboard;
+import com.sun.star.datatransfer.clipboard.XClipboardOwner;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.datatransfer.clipboard.XClipboard</code>
+* interface methods :
+* <ul>
+* <li><code> getContents()</code></li>
+* <li><code> setContents()</code></li>
+* <li><code> getName()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.datatransfer.clipboard.XClipboard
+*/
+public class _XClipboard extends MultiMethodTest {
+
+ public XClipboard oObj;
+
+ MyTransferable myTransferable1;
+ MyTransferable myTransferable2;
+
+ MyOwner myOwner;
+
+ /**
+ * <code>XClipboardOwner</code> interface implementation which
+ * stores parameters passed to <code>lostOwnership</code> method.
+ */
+ class MyOwner implements XClipboardOwner {
+ XClipboard board;
+ XTransferable contents;
+
+ public void lostOwnership(XClipboard board, XTransferable contents) {
+ this.board = board;
+ this.contents = contents;
+ }
+
+ }
+
+ /**
+ * Simpliest <code>XTransferable</code> interface implementation.
+ */
+ class MyTransferable implements XTransferable {
+ public Object getTransferData(DataFlavor dataFlavor) {
+ return "";
+ }
+
+ public com.sun.star.datatransfer.DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[0];
+ }
+
+ public boolean isDataFlavorSupported(DataFlavor dataFlavor) {
+ return false;
+ }
+
+ }
+
+ /**
+ * Initially sets the content of the clipboard.
+ */
+ public void before() {
+ oObj.setContents(myTransferable1 = new MyTransferable(),
+ myOwner = new MyOwner());
+ }
+
+ /**
+ * Gets the name of the clipboard. <p>
+ * Has <b>OK</b> status if not <code>null</code> value returned.
+ */
+ public void _getName() {
+ String name = oObj.getName();
+ tRes.tested("getName()", oObj.getName() != null);
+ }
+
+ /**
+ * Gets the contents of the clipboard. <p>
+ * Has <b>OK</b> status if the content obtained is equal to content
+ * set in <code>before</code> method.
+ */
+ public void _getContents() {
+ tRes.tested("getContents()", oObj.getContents() == myTransferable1);
+ }
+
+ /**
+ * Sets new contents for the clipboard. Then checks if it was set,
+ * and if <code>lostOwnerShip()</code> notification of the prevoius
+ * contents was called with appropriate parameters.<p>
+ * Has <b> OK </b> status if <code>getContents</code> returns the same
+ * object which is set, and notification was received.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getContents() </code> : for right testing order </li>
+ * </ul>
+ */
+ public void _setContents() {
+ requiredMethod("getContents()");
+ myTransferable2 = new MyTransferable();
+
+ oObj.setContents(myTransferable2, new MyOwner());
+
+ log.println("sleeping for 1 second");
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ log.println("interrupted");
+ e.printStackTrace(log);
+ throw new StatusException("Operation interrupted", e);
+ }
+
+ tRes.tested("setContents()", oObj.getContents() == myTransferable2);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardEx.java b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardEx.java
new file mode 100644
index 000000000000..70267fec166f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardEx.java
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XClipboardEx.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.datatransfer.clipboard;
+
+import com.sun.star.datatransfer.clipboard.XClipboardEx;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.datatransfer.clipboard.XClipboardEx</code>
+* interface methods :
+* <ul>
+* <li><code> getRenderingCapabilities()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.datatransfer.clipboard.XClipboardEx
+*/
+public class _XClipboardEx extends MultiMethodTest {
+
+ public XClipboardEx oObj;
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _getRenderingCapabilities() {
+ byte caps = oObj.getRenderingCapabilities();
+ tRes.tested("getRenderingCapabilities()", true);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardNotifier.java b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardNotifier.java
new file mode 100644
index 000000000000..136e9351787f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardNotifier.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XClipboardNotifier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.datatransfer.clipboard;
+
+import com.sun.star.datatransfer.DataFlavor;
+import com.sun.star.datatransfer.XTransferable;
+import com.sun.star.datatransfer.clipboard.ClipboardEvent;
+import com.sun.star.datatransfer.clipboard.XClipboard;
+import com.sun.star.datatransfer.clipboard.XClipboardListener;
+import com.sun.star.datatransfer.clipboard.XClipboardNotifier;
+import com.sun.star.datatransfer.clipboard.XClipboardOwner;
+import com.sun.star.lang.EventObject;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.datatransfer.clipboard.XClipboardNotifier</code>
+* interface methods :
+* <ul>
+* <li><code> addClipboardListener()</code></li>
+* <li><code> removeClipboardListener()</code></li>
+* </ul> <p>
+* The object <b>must also implement</b> <code>XClipboard</code>
+* interface. <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.datatransfer.clipboard.XClipboardNotifier
+* @see com.sun.star.datatransfer.clipboard.XClipboard
+*/
+public class _XClipboardNotifier extends MultiMethodTest {
+
+ public XClipboardNotifier oObj;
+
+ /**
+ * <code>XClipboardOwner</code> interface implementation which
+ * stores parameters passed to <code>lostOwnership</code> method.
+ */
+ class MyOwner implements XClipboardOwner {
+ XClipboard board;
+ XTransferable contents;
+
+ public void lostOwnership(XClipboard board, XTransferable contents) {
+ this.board = board;
+ this.contents = contents;
+ }
+ }
+
+ /**
+ * Simpliest <code>XTransferable</code> interface implementation
+ * which supports "text/htmp" data type.
+ */
+ class MyTransferable implements XTransferable {
+ DataFlavor[] supportedFlavors;
+
+ public MyTransferable() {
+ supportedFlavors = new DataFlavor[] {
+ new DataFlavor("text/plain", "Plain text", new Type(String.class))
+ };
+ }
+
+ public Object getTransferData(DataFlavor dataFlavor) {
+ return "";
+ }
+
+ public DataFlavor[] getTransferDataFlavors() {
+ return supportedFlavors;
+ }
+
+ public boolean isDataFlavorSupported(DataFlavor dataFlavor) {
+ return supportedFlavors[0].MimeType.equals(dataFlavor.MimeType);
+ }
+ }
+
+ /**
+ * Implementation of listener which registers its method calls.
+ */
+ class MyClipboardListener implements XClipboardListener {
+ boolean called = false;
+
+ public void changedContents(ClipboardEvent evt) {
+ called = true;
+ }
+
+ public void disposing(EventObject wvt) {
+ log.println("");
+ }
+ }
+
+ MyClipboardListener myListener;
+
+ /**
+ * Adds a listener and put a new contents into clipboard. <p>
+ * Has <b> OK </b> status if the listener was called on contents changing.
+ */
+ public void _addClipboardListener() {
+ oObj.addClipboardListener(myListener = new MyClipboardListener());
+
+ XClipboard board = (XClipboard)UnoRuntime.queryInterface(
+ XClipboard.class, tEnv.getTestObject());
+
+ board.setContents(new MyTransferable(), new MyOwner());
+
+ log.println("sleeping for 1 second");
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ log.println("interrupted");
+ e.printStackTrace(log);
+ throw new StatusException("Operation interrupted", e);
+ }
+
+ tRes.tested("addClipboardListener()", myListener.called);
+ }
+
+ /**
+ * Removes the listener and put a new contents into clipboard. <p>
+ * Has <b> OK </b> status if the listener was not called on contents
+ * changing.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>addClipboardListener()</code> </li>
+ * </ul>
+ */
+ public void _removeClipboardListener() {
+ try {
+ requiredMethod("addClipboardListener()");
+ myListener.called = false;
+ } finally {
+ oObj.removeClipboardListener(myListener);
+ }
+
+ XClipboard board = (XClipboard)UnoRuntime.queryInterface(
+ XClipboard.class, oObj);
+
+ board.setContents(new MyTransferable(), new MyOwner());
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ log.println("interrupted");
+ e.printStackTrace(log);
+ throw new StatusException("Operation interrupted", e);
+ }
+
+ tRes.tested("removeClipboardListener()", !myListener.called);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XFlushableClipboard.java b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XFlushableClipboard.java
new file mode 100644
index 000000000000..98a7905972a2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XFlushableClipboard.java
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFlushableClipboard.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.datatransfer.clipboard;
+
+import com.sun.star.datatransfer.clipboard.XFlushableClipboard;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.datatransfer.clipboard.XFlushableClipboard</code>
+* interface methods :
+* <ul>
+* <li><code> flushClipboard()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.datatransfer.clipboard.XFlushableClipboard
+*/
+public class _XFlushableClipboard extends MultiMethodTest {
+
+ public XFlushableClipboard oObj;
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _flushClipboard() {
+ oObj.flushClipboard();
+ tRes.tested("flushClipboard()",true);
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/document/_DocumentInfo.java b/qadevOOo/tests/java/ifc/document/_DocumentInfo.java
new file mode 100644
index 000000000000..a563066b5a70
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_DocumentInfo.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DocumentInfo.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.util.DateTime;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.document.DocumentInfo</code>
+* service properties : <p>
+* <ul>
+* <li> <code> Author </code> </li>
+* <li> <code> AutoloadEnabled </code> </li>
+* <li> <code> AutoloadSecs </code> </li>
+* <li> <code> AutoloadURL </code> </li>
+* <li> <code> BlindCopiesTo </code> </li>
+* <li> <code> CopyTo </code> </li>
+* <li> <code> CreationDate </code> </li>
+* <li> <code> DefaultTarget </code> </li>
+* <li> <code> Description </code> </li>
+* <li> <code> InReplyTo </code> </li>
+* <li> <code> IsEncrypted </code> </li>
+* <li> <code> Keywords </code> </li>
+* <li> <code> MIMEType </code> </li>
+* <li> <code> ModifiedBy </code> </li>
+* <li> <code> ModifyDate </code> </li>
+* <li> <code> Newsgroups </code> </li>
+* <li> <code> Original </code> </li>
+* <li> <code> PrintDate </code> </li>
+* <li> <code> PrintedBy </code> </li>
+* <li> <code> Priority </code> </li>
+* <li> <code> Recipient </code> </li>
+* <li> <code> References </code> </li>
+* <li> <code> ReplyTo </code> </li>
+* <li> <code> Template </code> </li>
+* <li> <code> TemplateDate </code> </li>
+* <li> <code> Theme </code> </li>
+* <li> <code> Title </code> </li>
+* </ul>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.document.DocumentInfo
+*/
+public class _DocumentInfo extends MultiPropertyTest {
+
+ /**
+ * Overrides compare method. Can compare <code>DateTime</code>
+ * structures.
+ */
+ protected boolean compare(Object ob1, Object ob2) {
+ if (ob1 instanceof DateTime && ob2 instanceof DateTime) {
+ DateTime dt1 = (DateTime)ob1;
+ DateTime dt2 = (DateTime)ob2;
+
+ return dt1.Year == dt2.Year
+ && dt1.Month == dt2.Month
+ && dt1.Day == dt2.Day
+ && dt1.Hours == dt2.Hours
+ && dt1.Minutes == dt2.Minutes
+ && dt1.Seconds == dt2.Seconds
+ && dt1.HundredthSeconds == dt2.HundredthSeconds;
+ } else {
+ return super.compare(ob1, ob2);
+ }
+ }
+
+ /**
+ * Prints DateTime.
+ */
+ protected String toString(Object obj) {
+ if (obj instanceof DateTime) {
+ DateTime dt = (DateTime)obj;
+
+ return dt.Year + ":" + dt.Month + ":" + dt.Day
+ + ":" + dt.Hours + ":" + dt.Minutes
+ + ":" + dt.Seconds + ":" + dt.HundredthSeconds;
+ } else {
+ return super.toString(obj);
+ }
+ }
+
+ /**
+ * Tester for properties with <code>DateTime</code> type which
+ * creates new structure if old property value was null.
+ */
+ class DatePropertyTester extends PropertyTester {
+ protected Object getNewValue(String propName,
+ Object oldValue) {
+ if (oldValue == null) {
+ DateTime dt = new DateTime();
+
+ dt.Year = 2000;
+ dt.Month = 10;
+ dt.Day = 18;
+ dt.Hours = 19;
+ dt.Minutes = 41;
+
+ return dt;
+ } else {
+ return super.getNewValue(propName, oldValue);
+ }
+ }
+ }
+
+ /**
+ * Can be void.
+ */
+ public void _PrintDate() {
+ testProperty("PrintDate", new DatePropertyTester());
+ }
+
+ /**
+ * Can be void.
+ */
+ public void _TemplateDate() {
+ testProperty("TemplateDate", new DatePropertyTester());
+ }
+
+ /**
+ * Can be void.
+ */
+ public void _ModifyDate() {
+ testProperty("ModifyDate", new DatePropertyTester());
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/document/_ExportFilter.java b/qadevOOo/tests/java/ifc/document/_ExportFilter.java
new file mode 100644
index 000000000000..12b1b341d542
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_ExportFilter.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ExportFilter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.document.ExportFilter</code>
+* service properties :
+* <ul>
+* <li><code> Type</code></li>
+* <li><code> UIName</code></li>
+* <li><code> DocumentService</code></li>
+* <li><code> FilterService</code></li>
+* <li><code> Flags</code></li>
+* <li><code> UserData</code></li>
+* <li><code> FileFormatVersion</code></li>
+* <li><code> TemplateName</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.document.ExportFilter
+*/
+public class _ExportFilter extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/document/_ImportFilter.java b/qadevOOo/tests/java/ifc/document/_ImportFilter.java
new file mode 100644
index 000000000000..5e459a861041
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_ImportFilter.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ImportFilter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+/**
+* Testing <code>com.sun.star.document.ImportFilter</code>
+* service properties :
+* <ul>
+* <li><code> Type</code></li>
+* <li><code> UIName</code></li>
+* <li><code> DocumentService</code></li>
+* <li><code> FilterService</code></li>
+* <li><code> Flags</code></li>
+* <li><code> UserData</code></li>
+* <li><code> FileFormatVersion</code></li>
+* <li><code> TemplateName</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.document.ImportFilter
+*/
+import lib.MultiPropertyTest;
+
+public class _ImportFilter extends MultiPropertyTest {
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/document/_OfficeDocument.java b/qadevOOo/tests/java/ifc/document/_OfficeDocument.java
new file mode 100644
index 000000000000..abe1d56cf01c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_OfficeDocument.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _OfficeDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.document.OfficeDocument</code>
+* service properties :
+* <ul>
+* <li><code> AutomaticControlFocus</code></li>
+* <li><code> ApplyFormDesignMode</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.document.OfficeDocument
+*/
+public class _OfficeDocument extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/document/_XActionLockable.java b/qadevOOo/tests/java/ifc/document/_XActionLockable.java
new file mode 100644
index 000000000000..ff86b33f2714
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XActionLockable.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XActionLockable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.document.XActionLockable;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.document.XActionLockable</code>
+* interface methods :
+* <ul>
+* <li><code> isActionLocked()</code></li>
+* <li><code> addActionLock()</code></li>
+* <li><code> removeActionLock()</code></li>
+* <li><code> setActionLocks()</code></li>
+* <li><code> resetActionLocks()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.document.XActionLockable
+*/
+public class _XActionLockable extends MultiMethodTest {
+ public XActionLockable oObj = null;
+
+ /**
+ * Method addActionLock called first and then
+ * checked value returned by isActionLocked().<p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is true.
+ */
+ public void _isActionLocked() {
+ //determines if at least one lock exists
+ oObj.addActionLock();
+ boolean result = oObj.isActionLocked();
+ tRes.tested("isActionLocked()", result);
+ }
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _addActionLock() {
+ requiredMethod("resetActionLocks()");
+ oObj.addActionLock();
+ tRes.tested("addActionLock()", true);
+ }
+
+ /**
+ * Calls the method and check value returned by isActionLocked(). <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is false.
+ */
+ public void _removeActionLock() {
+ requiredMethod("addActionLock()");
+ oObj.removeActionLock();
+ boolean result = ! oObj.isActionLocked();
+ tRes.tested("removeActionLock()", result);
+ }
+
+ /**
+ * Calls the method with specific value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _setActionLocks() {
+ oObj.setActionLocks( nLock );
+ tRes.tested("setActionLocks()", true);
+ }
+
+ final short nLock = 8;
+
+ /**
+ * Calls the method and checks returned value.<p>
+ * Has <b> OK </b> status if the component is not currently
+ * locked and returned value is the same as locks number
+ * set by <code>setActionLocks</code> method test.
+ */
+ public void _resetActionLocks() {
+ requiredMethod("setActionLocks()");
+ short nLocksBeforeReset = oObj.resetActionLocks();
+ boolean result = !oObj.isActionLocked() && nLocksBeforeReset == nLock;
+ tRes.tested("resetActionLocks()", result);
+ }
+}// finish class _XActionLockable
+
diff --git a/qadevOOo/tests/java/ifc/document/_XDocumentInfo.java b/qadevOOo/tests/java/ifc/document/_XDocumentInfo.java
new file mode 100644
index 000000000000..a63f3309b082
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XDocumentInfo.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDocumentInfo.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.document.XDocumentInfo;
+import com.sun.star.lang.ArrayIndexOutOfBoundsException;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.document.XDocumentInfo</code>
+* interface methods :
+* <ul>
+* <li><code> getUserFieldCount()</code></li>
+* <li><code> getUserFieldName()</code></li>
+* <li><code> setUserFieldName()</code></li>
+* <li><code> getUserFieldValue()</code></li>
+* <li><code> setUserFieldValue()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.document.XDocumentInfo
+*/
+public class _XDocumentInfo extends MultiMethodTest {
+
+ public XDocumentInfo oObj = null;
+
+ short fieldCount;
+
+ /**
+ * Gets user field count. <p>
+ * Has <b> OK </b> status if count is positive.
+ */
+ public void _getUserFieldCount() {
+ fieldCount = oObj.getUserFieldCount();
+ tRes.tested("getUserFieldCount()", fieldCount >= 0);
+ }
+
+ String[] oldNames;
+ String[] oldValues;
+
+ /**
+ * Retrieves all user field names and stores them. <p>
+ * Has <b> OK </b> status if no exceptions were thrown and
+ * names returned are not <code>null</code> values. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getUserFieldCount() </code> : to obtain number of
+ * fields </li>
+ * </ul>
+ */
+ public void _getUserFieldName() {
+ requiredMethod("getUserFieldCount()");
+
+ oldNames = new String[fieldCount];
+
+ for (short i = 0; i < fieldCount; i++) {
+ try {
+ oldNames[i] = oObj.getUserFieldName(i);
+ if (oldNames[i] == null) {
+ tRes.tested("getUserFieldName()", false);
+ return;
+ }
+ } catch (ArrayIndexOutOfBoundsException e) {
+ log.println("Couldn't get an user field name at " + i);
+ tRes.tested("getUserFieldName()", false);
+ return;
+ }
+ }
+
+ tRes.tested("getUserFieldName()", true);
+ }
+
+ /**
+ * For each field its name changed and the checked if it's properly
+ * changed. Finally old names are restored.<p>
+ * Has <b> OK </b> status if names were properly changed. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getUserFieldName() </code> : to retrieve old names </li>
+ * </ul>
+ */
+ public void _setUserFieldName() {
+ requiredMethod("getUserFieldName()");
+
+ boolean passed = true;
+
+ for (short i = 0; i < fieldCount; i++) {
+ String newName = oldNames[i] + "_new";
+
+ try {
+ oObj.setUserFieldName(i, newName);
+ } catch (ArrayIndexOutOfBoundsException e) {
+ log.println("Couldn't set an user field name at " + i);
+ tRes.tested("setUserFieldName()", false);
+ return;
+ }
+
+ try {
+ if (!newName.equals(oObj.getUserFieldName(i))) {
+ tRes.tested("setUserFieldName()", false);
+ return;
+ }
+ } catch (ArrayIndexOutOfBoundsException e) {
+ log.println("Couldn't set an user field name at " + i);
+ tRes.tested("setUserFieldName()", false);
+ return;
+ } finally {
+ try {
+ oObj.setUserFieldName(i, oldNames[i]);
+ } catch (ArrayIndexOutOfBoundsException e) {
+ log.println("Couldn't restore an user field name at " + i);
+ tRes.tested("setUserFieldName()", false);
+ return;
+ }
+ }
+ }
+
+ tRes.tested("setUserFieldName()", true);
+ }
+
+
+ /**
+ * Retrieves all user field values and stores them. <p>
+ * Has <b> OK </b> status if no exceptions were thrown and
+ * values returned are not <code>null</code> values. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getUserFieldCount() </code> : to obtain number of
+ * fields </li>
+ * </ul>
+ */
+ public void _getUserFieldValue() {
+ requiredMethod("getUserFieldCount()");
+
+ oldValues = new String[fieldCount];
+
+ for (short i = 0; i < fieldCount; i++) {
+ try {
+ oldValues[i] = oObj.getUserFieldValue(i);
+ if (oldValues[i] == null) {
+ tRes.tested("getUserFieldValue()", false);
+ return;
+ }
+ } catch (ArrayIndexOutOfBoundsException e) {
+ log.println("Couldn't get an user field value at " + i);
+ tRes.tested("getUserFieldValue()", false);
+ return;
+ }
+ }
+
+ tRes.tested("getUserFieldValue()", true);
+ }
+
+ /**
+ * For each field its value changed and the checked if it's properly
+ * changed. Finally old values are restored.<p>
+ * Has <b> OK </b> status if values were properly changed. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getUserFieldValue() </code> : to retrieve old values. </li>
+ * </ul>
+ */
+ public void _setUserFieldValue() {
+ requiredMethod("getUserFieldValue()");
+
+ boolean passed = true;
+
+ for (short i = 0; i < fieldCount; i++) {
+ String newValue = oldValues[i] + "_new";
+
+ try {
+ oObj.setUserFieldValue(i, newValue);
+ } catch (ArrayIndexOutOfBoundsException e) {
+ log.println("Couldn't set an user field value at " + i);
+ tRes.tested("setUserFieldValue()", false);
+ return;
+ }
+
+ try {
+ if (!newValue.equals(oObj.getUserFieldValue(i))) {
+ tRes.tested("setUserFieldValue()", false);
+ return;
+ }
+ } catch (ArrayIndexOutOfBoundsException e) {
+ log.println("Couldn't set an user field value at " + i);
+ tRes.tested("setUserFieldValue()", false);
+ return;
+ } finally {
+ try {
+ oObj.setUserFieldValue(i, oldNames[i]);
+ } catch (ArrayIndexOutOfBoundsException e) {
+ log.println("Couldn't restore an user field value at " + i);
+ tRes.tested("setUserFieldValue()", false);
+ return;
+ }
+ }
+ }
+
+ tRes.tested("setUserFieldValue()", true);
+ }
+
+} // finish class _XDocumentInfo
+
diff --git a/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java b/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java
new file mode 100644
index 000000000000..532e8eacff86
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDocumentInsertable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.document.XDocumentInsertable;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.utils;
+
+
+/**
+* Testing <code>com.sun.star.document.XDocumentInsertable</code>
+* interface methods :
+* <ul>
+* <li><code> insertDocumentFromURL()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XDocumentInsertable.Checker'</code>
+* (of type <code>_XDocumentInsertable.InsertChecker</code>)
+* <b> optional </b> :
+* relation for checking if document was inserted properly and
+* for obtaining document file name. For details see the class
+* description. If the relation doesn't exist default document
+* name is used, and <code>XTextRange</code> interface of
+* component is used for checking.</li>
+* <ul> <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code>XDocumentInsertable.sxw</code> : StarWriter document
+* which content started with 'XDocumentInsertable test.' string.
+* The file is needed if no other file name specified by relation.
+* </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.document.XDocumentInsertable
+*/
+public class _XDocumentInsertable extends MultiMethodTest {
+
+ public XDocumentInsertable oObj = null;
+ protected XTextRange range = null ;
+ protected static final String defaultFileName = "XDocumentInsertable.sxw" ;
+ protected InsertChecker checker = null ;
+ protected String fileName = defaultFileName ;
+
+ /**
+ * Abstract class for relation passing. It must check if
+ * document was inserted successfully and can specify its
+ * own document name to be inserted.
+ */
+ public static abstract class InsertChecker {
+ /**
+ * Must be overriden to check if document was
+ * successfully inserted.
+ * @return <code>true</code> if document was inserted.
+ */
+ public abstract boolean isInserted() ;
+ /**
+ * Can be overriden to specify different than default
+ * document name. This document must be situated in
+ * the test document disrectory, and its name must
+ * be specified relational to this directory. By
+ * default 'XDocumentInsertable.swx' file name returned.
+ * @return File name of the document to be inserted.
+ */
+ public String getFileNameToInsert() {
+ return defaultFileName ;
+ }
+ }
+
+ /**
+ * Retrieves object relation. If the relation is not found
+ * then the object tested is tried to query <code>XTextRange</code>
+ * interface for testing. If the relation is found then document name
+ * for testing is retrieved, else the default one is used.
+ *
+ * @throws StatusException If neither relation found nor
+ * <code>XTextRange</code> interface is queried.
+ */
+ public void before() {
+ checker = (InsertChecker)
+ tEnv.getObjRelation("XDocumentInsertable.Checker") ;
+
+ if (checker == null) {
+ log.println("Relaion not found, trying to query for "+
+ "XTextRange ...") ;
+ range = (XTextRange)
+ UnoRuntime.queryInterface (XTextRange.class, oObj) ;
+ if (range == null) {
+ log.println("XTextRange isn't supported by the component.");
+ throw new StatusException(Status.failed
+ ("XTextRange isn't supported and relation not found")) ;
+ }
+ } else {
+ fileName = checker.getFileNameToInsert();
+ }
+ }
+
+ /**
+ * Tries to insert document from URL specified by relation or
+ * from default URL. If no relation was passed, text range is
+ * checked for existance of loaded document content. In case
+ * if relation was found, then its <code>isInserted</code>
+ * method is used to check insertion.<p>
+ *
+ * Has <b> OK </b> status if insertion was completed successfully
+ * and no exceptions were thrown. <p>
+ */
+ public void _insertDocumentFromURL() {
+ boolean result = true ;
+
+ try {
+ PropertyValue [] szEmptyArgs = new PropertyValue [0];
+ String docURL = utils.getFullTestURL(fileName) ;
+ log.println("Inserting document from URL '" + docURL + "'");
+ oObj.insertDocumentFromURL(docURL, szEmptyArgs);
+
+ if (checker == null) {
+ log.println("Checker is not specified, testing through "+
+ "XTextRange ...") ;
+ String text = range.getString() ;
+ log.println("Document text :\n" + text);
+ log.println("---");
+ result &= ( text.indexOf("XDocumentInsertable test.") >= 0 );
+ } else {
+ result &= checker.isInserted();
+ }
+
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured while testing "+
+ "insertDocumentFromURL()");
+ ex.printStackTrace(log);
+ result = false ;
+ } catch (com.sun.star.io.IOException ex) {
+ log.println("Exception occured while testing "+
+ "insertDocumentFromURL()");
+ ex.printStackTrace(log);
+ result = false ;
+ }
+
+ tRes.tested("insertDocumentFromURL()", result);
+ }
+} // finish class _XDocumentInsertable
+
diff --git a/qadevOOo/tests/java/ifc/document/_XEmbeddedObjectSupplier.java b/qadevOOo/tests/java/ifc/document/_XEmbeddedObjectSupplier.java
new file mode 100644
index 000000000000..fc029b10fcea
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XEmbeddedObjectSupplier.java
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XEmbeddedObjectSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.document.XEmbeddedObjectSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.document.XEmbeddedObjectSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getEmbeddedObject()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.document.XEmbeddedObjectSupplier
+*/
+public class _XEmbeddedObjectSupplier extends MultiMethodTest {
+
+ public XEmbeddedObjectSupplier oObj = null;
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned.
+ */
+ public void _getEmbeddedObject() {
+ tRes.tested("getEmbeddedObject()",
+ oObj.getEmbeddedObject() != null);
+ }
+} // finish class _XEmbeddedObjectSupplier
+
diff --git a/qadevOOo/tests/java/ifc/document/_XEventsSupplier.java b/qadevOOo/tests/java/ifc/document/_XEventsSupplier.java
new file mode 100644
index 000000000000..4d52ae7a5f01
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XEventsSupplier.java
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XEventsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.container.XNameReplace;
+import com.sun.star.document.XEventsSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.document.XEventsSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getEvents()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.document.XEventsSupplier
+*/
+public class _XEventsSupplier extends MultiMethodTest {
+
+ public XEventsSupplier oObj = null;
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned.
+ */
+ public void _getEvents() {
+
+ XNameReplace xNR = oObj.getEvents();
+ String str[] = xNR.getElementNames();
+ tRes.tested("getEvents()",xNR != null);
+ }
+
+} // finish class _XEventSupplier
+
diff --git a/qadevOOo/tests/java/ifc/document/_XExporter.java b/qadevOOo/tests/java/ifc/document/_XExporter.java
new file mode 100644
index 000000000000..a7db83a6c024
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XExporter.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+
+import com.sun.star.document.XExporter;
+import com.sun.star.lang.XComponent;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.document.XExporter</code>
+* interface methods :
+* <ul>
+* <li><code> setSourceDocument()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'SourceDocument'</code> (of type <code>XComponent</code>):
+* the source document to be passed to the method. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.document.XExporter
+*/
+public class _XExporter extends MultiMethodTest {
+
+ public XExporter oObj = null;
+ public XComponent source = null ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ source = (XComponent) tEnv.getObjRelation("SourceDocument") ;
+
+ if (source == null) throw new StatusException(Status.failed
+ ("Relation not found")) ;
+ }
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ * Usually this interface is supported both with <code>XFilter</code>
+ * where source document setting is checked.
+ */
+ public void _setSourceDocument() {
+ boolean result = true ;
+
+ try {
+ oObj.setSourceDocument(source);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception while checking :");
+ ex.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("setSourceDocument()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/document/_XFilter.java b/qadevOOo/tests/java/ifc/document/_XFilter.java
new file mode 100644
index 000000000000..8e26bde051fe
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XFilter.java
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFilter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+
+import com.sun.star.beans.PropertyValue;
+
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.lang.XComponent;
+import com.sun.star.document.XExporter;
+import com.sun.star.document.XFilter;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.document.XFilter</code>
+* interface methods :
+* <ul>
+* <li><code> filter()</code></li>
+* <li><code> cancel()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'MediaDescriptor'</code> (of type <code>PropertyValue[]</code>):
+* the property set described in
+* <code>com.sun.star.document.MediaDescriptor</code>
+* </li>
+* <li> <code>'XFilter.Checker'</code> <b>(optional)</b> (of type
+* <code>ifc.document._XFilter.FilterChecker</code>) : implementation
+* of interface must allow checking that document was exported successfully.
+* If the relation doesn't exist then by default successfull filtering
+* assumed.
+* </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.document.XFilter
+*/
+public class _XFilter extends MultiMethodTest {
+
+ public static interface FilterChecker {
+ boolean checkFilter() ;
+ }
+
+ public XFilter oObj = null;
+ protected PropertyValue[] mDesc = null ;
+ protected FilterChecker checker = null ;
+ protected XComponent sourceDoc = null;
+ protected boolean dummy = false;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.<br>
+ * In case of Importers only a dummy implementation exists
+ * therefore the methods of this interface will be skipped
+ * in this case
+ */
+ public void before() {
+ String name = tEnv.getTestCase().getObjectName();
+ if (name.indexOf("Importer")>0) {
+ log.println(name+" contains only a dummy implementation");
+ log.println("therefore all methods are skipped");
+ dummy = true;
+ }
+ mDesc = (PropertyValue[]) tEnv.getObjRelation("MediaDescriptor") ;
+ checker = (FilterChecker) tEnv.getObjRelation("XFilter.Checker") ;
+ if (mDesc == null && !dummy) throw new StatusException(
+ Status.failed("Relation not found.")) ;
+ sourceDoc = (XComponent)tEnv.getObjRelation("SourceDocument");
+ try {
+ if (sourceDoc != null) {
+ XExporter xEx = (XExporter)UnoRuntime.queryInterface(
+ XExporter.class,oObj);
+ xEx.setSourceDocument(sourceDoc);
+ }
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e) {}
+ }
+
+ public void after() {
+ if (dummy) {
+ throw new StatusException(Status.skipped(true));
+ }
+ }
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _filter() {
+ if (dummy) {
+ tRes.tested("filter()", true);
+ return;
+ }
+ boolean result = true ;
+ result = oObj.filter(mDesc) ;
+
+ if (checker == null) {
+ log.println("!!! Warning : cann't check filter as no relation found");
+ } else {
+ result &= checker.checkFilter() ;
+ }
+
+ tRes.tested("filter()", result) ;
+ }
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _cancel() {
+ if (dummy) {
+ tRes.tested("cancel()",true);
+ return;
+ }
+ requiredMethod("filter()");
+ if (tEnv.getObjRelation("NoFilter.cancel()") != null) {
+ System.out.println("Cancel not tested.");
+ log.println("Method 'cancel()' is not working and therefore "+
+ "not tested.\nResult is set to SKIPPED.OK");
+ tRes.tested("cancel()", Status.skipped(true));
+ return;
+ }
+
+ boolean result = false ;
+ FilterThread newFilter = new FilterThread(oObj);
+ newFilter.mdesc = mDesc;
+ newFilter.start();
+ oObj.cancel();
+ while (newFilter.isAlive()) {
+ }
+ result = !newFilter.filterRes;
+ tRes.tested("cancel()", result) ;
+ }
+
+ /**
+ * Calls <code>filter()</code> method in a separate thread.
+ * Necessary to check if the cancel method works
+ */
+ protected class FilterThread extends Thread {
+
+ public boolean filterRes = true ;
+ private XFilter Filter = null ;
+ public PropertyValue[] mdesc = null;
+
+ public FilterThread(XFilter Filter) {
+ this.Filter = Filter ;
+ }
+
+ public void run() {
+ filterRes = Filter.filter(mdesc);
+ }
+ }
+
+}
+
+
+
diff --git a/qadevOOo/tests/java/ifc/document/_XImporter.java b/qadevOOo/tests/java/ifc/document/_XImporter.java
new file mode 100644
index 000000000000..5d3c5a2446bd
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XImporter.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.document.XImporter;
+import com.sun.star.lang.XComponent;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.document.XImporter</code>
+* interface methods :
+* <ul>
+* <li><code> setTargetDocument()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'TargetDocument'</code> (of type <code>XComponent</code>):
+* the target document to be passed to the method. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.document.XImporter
+*/
+public class _XImporter extends MultiMethodTest {
+
+ public XImporter oObj = null;
+
+ /**
+ * Retrieves relation and sets target document. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured,
+ * really this method tested when the whole import result
+ * checked.
+ */
+ public void _setTargetDocument() {
+ boolean res = true;
+ try {
+ XComponent the_doc = (XComponent)
+ tEnv.getObjRelation("TargetDocument");
+ oObj.setTargetDocument(the_doc);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception while checking 'setTargetDocument'");
+ ex.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("setTargetDocument()",res);
+
+ }
+
+} // finish class _XImporter
+
diff --git a/qadevOOo/tests/java/ifc/document/_XLinkTargetSupplier.java b/qadevOOo/tests/java/ifc/document/_XLinkTargetSupplier.java
new file mode 100644
index 000000000000..d7b98a5cdeb6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XLinkTargetSupplier.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLinkTargetSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.document.XLinkTargetSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.document.XLinkTargetSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getLinks()</code></li>
+* </ul> <p>
+* @see com.sun.star.document.XLinkTargetSupplier
+*/
+public class _XLinkTargetSupplier extends MultiMethodTest {
+
+ public XLinkTargetSupplier oObj = null;
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if not <code>null</code> value returned.
+ */
+ public void _getLinks() {
+ XNameAccess links = oObj.getLinks();
+ String names[] = links.getElementNames();
+ tRes.tested("getLinks()", links != null);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/document/_XMimeTypeInfo.java b/qadevOOo/tests/java/ifc/document/_XMimeTypeInfo.java
new file mode 100644
index 000000000000..ff396e6dbbf0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XMimeTypeInfo.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMimeTypeInfo.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+
+import com.sun.star.document.XMimeTypeInfo;
+import com.sun.star.lang.XComponent;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.document.XMimeTypeInfo</code>
+ * interface methods :
+ * <ul>
+ * <li><code> supportsMimeType()</code></li>
+ * <li><code> getSupportedMimeTypeNames()</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.document.XMimeTypeInfo
+ */
+public class _XMimeTypeInfo extends MultiMethodTest {
+
+ public XMimeTypeInfo oObj = null;
+ public XComponent source = null ;
+ public String[] smi = null;
+
+ /**
+ * Gets supported types and stores them. <p>
+ * Has <b> OK </b> status if at least one type exists.
+ */
+ public void _getSupportedMimeTypeNames() {
+ smi = oObj.getSupportedMimeTypeNames();
+ tRes.tested("getSupportedMimeTypeNames()", smi.length>0) ;
+ }
+
+ /**
+ * Calls the method for one supported type retrieved by
+ * <code>getSupportedMimeTypeNames</code> method and for
+ * bad type. <p>
+ *
+ * Has <b> OK </b> status if <code>true</code> returned for
+ * supported type and <code>false</code> for bad type.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSupportedMimeTypeNames </code> : to have a list of
+ * supported types. </li>
+ * </ul>
+ */
+ public void _supportsMimeType() {
+ requiredMethod("getSupportedMimeTypeNames()");
+ boolean pos = false;
+ pos = oObj.supportsMimeType(smi[0]);
+ if (!pos) {
+ log.println("Method returns false for existing MimeType");
+ }
+ boolean neg = true;
+ neg = oObj.supportsMimeType("NoRealMimeType");
+ if (neg) {
+ log.println("Method returns true for non existing MimeType");
+ }
+ tRes.tested("supportsMimeType()", (pos && !neg)) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/document/_XStandaloneDocumentInfo.java b/qadevOOo/tests/java/ifc/document/_XStandaloneDocumentInfo.java
new file mode 100644
index 000000000000..603a7be648d8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XStandaloneDocumentInfo.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XStandaloneDocumentInfo.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XStandaloneDocumentInfo;
+import com.sun.star.io.IOException;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.document.XStandaloneDocumentInfo</code>
+* interface methods. <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DOCURL'</code> (of type <code>String</code>):
+* URL of document which info is loaded.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.document.XStandaloneDocumentInfo
+*/
+public class _XStandaloneDocumentInfo extends MultiMethodTest {
+
+ public XStandaloneDocumentInfo oObj = null;
+ String url = null;
+
+ protected void before() {
+ url = (String)tEnv.getObjRelation("DOCURL");
+ if (url == null) {
+ throw new StatusException
+ (Status.failed("Relation 'DOCURL' not found"));
+ }
+ }
+
+ String oldProp = null;
+ String newProp = null;
+ /**
+ * Sets new value of the property 'Author' and calls the method. <p>
+ * Has <b> OK </b> status if no exception occured.
+ */
+ public void _storeIntoURL() {
+ try {
+ oObj.loadFromURL(url);
+ XPropertySet propSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ oldProp = (String)propSet.getPropertyValue("Author");
+ newProp = oldProp + "_";
+ propSet.setPropertyValue("Author", newProp);
+
+ oObj.storeIntoURL(url);
+ tRes.tested("storeIntoURL()", true);
+ } catch (IOException e) {
+ log.println("Couldn't store to " + url
+ + " : " + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("storeIntoURL()", false);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get/set property 'Author':" + e);
+ tRes.tested("storeIntoURL()", false);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't get/set property 'Author':" + e);
+ tRes.tested("storeIntoURL()", false);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't get/set property 'Author':" + e);
+ tRes.tested("storeIntoURL()", false);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't get/set property 'Author':" + e);
+ tRes.tested("storeIntoURL()", false);
+ }
+ }
+
+ /**
+ * Calls the method and checks value of the property 'Author'. <p>
+ * Has <b> OK </b> status if no exception occured and value of the property
+ * 'Author' is equal to value that was set in the method
+ * <code>storeIntoURL</code>.
+ */
+ public void _loadFromURL() {
+ requiredMethod("storeIntoURL()");
+ try {
+ oObj.loadFromURL(url);
+ XPropertySet propSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ String resProp = (String)propSet.getPropertyValue("Author");
+ log.println("Was: '" + oldProp + "',Set: '" + newProp +
+ "', New: " + resProp + "'");
+ tRes.tested("loadFromURL()", resProp.equals(newProp) );
+ } catch (IOException e) {
+ log.println("Couldn't load from " + url
+ + " : " + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("loadFromURL()", false);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get/set property 'Author':" + e);
+ tRes.tested("loadFromURL()", false);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't get/set property 'Author':" + e);
+ tRes.tested("loadFromURL()", false);
+ }
+ }
+
+} // finish class _XStandaloneDocumentInfo
+
diff --git a/qadevOOo/tests/java/ifc/document/_XTypeDetection.java b/qadevOOo/tests/java/ifc/document/_XTypeDetection.java
new file mode 100644
index 000000000000..defe58e009f3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/document/_XTypeDetection.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTypeDetection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:08:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.document;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.document.XTypeDetection;
+import lib.MultiMethodTest;
+import util.utils;
+
+/**
+ * Testing <code>com.sun.star.document.XTypeDetection</code>
+ * interface methods :
+ * <ul>
+ * <li><code> queryTypeByURL()</code></li>
+ * <li><code> queryTypeByDescriptor()</code></li>
+ * </ul> <p>
+ *
+ * The following predefined files needed to complete the test:
+ * <ul>
+ * <li> <code>XTypeDetection.sxw</code> : <b>Calc</b>
+ * document which extension is <b>sxw</b>. </li>
+ * <ul> <p>
+ *
+ * @see com.sun.star.document.XTypeDetection
+ */
+public class _XTypeDetection extends MultiMethodTest {
+ public XTypeDetection oObj = null;
+
+ private String docURL = null;
+
+ /**
+ * Get the document URL.
+ */
+ public void before() {
+ docURL = utils.getFullTestURL("XTypeDetection.sxw");
+ }
+
+ /**
+ * Tries to detect type by writer document URL. <p>
+ *
+ * Has <b> OK </b> status if type returned contains
+ * 'writer' as substring.
+ */
+ public void _queryTypeByURL() {
+
+ boolean result = true ;
+ String type = oObj.queryTypeByURL(docURL) ;
+ result &= type.indexOf("writer") > -1;
+
+ tRes.tested("queryTypeByURL()", result) ;
+ }
+
+ /**
+ * Tries to detect type of the document using <i>flat</i>
+ * and <i>deep</i> detection. For flat detection a writer type
+ * must be returned (file has writer extension), but deep
+ * detection must return calc type (document has calc contents)<p>
+ *
+ * Has <b> OK </b> status if for the first case type contains
+ * 'writer' string and for the second 'calc' string.
+ */
+ public void _queryTypeByDescriptor() {
+ boolean result = true ;
+
+ PropertyValue[][] mediaDescr = new PropertyValue[1][1];
+ mediaDescr[0][0] = new PropertyValue();
+ mediaDescr[0][0].Name = "URL";
+ mediaDescr[0][0].Value = docURL;
+
+ String type = oObj.queryTypeByDescriptor(mediaDescr, false);
+ result &= type.indexOf("writer") > -1;
+
+ type = oObj.queryTypeByDescriptor(mediaDescr, true);
+ result &= type.indexOf("calc") > -1;
+
+ tRes.tested("queryTypeByDescriptor()", result) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_ConnectorProperties.java b/qadevOOo/tests/java/ifc/drawing/_ConnectorProperties.java
new file mode 100644
index 000000000000..627222732c6a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_ConnectorProperties.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ConnectorProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.ConnectorProperties</code>
+* service properties :
+* <ul>
+* <li><code> EdgeKind</code></li>
+* <li><code> EdgeNode1HorzDist</code></li>
+* <li><code> EdgeNode1VertDist</code></li>
+* <li><code> EdgeNode2HorzDist</code></li>
+* <li><code> EdgeNode2VertDist</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.ConnectorProperties
+*/
+public class _ConnectorProperties extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_ConnectorShape.java b/qadevOOo/tests/java/ifc/drawing/_ConnectorShape.java
new file mode 100644
index 000000000000..fa3873055d06
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_ConnectorShape.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ConnectorShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XShape;
+import lib.MultiPropertyTest;
+/**
+* Testing <code>com.sun.star.drawing.ConnectorShape</code>
+* service properties :
+* <ul>
+* <li><code> EdgeLine1Delta</code></li>
+* <li><code> EdgeLine2Delta</code></li>
+* <li><code> EdgeLine3Delta</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.ConnectorShape
+*/
+public class _ConnectorShape extends MultiPropertyTest {
+ public XShape[] conShapes = null;
+
+ protected void before() {
+ conShapes = (XShape[]) tEnv.getObjRelation("XConnectorShape.Shapes");
+ }
+
+ public void _EndShape() {
+ Object oldProp = null;
+ try {
+ oldProp = oObj.getPropertyValue("EndShape");
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace();
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ }
+ testProperty("EndShape",oldProp,conShapes[0]);
+ }
+
+ public void _StartShape() {
+ Object oldProp = null;
+ log.println("Special for StartShape");
+ try {
+ oldProp = oObj.getPropertyValue("StartShape");
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace();
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ }
+ testProperty("StartShape",oldProp,conShapes[1]);
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_DrawingDocument.java b/qadevOOo/tests/java/ifc/drawing/_DrawingDocument.java
new file mode 100644
index 000000000000..2bb896051e72
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_DrawingDocument.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DrawingDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.DrawingDocument</code>
+* service properties :
+* <ul>
+* <li><code> TabStop</code></li>
+* <li><code> CharLocale</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.DrawingDocument
+*/
+public class _DrawingDocument extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java b/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java
new file mode 100644
index 000000000000..f39c5f4a4044
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DrawingDocumentDrawView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.drawing.DrawingDocumentDrawView</code>
+* service properties :
+* <ul>
+* <li><code> IsMasterPageMode</code></li>
+* <li><code> IsLayerMode</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (of type <code>XDrawPage</code>):
+* a draw page which will be current page. </li>
+* <ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.DrawingDocumentDrawView
+*/
+public class _DrawingDocumentDrawView extends MultiPropertyTest {
+
+ XDrawPage drawPage = null;
+ static String test_name = "For DrawingDocumentDrawView";
+
+ protected void before() {
+ drawPage = (XDrawPage)tEnv.getObjRelation("DrawPage");
+ XNamed xNamed = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class, drawPage);
+ xNamed.setName(test_name);
+ }
+
+ /**
+ * Property tester which returns new <code>XDrawPage</code> object
+ * and compares draw pages.
+ */
+ protected PropertyTester CurPageTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return drawPage;
+ }
+
+ protected boolean compare(Object obj1, Object obj2) {
+ XNamed named1 = (XNamed)UnoRuntime.queryInterface(XNamed.class, obj1);
+ XNamed named2 = (XNamed)UnoRuntime.queryInterface(XNamed.class, obj2);
+ boolean res = false;
+
+ if (named1 != null && named2 != null) {
+ String name1 = named1.getName();
+ String name2 = named2.getName();
+ res = name1.equals(name2);
+ } else {
+ log.println("Interface XNamed not supported");
+ }
+
+ return res;
+ }
+
+ protected String toString(Object obj) {
+ XNamed named = (XNamed)UnoRuntime.queryInterface(XNamed.class, obj);
+ String res = (named == null) ? "null" : named.getName();
+ return res;
+ }
+ } ;
+
+ public void _CurrentPage() {
+ log.println("Testing with custom Property tester");
+ Object oldCurPage = null;
+ try {
+ oldCurPage = oObj.getPropertyValue("CurrentPage");
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ }
+
+ testProperty("CurrentPage", CurPageTester);
+
+ try {
+ log.println("Back old current page");
+ oObj.setPropertyValue("CurrentPage", oldCurPage);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ }
+ }
+
+ public void _IsMasterPageMode() {
+ testProperty("IsMasterPageMode");
+ try {
+ oObj.setPropertyValue("IsMasterPageMode", new Boolean(false));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ }
+ }
+
+ public void _IsLayerMode() {
+ testProperty("IsLayerMode");
+ try {
+ oObj.setPropertyValue("IsLayerMode", new Boolean(false));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_EllipseShape.java b/qadevOOo/tests/java/ifc/drawing/_EllipseShape.java
new file mode 100644
index 000000000000..62a86c4ac351
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_EllipseShape.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _EllipseShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.EllipseShape</code>
+* service properties :
+* <ul>
+* <li><code> CircleKind</code></li>
+* <li><code> CircleStartAngle</code></li>
+* <li><code> CircleEndAngle</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.EllipseShape
+*/
+public class _EllipseShape extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_FillProperties.java b/qadevOOo/tests/java/ifc/drawing/_FillProperties.java
new file mode 100644
index 000000000000..50759bc52e53
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_FillProperties.java
@@ -0,0 +1,225 @@
+/*************************************************************************
+ *
+ * $RCSfile: _FillProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.awt.XBitmap;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.drawing.FillProperties</code>
+* service properties :
+* <ul>
+* <li><code> FillStyle</code></li>
+* <li><code> FillColor</code></li>
+* <li><code> FillTransparence</code></li>
+* <li><code> FillTransparenceGradientName</code></li>
+* <li><code> FillTransparenceGradient</code></li>
+* <li><code> FillGradientName</code></li>
+* <li><code> FillGradient</code></li>
+* <li><code> FillHatchName</code></li>
+* <li><code> FillHatch</code></li>
+* <li><code> FillBitmapName</code></li>
+* <li><code> FillBitmap</code></li>
+* <li><code> FillBitmapURL</code></li>
+* <li><code> FillBitmapOffsetX</code></li>
+* <li><code> FillBitmapOffsetY</code></li>
+* <li><code> FillBitmapPositionOffsetX</code></li>
+* <li><code> FillBitmapPositionOffsetY</code></li>
+* <li><code> FillBitmapRectanglePoint</code></li>
+* <li><code> FillBitmapLogicalSize</code></li>
+* <li><code> FillBitmapSizeX</code></li>
+* <li><code> FillBitmapSizeY</code></li>
+* <li><code> FillBitmapMode</code></li>
+* <li><code> FillBackground</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.FillProperties
+*/
+public class _FillProperties extends MultiPropertyTest {
+
+ XBitmap the_bitmap = null;
+ XBitmap the_secondBitmap = null;
+
+ /**
+ * Property tester which changes URL.
+ */
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg"); else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ } ;
+
+ /**
+ * Property tester which switches two strings.
+ */
+ protected PropertyTester StringTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(str1))
+ return str2; else
+ return str1;
+ }
+ } ;
+
+ /**
+ * Property tester which switches two XBitmap objects.
+ */
+ protected PropertyTester BitmapTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (util.ValueComparer.equalValue(oldValue,the_bitmap))
+ return the_secondBitmap; else
+ return the_bitmap;
+ }
+ } ;
+
+ /**
+ * This property must have an URL format
+ */
+ public void _FillBitmapURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("FillBitmapURL", URLTester) ;
+ }
+
+ public String str1 = "";
+ public String str2 = "";
+
+ /**
+ * This property must have predefined values
+ */
+ public void _FillGradientName() {
+ log.println("Testing with custom Property tester") ;
+ str1 = "Gradient 1";
+ str2 = "Gradient 3";
+ testProperty("FillGradientName", StringTester) ;
+ }
+
+ /**
+ * This property must have predefined values
+ */
+ public void _FillBitmapName() {
+ log.println("Testing with custom Property tester") ;
+ str1 = "Sky";
+ str2 = "Blank";
+ testProperty("FillBitmapName", StringTester) ;
+ }
+
+ /**
+ * This property must have predefined values
+ */
+ public void _FillTransparenceGradientName() {
+ log.println("Testing with custom Property tester") ;
+ str1 = "Transparency 2";
+ str2 = "Transparency 1";
+ testProperty("FillTransparenceGradientName", StringTester) ;
+ }
+
+ /**
+ * This property must have predefined values
+ */
+ public void _FillHatchName() {
+ log.println("Testing with custom Property tester") ;
+ str1 = "Black 0 degrees";
+ str2 = "Black 45 degrees";
+ testProperty("FillHatchName", StringTester) ;
+ }
+
+ /**
+ * This property is very interesting. After setting URL of bitmap you get
+ * <code>XBitmap</code> interface of the image file specified.
+ * The method first gets two different bitmaps and then tests the property.
+ */
+ public void _FillBitmap() {
+ try {
+ oObj.setPropertyValue("FillBitmapURL",
+ util.utils.getFullTestURL("crazy-blue.jpg"));
+ the_bitmap = (XBitmap) oObj.getPropertyValue("FillBitmap");
+ oObj.setPropertyValue("FillBitmapURL",
+ util.utils.getFullTestURL("space-metal.jpg"));
+ the_secondBitmap = (XBitmap) oObj.getPropertyValue("FillBitmap");
+ testProperty("FillBitmap", BitmapTester) ;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't change Bitmap");
+ e.printStackTrace(log);
+ tRes.tested("FillBitmap",false);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't change Bitmap");
+ e.printStackTrace(log);
+ tRes.tested("FillBitmap",false);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't change Bitmap");
+ e.printStackTrace(log);
+ tRes.tested("FillBitmap",false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't change Bitmap");
+ e.printStackTrace(log);
+ tRes.tested("FillBitmap",false);
+ }
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_GenericDrawPage.java b/qadevOOo/tests/java/ifc/drawing/_GenericDrawPage.java
new file mode 100644
index 000000000000..10ad2ce0c6fd
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_GenericDrawPage.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: _GenericDrawPage.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.drawing.GenericDrawPage</code>
+* service properties :
+* <ul>
+* <li><code> BorderBottom</code></li>
+* <li><code> BorderLeft</code></li>
+* <li><code> BorderRight</code></li>
+* <li><code> BorderTop</code></li>
+* <li><code> Height</code></li>
+* <li><code> Width</code></li>
+* <li><code> Number</code></li>
+* <li><code> Orientation</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.GenericDrawPage
+*/
+public class _GenericDrawPage extends MultiPropertyTest {
+
+ public void _Number() {
+ log.println("Number started");
+ boolean res = false;
+ log.println("trying to get the value");
+ try {
+ Short wat = (Short) oObj.getPropertyValue("Number");
+ if (wat == null) {
+ log.println("it is null");
+ } else {
+ log.println("it isn't null");
+ res=true;
+ }
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("an UnknownPropertyException occured");
+
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("an WrappedTargetException occured");
+ }
+
+ tRes.tested("Number",res);
+ }
+
+ public void _UserDefinedAttributes() {
+ log.println("Userdefined started");
+ boolean res = false;
+ log.println("trying to get the value");
+ try {
+ Object wat = oObj.getPropertyValue("UserDefinedAttributes");
+ if (wat == null) {
+ log.println("it is null");
+ } else {
+ log.println("it isn't null");
+ res=true;
+ }
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("an UnknownPropertyException occured");
+
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("an WrappedTargetException occured");
+ }
+
+ tRes.tested("UserDefinedAttributes",res);
+ }
+
+} // end of GenericDrawPage
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java b/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java
new file mode 100644
index 000000000000..46c22c1ba228
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * $RCSfile: _GraphicObjectShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.awt.XBitmap;
+import com.sun.star.container.XIndexContainer;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.drawing.GraphicObjectShape</code>
+* service properties :
+* <ul>
+* <li><code> GraphicURL</code></li>
+* <li><code> GraphicStreamURL</code></li>
+* <li><code> GraphicObjectFillBitmap</code></li>
+* <li><code> AdjustLuminance</code></li>
+* <li><code> AdjustContrast</code></li>
+* <li><code> AdjustRed</code></li>
+* <li><code> AdjustGreen</code></li>
+* <li><code> AdjustBlue</code></li>
+* <li><code> Gamma</code></li>
+* <li><code> Transparency</code></li>
+* <li><code> GraphicColorMode</code></li>
+* <li><code> ImageMap</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Bitmap1', 'Bitmap2'</code> (of type <code>XBitmap</code>):
+* values to be set for property GraphicObjectFillBitmap </li>
+* <li> <code>'IMAP'</code>
+* (<code>com.sun.star.image.ImageMapRectangleObject</code> service instance):
+* is used to be added to ImageMap container.</li>
+* <ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.GraphicObjectShape
+*/
+public class _GraphicObjectShape extends MultiPropertyTest {
+
+ /**
+ * Property tester which changes URL.
+ */
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg"); else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ } ;
+
+ /**
+ * Property tester which switches two XBitmap objects.
+ * It also uses two object relations with bitmaps.
+ */
+ protected PropertyTester BitmapTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue){
+ XBitmap aBitmap1=(XBitmap) tEnv.getObjRelation("Bitmap1");
+ XBitmap aBitmap2=(XBitmap) tEnv.getObjRelation("Bitmap2");
+ if (oldValue.equals(aBitmap1)) return aBitmap2;
+ else return aBitmap1;
+ }
+ } ;
+
+ public XIndexContainer set = null;
+
+ /**
+ * Property tester which returns new <code>XIndexAccess</code> object.
+ */
+ protected PropertyTester ImapTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return set;
+ }
+ } ;
+
+
+ /**
+ * This property must have URL format
+ */
+ public void _GraphicURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("GraphicURL", URLTester) ;
+ }
+
+ public void _GraphicStreamURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("GraphicStreamURL", URLTester) ;
+ }
+
+ public void _GraphicObjectFillBitmap() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("GraphicObjectFillBitmap", BitmapTester) ;
+ }
+
+ /**
+ * The test first retrieves ImageMap relation, then inserts it
+ * to the current container.
+ */
+ public void _ImageMap() {
+ if (! util.utils.hasPropertyByName(oObj,"ImageMap")) {
+ log.println("optional property 'ImageMap' isn't available");
+ tRes.tested("ImageMap",true);
+ return;
+ }
+ try {
+ Object imap = tEnv.getObjRelation("IMAP");
+ XIndexContainer get = (XIndexContainer)
+ oObj.getPropertyValue("ImageMap");
+ set = get;
+ set.insertByIndex(0,imap);
+ testProperty("ImageMap", ImapTester) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while checking 'ImageMap'");
+ e.printStackTrace(log);
+ tRes.tested("ImageMap",false);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while checking 'ImageMap'");
+ e.printStackTrace(log);
+ tRes.tested("ImageMap",false);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception while checking 'ImageMap'");
+ e.printStackTrace(log);
+ tRes.tested("ImageMap",false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while checking 'ImageMap'");
+ e.printStackTrace(log);
+ tRes.tested("ImageMap",false);
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_Layer.java b/qadevOOo/tests/java/ifc/drawing/_Layer.java
new file mode 100644
index 000000000000..6ed1d16893df
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_Layer.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Layer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.Layer</code>
+* service properties :
+* <ul>
+* <li><code> Name</code></li>
+* <li><code> IsVisible</code></li>
+* <li><code> IsPrintable</code></li>
+* <li><code> IsLocked</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.Layer
+*/
+public class _Layer extends MultiPropertyTest {
+
+}// end of _Layer.java
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_LineProperties.java b/qadevOOo/tests/java/ifc/drawing/_LineProperties.java
new file mode 100644
index 000000000000..9172f398aa79
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_LineProperties.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: _LineProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.drawing.LineProperties</code>
+* service properties :
+* <ul>
+* <li><code> LineStyle</code></li>
+* <li><code> LineDash</code></li>
+* <li><code> LineColor</code></li>
+* <li><code> LineTransparence</code></li>
+* <li><code> LineWidth</code></li>
+* <li><code> LineJoint</code></li>
+* <li><code> LineStartName</code></li>
+* <li><code> LineStart</code></li>
+* <li><code> LineEnd</code></li>
+* <li><code> LineStartCenter</code></li>
+* <li><code> LineStartWidth</code></li>
+* <li><code> LineEndCenter</code></li>
+* <li><code> LineEndWidth</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.LineProperties
+*/
+public class _LineProperties extends MultiPropertyTest {
+
+ /**
+ * Tester used for property LineStartName which can have
+ * only predefined String values.
+ */
+ protected PropertyTester LineTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals("Arrow"))
+ return "Square"; else
+ return "Arrow";
+ }
+ } ;
+
+ /**
+ * The property switched between 'Square' and 'Arrow' values.
+ */
+ public void _LineStartName() {
+ log.println("Testing with custom Property tester");
+ testProperty("LineStartName", LineTester) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_MeasureProperties.java b/qadevOOo/tests/java/ifc/drawing/_MeasureProperties.java
new file mode 100644
index 000000000000..9e49c054b3c1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_MeasureProperties.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * $RCSfile: _MeasureProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.MeasureProperties</code>
+* service properties :
+* <ul>
+* <li><code> MeasureBelowReferenceEdge</code></li>
+* <li><code> MeasureHelpLine1Length</code></li>
+* <li><code> MeasureHelpLine2Length</code></li>
+* <li><code> MeasureHelpLineDistance</code></li>
+* <li><code> MeasureHelpLineOverhang</code></li>
+* <li><code> MeasureKind</code></li>
+* <li><code> MeasureLineDistance</code></li>
+* <li><code> MeasureOverhang</code></li>
+* <li><code> MeasureShowUnit</code></li>
+* <li><code> MeasureTextAutoAngle</code></li>
+* <li><code> MeasureTextAutoAngleView</code></li>
+* <li><code> MeasureTextFixedAngle</code></li>
+* <li><code> MeasureTextHorizontalPosition</code></li>
+* <li><code> MeasureTextVerticalPosition</code></li>
+* <li><code> MeasureTextIsFixedAngle</code></li>
+* <li><code> MeasureTextRotate90</code></li>
+* <li><code> MeasureTextUpsideDown</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.MeasureProperties
+*/
+public class _MeasureProperties extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_MeasureShape.java b/qadevOOo/tests/java/ifc/drawing/_MeasureShape.java
new file mode 100644
index 000000000000..1688b39d9c98
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_MeasureShape.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _MeasureShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.MeasureShape</code>
+* service properties :
+* <ul>
+* <li><code> StartPosition</code></li>
+* <li><code> EndPosition</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.MeasureShape
+*/
+public class _MeasureShape extends MultiPropertyTest {
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_PolyPolygonBezierDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_PolyPolygonBezierDescriptor.java
new file mode 100644
index 000000000000..a53cfdd115f7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_PolyPolygonBezierDescriptor.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * $RCSfile: _PolyPolygonBezierDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.PolyPolygonBezierDescriptor</code>
+* service properties :
+* <ul>
+* <li><code> PolygonKind</code></li>
+* <li><code> PolyPolygonBezier</code></li>
+* <li><code> Geometry</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.PolyPolygonBezierDescriptor
+*/
+public class _PolyPolygonBezierDescriptor extends MultiPropertyTest {
+
+} // finish class _PolyPolygonBezierDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_PolyPolygonDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_PolyPolygonDescriptor.java
new file mode 100644
index 000000000000..4a452620b3e0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_PolyPolygonDescriptor.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * $RCSfile: _PolyPolygonDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.PolyPolygonDescriptor</code>
+* service properties :
+* <ul>
+* <li><code> PolygonKind</code></li>
+* <li><code> PolyPolygon</code></li>
+* <li><code> Geometry</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.PolyPolygonDescriptor
+*/
+public class _PolyPolygonDescriptor extends MultiPropertyTest {
+
+} // finish class _PolyPolygonDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java
new file mode 100644
index 000000000000..59ecf099ac95
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * $RCSfile: _RotationDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.drawing.RotationDescriptor</code>
+* service properties :
+* <ul>
+* <li><code> RotateAngle</code></li>
+* <li><code> ShearAngle</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.RotationDescriptor
+*/
+public class _RotationDescriptor extends MultiPropertyTest {
+
+ /**
+ * Custom tester which increases value by 200
+ */
+ protected PropertyTester drawMeasureTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ int val = ((Integer)oldValue).intValue() ;
+ return new Integer(val + 200) ;
+ }
+ } ;
+
+ /**
+ * !!! DEPRECATED !!!
+ */
+ public void _RotationPointX() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("RotationPointX", drawMeasureTester) ;
+ }
+
+ /**
+ * !!! DEPRECATED !!!
+ */
+ public void _RotationPointY() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("RotationPointY", drawMeasureTester) ;
+ }
+
+ /**
+ * Tests the property with custom tester
+ */
+ public void _ShearAngle() {
+
+ Object noShear = tEnv.getObjRelation("NoShear");
+
+ if (noShear != null) {
+ log.println("This shape type doesn't support shear, see #85556#");
+ tRes.tested("ShearAngle",Status.skipped(true));
+ return;
+ }
+
+ try {
+ oObj.setPropertyValue("RotateAngle",new Short((short) 0));
+ } catch (Exception e) {
+ }
+ log.println("Testing with custom Property tester") ;
+ testProperty("ShearAngle", drawMeasureTester) ;
+ }
+
+ /**
+ * Tests the property with custom tester
+ */
+ public void _RotateAngle() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("RotateAngle", drawMeasureTester) ;
+ }
+
+} // finish class _RotationDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_ShadowProperties.java b/qadevOOo/tests/java/ifc/drawing/_ShadowProperties.java
new file mode 100644
index 000000000000..81ffcd669f13
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_ShadowProperties.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ShadowProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.ShadowProperties</code>
+* service properties :
+* <ul>
+* <li><code> Shadow</code></li>
+* <li><code> ShadowColor</code></li>
+* <li><code> ShadowTransparence</code></li>
+* <li><code> ShadowXDistance</code></li>
+* <li><code> ShadowYDistance</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.ShadowProperties
+*/
+public class _ShadowProperties extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_Shape.java b/qadevOOo/tests/java/ifc/drawing/_Shape.java
new file mode 100644
index 000000000000..47eaa35d155b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_Shape.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Shape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.style.XStyle;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.drawing.Shape</code>
+* service properties :
+* <ul>
+* <li><code> ZOrder</code></li>
+* <li><code> LayerID</code></li>
+* <li><code> LayerName</code></li>
+* <li><code> Printable</code></li>
+* <li><code> MoveProtect</code></li>
+* <li><code> Name</code></li>
+* <li><code> SizeProtect</code></li>
+* <li><code> Style</code></li>
+* <li><code> Transformation</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Style1', 'Style2'</code>
+* (of type <code>com.sun.star.style.XStyle</code>):
+* relations used to change property 'Style'</li>
+* <ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.Shape
+*/
+public class _Shape extends MultiPropertyTest {
+
+ XStyle style1 = null;
+ XStyle style2 = null;
+
+ /**
+ * Custom tester which switches between two styles.
+ */
+ protected PropertyTester StyleTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (util.ValueComparer.equalValue(oldValue,style1))
+ return style2; else
+ return style1;
+ }
+ } ;
+
+ /**
+ * Custom tester for 'LayerName' property which switches two
+ * Strings ('layout' and 'controls').
+ */
+ protected PropertyTester StringTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (util.ValueComparer.equalValue(oldValue,"layout"))
+ return "controls"; else
+ return "layout";
+ }
+ } ;
+
+ /**
+ * Tested with custom StyleTester which switches between two
+ * styles.
+ */
+ public void _Style() {
+ log.println("Testing with custom Property tester") ;
+ style1 = (XStyle) tEnv.getObjRelation("Style1");
+ style2 = (XStyle) tEnv.getObjRelation("Style2");
+ testProperty("Style", StyleTester) ;
+ }
+
+ /**
+ * Tested with custom StringTester which switches two
+ * Strings ('layout' and 'controls')
+ */
+ public void _LayerName() {
+ if (tEnv.getTestCase().getObjectName().equals("SwXShape")) {
+ log.println("There is only one Layer for SwXShape");
+ log.println("Therefore this property can't be changed");
+ tRes.tested("LayerName",true);
+ } else {
+ log.println("Testing with custom Property tester") ;
+ testProperty("LayerName", StringTester) ;
+ }
+ }
+
+ public void _ZOrder() {
+ testProperty("ZOrder", new Integer(0), new Integer(1));
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_TextProperties.java b/qadevOOo/tests/java/ifc/drawing/_TextProperties.java
new file mode 100644
index 000000000000..a2ebf20ffd33
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_TextProperties.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.TextProperties</code>
+* service properties :
+* <ul>
+* <li><code> IsNumbering</code></li>
+* <li><code> NumberingRules</code></li>
+* <li><code> TextAutoGrowHeight</code></li>
+* <li><code> TextAutoGrowWidth</code></li>
+* <li><code> TextContourFrame</code></li>
+* <li><code> TextFitToSize</code></li>
+* <li><code> HorizontalAdjust</code></li>
+* <li><code> VerticalAdjust</code></li>
+* <li><code> TextLeftDistance</code></li>
+* <li><code> TextRightDistance</code></li>
+* <li><code> TextUpperDistance</code></li>
+* <li><code> TextLowerDistance</code></li>
+* <li><code> TextMaximumFrameHeight</code></li>
+* <li><code> TextMaximumFrameWidth</code></li>
+* <li><code> TextMinimumFrameHeight</code></li>
+* <li><code> TextMinimumFrameWidth</code></li>
+* <li><code> TextAnimationAmount</code></li>
+* <li><code> TextAnimationCount</code></li>
+* <li><code> TextAnimationDelay</code></li>
+* <li><code> TextAnimationDirection</code></li>
+* <li><code> TextAnimationKind</code></li>
+* <li><code> TextAnimationStartInside</code></li>
+* <li><code> TextAnimationStopInside</code></li>
+* <li><code> TextWritingMode</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.TextProperties
+*/
+public class _TextProperties extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_TextShape.java b/qadevOOo/tests/java/ifc/drawing/_TextShape.java
new file mode 100644
index 000000000000..a45ee3c342f3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_TextShape.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.TextShape</code>
+* service properties :
+* <ul>
+* <li><code> CornerRadius</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.TextShape
+*/
+public class _TextShape extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XControlShape.java b/qadevOOo/tests/java/ifc/drawing/_XControlShape.java
new file mode 100644
index 000000000000..a20970b92525
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XControlShape.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XControlShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import util.FormTools;
+
+/**
+* Testing <code>com.sun.star.drawing.XControlShape</code>
+* interface methods :
+* <ul>
+* <li><code> getControl()</code></li>
+* <li><code> setControl()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'xDoc'</code> (of type <code>XComponent</code>):
+* the document where shape tested is situated. This document
+* must also implement <code>XMultiServiceFactory</code> interface
+* to create some control model. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XControlShape
+*/
+public class _XControlShape extends MultiMethodTest {
+
+ public XControlShape oObj = null;
+
+ XControlModel model = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _getControl() {
+ model = oObj.getControl() ;
+
+ tRes.tested("getControl()", true) ;
+ }
+
+ /**
+ * With the help of document passed as relation, a new button control
+ * model is created and set as a control. <p>
+ * Has <b> OK </b> status if <code>getControl()</code> method returns
+ * the same control as was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getControl() </code> </li>
+ * </ul>
+ */
+ public void _setControl() {
+ requiredMethod("getControl()") ;
+
+ XInterface oNewControl = FormTools.createControl
+ ((XComponent)tEnv.getObjRelation("xDoc"), "ComboBox") ;
+
+ XControlModel xControl = (XControlModel) UnoRuntime.queryInterface
+ (XControlModel.class, oNewControl) ;
+
+ oObj.setControl(xControl) ;
+
+ XControlModel gControl = oObj.getControl() ;
+
+ if (oNewControl.equals(gControl))
+ tRes.tested("setControl()", true) ;
+ else {
+ log.println("Control set is not equal to control get") ;
+ tRes.tested("setControl()", false) ;
+ }
+ }
+
+} // finish class _XControlShape
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java
new file mode 100644
index 000000000000..ae4869aec369
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDrawPageDuplicator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageDuplicator;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPageDuplicator</code>
+* interface methods :
+* <ul>
+* <li><code> duplicate()</code></li>
+* </ul> <p>
+* The object tested <b> must implement </b>
+* <code>XDrawPagesSupplier</code> interface to have access to draw
+* pages collection. <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.drawing.XDrawPageDuplicator
+*/
+public class _XDrawPageDuplicator extends MultiMethodTest {
+ public XDrawPageDuplicator oObj = null;
+
+ /**
+ * First queries object tested for <code>XDrawPagesSupplier</code>
+ * interface and obtains one draw page from document. Then it
+ * tries to duplicate it.<p>
+ * Has <b> OK </b> status if the method returns not null value and
+ * this value is not equal to the page which was duplicated. <p>
+ */
+ public void _duplicate(){
+ boolean result = false;
+ XInterface testobj = tEnv.getTestObject();
+ XDrawPagesSupplier PS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, testobj);
+ XDrawPages DPs = PS.getDrawPages();
+ XDrawPage DP = null;
+ try {
+ DP = (XDrawPage)DPs.getByIndex(0);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while testing: " + e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occured while testing: " + e);
+ }
+
+ if (DP != null) {
+ XDrawPage newPage = oObj.duplicate(DP);
+ result = (newPage != null) && !(newPage.equals(DP));
+ }
+ tRes.tested("duplicate()", result);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPageExpander.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPageExpander.java
new file mode 100644
index 000000000000..89ba42e40f31
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPageExpander.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDrawPageExpander.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageExpander;
+import com.sun.star.drawing.XDrawPages;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPageExpander</code>
+* interface methods :
+* <ul>
+* <li><code> expand()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (of type <code>XDrawPage</code>):
+* draw page to be expanded. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawPageExpander
+*/
+public class _XDrawPageExpander extends MultiMethodTest {
+ public XDrawPageExpander oObj = null;
+
+ /**
+ * First the relation is retrieved. Then the method is called.<p>
+ * Has <b> OK </b> status if the method returns not null value. <p>
+ */
+ public void _expand() {
+ boolean result = true;
+ XDrawPage oDrawPage = (XDrawPage) tEnv.getObjRelation("DrawPage");
+ if ( oDrawPage == null ) {
+ // SKIPPED.FAILED - the ObjectRelation is not available
+ Status.failed( "ObjectRelation('DrawPages') XDrawPages n.a.");
+ return;
+ }
+ log.println("testing expand() ... ");
+
+ XDrawPages pages = oObj.expand(oDrawPage);
+ result = pages != null;
+
+ tRes.tested("expand()", result);
+ } // end expand
+} // end DrawPageExpander
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPageSummarizer.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPageSummarizer.java
new file mode 100644
index 000000000000..b494c53c3b72
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPageSummarizer.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDrawPageSummarizer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPageSummarizer;
+import com.sun.star.drawing.XDrawPages;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPageSummarizer</code>
+* interface methods :
+* <ul>
+* <li><code> summarize()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPages'</code> (of type <code>XDrawPages</code>):
+* a collection of pages to be summarized. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawPageSummarizer
+*/
+public class _XDrawPageSummarizer extends MultiMethodTest {
+ public XDrawPageSummarizer oObj = null;
+
+ /**
+ * First the relation is retrieved. Then the method is called.<p>
+ * Has <b> OK </b> status if the method returns not null value. <p>
+ */
+ public void summarize(){
+ boolean result = true;
+ XDrawPages oDrawPages = (XDrawPages) tEnv.getObjRelation("DrawPages");
+ if ( oDrawPages == null ) {
+ // SKIPPED.FAILED - the ObjectRelation is not available
+ Status.failed( "ObjectRelation('DrawPages') XDrawPages n.a." );
+ return;
+ }
+ log.println("testing summarize() ... ");
+
+ oObj.summarize(oDrawPages);
+ result=true;
+
+ tRes.tested("summarize()", result);
+ } // end of summarize()
+
+} // end of XDrawPageSummarizer
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPages.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPages.java
new file mode 100644
index 000000000000..d7c0a5bf4713
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPages.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDrawPages.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPages</code>
+* interface methods :
+* <ul>
+* <li><code> insertNewByIndex()</code></li>
+* <li><code> remove()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawPages
+*/
+public class _XDrawPages extends MultiMethodTest {
+ public XDrawPages oObj = null;
+ public XDrawPage DrawPage;
+
+ /**
+ * Inserts a draw page at index 0. Number of pages is obtained
+ * before and after insertion.<p>
+ * Has <b> OK </b> status if the value returned is not null and
+ * number of pages increases by one after insertion. <p>
+ */
+ public void _insertNewByIndex(){
+ boolean result = true;
+ log.println("testing insertNewByIndex() ... ");
+
+ int cntBefore = oObj.getCount();
+ DrawPage = oObj.insertNewByIndex(0);
+ int cntAfter = oObj.getCount();
+ result = DrawPage != null &&
+ cntAfter == cntBefore + 1 ;
+
+ tRes.tested("insertNewByIndex()", result);
+ } // end InsertNewByIndex
+
+ /**
+ * Removes the draw page inserted before. Number of pages is obtained
+ * before and after removing.<p>
+ * Has <b> OK </b> status if the number of pages decreases by one
+ * after removing. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertByIndex() </code> : the page to be removed must
+ * be inserted first.</li>
+ * </ul>
+ */
+ public void _remove(){
+ requiredMethod("insertNewByIndex()") ;
+
+ boolean result = true;
+ log.println("removing DrawPage...");
+
+ int cntBefore = oObj.getCount();
+ oObj.remove(DrawPage);
+ int cntAfter = oObj.getCount();
+ result = cntAfter + 1 == cntBefore ;
+
+ tRes.tested("remove()", result);
+ } // end remove()
+
+} // end XDrawPages
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPagesSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPagesSupplier.java
new file mode 100644
index 000000000000..ea62e3f58299
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPagesSupplier.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDrawPagesSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPagesSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getDrawPages()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawPagesSupplier
+*/
+public class _XDrawPagesSupplier extends MultiMethodTest {
+ public XDrawPagesSupplier oObj = null;
+
+ /**
+ * Gets draw page collection. <p>
+ * Has <b> OK </b> status if the value returned is not null. <p>
+ */
+ public void _getDrawPages(){
+ boolean result = true;
+ XDrawPages DrawPages = null;
+
+ log.println("testing getDrawPages() ... ");
+
+ DrawPages = oObj.getDrawPages();
+ result = DrawPages != null;
+
+ tRes.tested("getDrawPages()", result);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawView.java b/qadevOOo/tests/java/ifc/drawing/_XDrawView.java
new file mode 100644
index 000000000000..19de02635354
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawView.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDrawView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawView;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawView</code>
+* interface methods :
+* <ul>
+* <li><code> setCurrentPage()</code></li>
+* <li><code> getCurrentPage()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Pages'</code> (of type <code>XDrawPages</code>):
+* needed to have the access to pages collection.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawView
+*/
+public class _XDrawView extends MultiMethodTest {
+
+ public XDrawView oObj = null;
+ public XDrawPage the_page = null;
+
+ /**
+ * This methods gets the current DrawPage.<p>
+ * Has <b> OK </b> status if the returned DrawPage
+ * isn't empty.
+ */
+ public void _getCurrentPage(){
+ the_page = oObj.getCurrentPage();
+ tRes.tested("getCurrentPage()",the_page != null);
+ } // end getCurrentPage
+
+ /**
+ * This methods sets the current DrawPage<br>
+ * First a new DrawPage is inserted in the document.
+ * Then this DrawPage is set as current Page.
+ * Has <b> OK </b> status if the getCurrentPage() method returns
+ * the DrawPage that was previously set.
+ * @see ifc.drawing._XDrawPages
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getCurrentPage() </code> </li>
+ * </ul>
+ */
+ public void _setCurrentPage(){
+ requiredMethod("getCurrentPage()");
+ try {
+ XDrawPages the_pages = (XDrawPages) tEnv.getObjRelation("Pages");
+ the_pages.insertNewByIndex(0);
+ XDrawPage newPage = (XDrawPage) the_pages.getByIndex(1);
+ oObj.setCurrentPage(newPage);
+ XDrawPage getting = oObj.getCurrentPage();
+ boolean eq = newPage.equals(getting);
+ if (!eq) {
+ log.println("Getting: "+getting.hasElements());
+ log.println("Expected: "+newPage.hasElements());
+ }
+ //back to the previous page
+ oObj.setCurrentPage(the_page);
+ tRes.tested("setCurrentPage()",eq);
+ } catch (com.sun.star.lang.WrappedTargetException ex) {
+ log.println("Exception occured while checking 'setCurrentPage()'");
+ ex.printStackTrace(log);
+ tRes.tested("setCurrentPage()",false);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("Exception occured while checking 'setCurrentPage()'");
+ ex.printStackTrace(log);
+ tRes.tested("setCurrentPage()",false);
+ }
+ } // end getCurrentPage
+
+} // end DrawView
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XGluePointsSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XGluePointsSupplier.java
new file mode 100644
index 000000000000..8a866957474c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XGluePointsSupplier.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XGluePointsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.drawing.XGluePointsSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XGluePointsSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getGluePoints()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XGluePointsSupplier
+*/
+public class _XGluePointsSupplier extends MultiMethodTest {
+ public XGluePointsSupplier oObj = null;
+
+ /**
+ * Gets glue points collection. <p>
+ * Has <b> OK </b> status if the value returned is not null. <p>
+ */
+ public void _getGluePoints(){
+ boolean result = true;
+ XIndexContainer points = null;
+
+ log.println("testing getDrawPages() ... ");
+
+ points = oObj.getGluePoints();
+ result = points != null;
+
+ tRes.tested("getGluePoints()", result);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XLayerManager.java b/qadevOOo/tests/java/ifc/drawing/_XLayerManager.java
new file mode 100644
index 000000000000..981cac008a59
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XLayerManager.java
@@ -0,0 +1,199 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLayerManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XLayer;
+import com.sun.star.drawing.XLayerManager;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+import util.XInstCreator;
+
+/**
+* Testing <code>com.sun.star.drawing.XLayerManager</code>
+* interface methods :
+* <ul>
+* <li><code> insertNewByIndex()</code></li>
+* <li><code> remove()</code></li>
+* <li><code> attachShapeToLayer()</code></li>
+* <li><code> getLayerForShape()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Shape'</code> (of type <code>util.XInstCreator</code>):
+* instance creator which can create shapes.</li>
+* <li> <code>'Shapes'</code>
+* (of type <code>com.sun.star.drawing.XShapes</code>):
+* The collection of shapes in the document. Is used
+* to add new created shapes.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XLayerManager
+*/
+public class _XLayerManager extends MultiMethodTest {
+
+ public XLayerManager oObj = null; // oObj filled by MultiMethodTest
+ XInstCreator shape = null;
+ public XInterface oShape = null;
+ public XLayer oL = null;
+
+ /**
+ * Inserts a new layer into collection. <p>
+ * Has <b> OK </b> status if the value returned is not null. <p>
+ */
+ public void _insertNewByIndex(){
+ log.println("insertNewByName() ... ");
+ oL = oObj.insertNewByIndex(0);
+ tRes.tested("insertNewByIndex()", oL != null);
+ }
+
+ /**
+ * First a shape created and inserted into the document using
+ * relations retrieved. Attaches this shape to layer created before. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertNewByIndex </code> : to have a layer attach to.</li>
+ * </ul>
+ */
+ public void _attachShapeToLayer() {
+ requiredMethod("insertNewByIndex()");
+ shape = (XInstCreator)tEnv.getObjRelation("Shape");
+ oShape = shape.createInstance();
+ XShape oSh = (XShape) oShape;
+ XShapes oShapes = (XShapes) tEnv.getObjRelation("Shapes");
+ oShapes.add(oSh);
+ boolean result = false;
+
+ log.println("attachShapeToLayer() ... ");
+
+ oObj.attachShapeToLayer((XShape) oShape,oL);
+ result = true;
+
+ tRes.tested("attachShapeToLayer()", result);
+ }
+
+ /**
+ * Gets the layer for shape which was attached before. <p>
+ * Has <b> OK </b> status if the names of layer get and
+ * the layer attached before are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> attachShapeToLayer() </code> </li>
+ * </ul>
+ */
+ public void _getLayerForShape() {
+ requiredMethod("attachShapeToLayer()");
+ log.println("getLayerForShape() ... ");
+ XLayer Lay1 = oL;
+ XLayer Lay2 = oObj.getLayerForShape((XShape)oShape);
+ Object Obj1 = null;
+ Object Obj2 = null;
+
+ try {
+ Obj1 = Lay1.getPropertyValue("Name");
+ Obj2 = Lay2.getPropertyValue("Name");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ }
+
+ tRes.tested("getLayerForShape()",ValueComparer.equalValue(Obj1,Obj2));
+ }
+
+ /**
+ * Test removes the layer added before. Number of layers are get before
+ * and after removing.<p>
+ * Has <b> OK </b> status if number of layers decreases by one. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLayerForShape() </code> </li>
+ * </ul>
+ */
+ public void _remove () {
+ requiredMethod("getLayerForShape()");
+ boolean result = true ;
+ // get the current thread's holder
+ log.println("removing the Layer...");
+
+ int cntBefore = oObj.getCount();
+
+ try {
+ oObj.remove(oL);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ int cntAfter = oObj.getCount();
+
+ result = cntBefore == cntAfter + 1;
+
+ tRes.tested("remove()", result);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java
new file mode 100644
index 000000000000..5aa129122099
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLayerSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.drawing.XLayerManager;
+import com.sun.star.drawing.XLayerSupplier;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XLayerSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getLayerManager()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XLayerSupplier
+*/
+public class _XLayerSupplier extends MultiMethodTest{
+ public XLayerSupplier oObj = null;
+
+ /**
+ * Gets the manager and it is queried for <code>XLayerManager</code>. <p>
+ * Has <b> OK </b> status if returned value is successfully
+ * queried for <code>XLayerManager</code>. <p>
+ */
+ public void _getLayerManager(){
+ XNameAccess oNA =null;
+ XLayerManager oLM = null;
+ boolean result = true;
+
+ log.println("testing getLayerManager() ... ");
+
+ oNA = oObj.getLayerManager();
+ oLM = (XLayerManager)
+ UnoRuntime.queryInterface ( XLayerManager.class, oNA);
+ result = oLM != null;
+
+ tRes.tested("getLayerManager()", result);
+ } // finished test
+
+} // end XLayerSupplier
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XMasterPageTarget.java b/qadevOOo/tests/java/ifc/drawing/_XMasterPageTarget.java
new file mode 100644
index 000000000000..6f9c8f75e58a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XMasterPageTarget.java
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMasterPageTarget.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XMasterPageTarget;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XMasterPageTarget</code>
+* interface methods :
+* <ul>
+* <li><code> getMasterPage()</code></li>
+* <li><code> setMasterPage()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'MasterPageSupplier'</code>
+* (of type <code>XDrawPages</code>):
+* the relation is used to create a new draw page. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XMasterPageTarget
+*/
+public class _XMasterPageTarget extends MultiMethodTest{
+
+ public XMasterPageTarget oObj = null;
+ public XDrawPage DrawPage = null;
+
+ /**
+ * Gets the master page and stores. <p>
+ * Has <b> OK </b> status if the value returned is not null. <p>
+ */
+ public void _getMasterPage(){
+ boolean result = false;
+ log.println("get the MasterPage");
+
+ DrawPage = oObj.getMasterPage();
+ result = DrawPage != null ;
+
+ tRes.tested("getMasterPage()",result);
+ }
+
+ /**
+ * Gets the pages supplier from relation. Then a new page is created,
+ * inserted and set as master page.<p>
+ * Has <b> OK </b> status if the master page get is equal to page
+ * which was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMasterPage() </code> : to get old master page.</li>
+ * </ul>
+ */
+ public void _setMasterPage() {
+ requiredMethod("getMasterPage()") ;
+
+ boolean result = true;
+ XDrawPage oNewPage = null;
+
+ XDrawPages oPages = (XDrawPages) tEnv.getObjRelation("MasterPageSupplier");
+ log.println("inserting new MasterPage");
+ oNewPage = oPages.insertNewByIndex(oPages.getCount());
+
+ // save the old MasterPage
+ XDrawPage oOldPage = DrawPage;
+
+ // set the new Page as MasterPage
+ log.println("set the new MasterPage");
+ oObj.setMasterPage(oNewPage);
+
+ // get the new MasterPage
+ DrawPage = oObj.getMasterPage();
+
+ // test the diffrent MasterPages
+ if (DrawPage.equals(oOldPage)) result = false;
+
+ tRes.tested("setMasterPage()",result);
+ }
+
+} // end of XMasterPageTarget
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XMasterPagesSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XMasterPagesSupplier.java
new file mode 100644
index 000000000000..b41d5f15f18a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XMasterPagesSupplier.java
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMasterPagesSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XMasterPagesSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XMasterPagesSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getMasterPages()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XMasterPagesSupplier
+*/
+public class _XMasterPagesSupplier extends MultiMethodTest{
+ public XMasterPagesSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the value returned is not null.
+ */
+ public void _getMasterPages(){
+ boolean result = false;
+ XDrawPages DrawPages = null;
+
+ log.println("get the MasterPages");
+
+ DrawPages = oObj.getMasterPages();
+ result = DrawPages != null;
+
+ tRes.tested("getMasterPages()",result);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShape.java b/qadevOOo/tests/java/ifc/drawing/_XShape.java
new file mode 100644
index 000000000000..ac0680be7892
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShape.java
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.drawing.XShape;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XShape</code>
+* interface methods :
+* <ul>
+* <li><code> getPosition()</code></li>
+* <li><code> setPosition()</code></li>
+* <li><code> getSize()</code></li>
+* <li><code> setSize()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'NoPos'</code> <b>optional</b>
+* (of type <code>Object</code>):
+* if this relation exists then position setting is
+* not supported by the object.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShape
+*/
+public class _XShape extends MultiMethodTest {
+
+ public XShape oObj = null; //oObj filled by MultiMethodTest
+
+ Size sOld = new Size();
+ Point pOld = new Point();
+ Size sNew = new Size();
+ Point pNew = new Point();
+
+ /**
+ * Gets the size and stores it. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _getSize(){
+
+ boolean result = false;
+
+ log.println("get the size");
+
+ sOld = (Size) oObj.getSize();
+ result = true;
+
+ tRes.tested("getSize()", result);
+ }
+
+ /**
+ * Gets the current position and stores it if the object
+ * supports position setting. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown or object doesn't
+ * support position setting. <p>
+ */
+ public void _getPosition(){
+ boolean result = false;
+
+ String obj = (String) tEnv.getObjRelation("NoPos");
+ if (obj != null) {
+ log.println("Can't be used with "+obj);
+ result = true;
+ tRes.tested("getPosition()", result);
+ return;
+ }
+
+ log.println("get the position");
+ pOld = (Point) oObj.getPosition();
+ result = true;
+
+ tRes.tested("getPosition()", result);
+ }
+
+ /**
+ * Sets a new size different from the size get before. <p>
+ * Has <b> OK </b> status if the size returned by <code>getSize()</code>
+ * is equal to the size which was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSize() </code> : to set the original size changed.</li>
+ * </ul>
+ */
+ public void _setSize(){
+ requiredMethod("getSize()");
+
+ boolean result = true;
+
+ String obj = (String) tEnv.getObjRelation("NoSetSize");
+ if (obj != null) {
+ log.println("Can't be used with " + obj);
+ tRes.tested("setSize()", true);
+ return;
+ }
+ // get the current thread's holder
+ sNew = new Size(sOld.Height + 10, sOld.Width + 10) ;
+
+ //set new size
+ log.println("change the size");
+ try {
+ oObj.setSize(sNew);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while calling the method :" + e);
+ result = true ;
+ }
+
+ Size gSize = oObj.getSize() ;
+
+ log.println("Previously: "+sOld.Height+";"+sOld.Width);
+ log.println("Expected: "+sNew.Height+";"+sNew.Width);
+ log.println("Getting: "+gSize.Height+";"+gSize.Width);
+
+ //result &= util.ValueComparer.equalValue(sNew, gSize) ;
+ //errors in calculation from points/twips less then 1 are acceptable
+ result &= (sNew.Height-gSize.Height < 2) && (sNew.Width-gSize.Width < 2);
+ tRes.tested("setSize()", result);
+ }
+
+ /**
+ * If object doesn't support position setting the test does nothing.
+ * Else a new position is created and set.<p>
+ * Has <b> OK </b> status if get position is equal to set position or
+ * if the position setting isn't supported. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getPosition() </code> : to change old position. </li>
+ * </ul>
+ */
+ public void _setPosition(){
+ requiredMethod("getPosition()");
+
+ boolean result = true;
+
+ String obj = (String) tEnv.getObjRelation("NoPos");
+ if (obj != null) {
+ log.println("Can't be used with " + obj);
+ tRes.tested("setPosition()", true);
+ return;
+ }
+
+ // get the current thread's holder
+ pNew = new Point(pOld.X + 100, pOld.Y + 100) ;
+ oObj.setPosition(pNew);
+
+ Point gPos = oObj.getPosition() ;
+ result = !util.ValueComparer.equalValue(pOld, gPos) ;
+
+ tRes.tested("setPosition()", result);
+ }
+
+
+} // finish class _XShape
+
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java b/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java
new file mode 100644
index 000000000000..45b4dafbd1bf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XShapeBinder.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapeBinder;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeBinder</code>
+* interface methods :
+* <ul>
+* <li><code> bind()</code></li>
+* <li><code> unbind()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (must implement <code>XShapes</code>):
+* the collection of shapes in a document which used to create a group.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeBinder
+*/
+public class _XShapeBinder extends MultiMethodTest {
+
+ public XShapeBinder oObj = null;
+ XShape group = null;
+ int countBeforeBind = 0;
+ XShapes oShapes = null;
+
+ /**
+ * Retrieves draw page collection from relation and binds them. <p>
+ *
+ * Has <b> OK </b> status if the shape group returned is not null
+ * number of shapes in collection is 1 (shapes are binded into a single
+ * shape). <p>
+ */
+ public void _bind () {
+ XDrawPage dp = (XDrawPage) tEnv.getObjRelation("DrawPage");
+ oShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, dp );
+ boolean result = false;
+ log.println("testing bind() ... ");
+ countBeforeBind = oShapes.getCount();
+ log.println("Count before bind:" + countBeforeBind);
+ group = oObj.bind(oShapes);
+ int countAfterBind = oShapes.getCount();
+ log.println("Count after bind:" + countAfterBind);
+ result = group != null && countAfterBind == 1;
+
+ tRes.tested("bind()", result);
+
+ }
+
+ /**
+ * Unbinds the group created before. <p>
+ *
+ * Has <b> OK </b> status if number of shapes in collection
+ * increases after the method call. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> bind() </code> : to create a shape group </li>
+ * </ul>
+ */
+ public void _unbind () {
+ requiredMethod("bind()");
+ boolean result = false;
+
+ // get the current thread's holder
+ log.println("unbinding the shape...");
+
+ oObj.unbind(group);
+ int countAfterUnbind = oShapes.getCount();
+ log.println("Count after unbind:" + countAfterUnbind);
+ result = countAfterUnbind >= countBeforeBind;
+
+ tRes.tested("unbind()", result);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java b/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java
new file mode 100644
index 000000000000..4f1954beaf9c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XShapeCombiner.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapeCombiner;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeCombiner</code>
+* interface methods :
+* <ul>
+* <li><code> combine()</code></li>
+* <li><code> split()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (must implement <code>XShapes</code>):
+* the collection of shapes in a document which used to create a group.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeCombiner
+*/
+public class _XShapeCombiner extends MultiMethodTest {
+
+ public XShapeCombiner oObj = null; //filled by MultiMethodTest
+ protected XShape oGroup = null;
+ int countBeforeComb = 0;
+ XShapes oShapes = null;
+
+ /**
+ * Retrieves draw page collection from relation and combines them. <p>
+ * Has <b> OK </b> status if the shape group returned is not null nd
+ * number of shapes in collection is 1 (shapes are combined into a single
+ * shape). <p>
+ */
+ public void _combine () {
+ XDrawPage dp = (XDrawPage) tEnv.getObjRelation("DrawPage");
+ oShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, dp );
+
+ boolean result = false;
+
+ log.println("testing combine() ... ");
+ countBeforeComb = oShapes.getCount();
+ log.println("Count before combining:" + countBeforeComb);
+ oGroup = oObj.combine(oShapes);
+ int countAfterComb = oShapes.getCount();
+ log.println("Count after combining:" + countAfterComb);
+ result = oGroup != null && countAfterComb == 1;
+
+ tRes.tested("combine()", result);
+ }
+
+ /**
+ * Splits the group created before. <p>
+ *
+ * Has <b> OK </b> status if number of shapes in collection after
+ * <code>split</code> is the same as before <code>combine</code>. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> combine() </code> : to create a shape group </li>
+ * </ul>
+ */
+ public void _split() {
+ requiredMethod("combine()");
+
+ boolean result = false;
+
+ log.println("spiltting the shape...");
+
+ oObj.split(oGroup);
+ int countAfterSplit = oShapes.getCount();
+ log.println("Count after split:" + countAfterSplit);
+ result = countAfterSplit == countBeforeComb;
+
+ tRes.tested("split()", result);
+ } // end of split
+
+} // end of XShapeCombiner
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java
new file mode 100644
index 000000000000..b1589a058f95
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XShapeDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XShapeDescriptor;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeDescriptor</code>
+* interface methods :
+* <ul>
+* <li><code> getShapeType()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeDescriptor
+*/
+public class _XShapeDescriptor extends MultiMethodTest {
+
+ public XShapeDescriptor oObj = null;
+ boolean result = true;
+
+ /**
+ * Gets the type of shape. This type must be a service name which
+ * is supported by object (except of ChartObject and Frame shapes).
+ * The object is queried for <code>XServiceInfo</code> and
+ * the type is checked to be among supported service names.<p>
+ *
+ * Has <b> OK </b> status if the type is found among supported
+ * services. Or if the object represents a text frame.<p>
+ */
+ public void _getShapeType() {
+ result = false;
+
+ String stype = oObj.getShapeType();
+ log.println("Current Shape Type is " + stype);
+
+ XServiceInfo SI = (XServiceInfo)
+ UnoRuntime.queryInterface(XServiceInfo.class, oObj);
+
+ String[] serviceNames = SI.getSupportedServiceNames();
+
+ log.println("Supported services :");
+ for (int i = 0; i < serviceNames.length; i++) {
+ log.println(" " + serviceNames[i]);
+ if (serviceNames[i].equals(stype))
+ result = true;
+ }
+
+ //remark: we should provide the expected name as ObjRelation
+
+ //Chart has its own behaviour it always return 'ChartObject'
+ if (stype.equals("com.sun.star.chart.ChartObject")) result=true;
+ if (stype.equals("com.sun.star.drawing.ControlShape")) result=true;
+ if (stype.equals("com.sun.star.drawing.ClosedBezierShape")) result=true;
+
+ //Writer has its own behaviour it returns a 'FrameShape'
+ if (stype.equals("FrameShape")) result=true;
+
+ if (!result) {
+ log.println("Service " + stype + " not supported in the object.");
+ }
+
+ tRes.tested("getShapeType()", result);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeGroup.java b/qadevOOo/tests/java/ifc/drawing/_XShapeGroup.java
new file mode 100644
index 000000000000..1822370ac0b2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeGroup.java
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XShapeGroup.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XShapeGroup;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeGroup</code>
+* interface methods :
+* <ul>
+* <li><code> enterGroup()</code></li>
+* <li><code> leaveGroup()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeGroup
+*/
+public class _XShapeGroup extends MultiMethodTest {
+ public XShapeGroup oObj = null;
+
+ /**
+ * The method called.
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _enterGroup() {
+ log.println("Testing enterGroup()...");
+ oObj.enterGroup();
+ tRes.tested("enterGroup()", true);
+ }
+
+ /**
+ * The method called.
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _leaveGroup() {
+ log.println("Testing leaveGroup()...");
+ oObj.leaveGroup();
+ tRes.tested("leaveGroup()", true);
+ }
+
+} // end of _XShapeGroup
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java b/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java
new file mode 100644
index 000000000000..7b71ddf3792f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XShapeGrouper.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapeGroup;
+import com.sun.star.drawing.XShapeGrouper;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeGrouper</code>
+* interface methods :
+* <ul>
+* <li><code> group()</code></li>
+* <li><code> ungroup()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (must implement <code>XShapes</code>):
+* the collection of shapes in a document which used to create a group.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeGrouper
+*/
+public class _XShapeGrouper extends MultiMethodTest {
+
+ public XShapeGrouper oObj = null; // oObj filled by MultiMethodTest
+ XShape oGroup = null;
+ int countAfterGr = 0;
+ XShapes oShapes = null;
+
+ /**
+ * Retrieves draw page collection from relation and groups them. <p>
+ * Has <b> OK </b> status if the shape group returned is not null. <p>
+ */
+ public void _group() {
+ Object dp = tEnv.getObjRelation("DrawPage");
+ if (dp == null)
+ throw new StatusException(Status.failed("Relation not found")) ;
+
+ oShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, dp );
+ boolean result = false;
+ log.println("Grouping " + oShapes.getCount() + " shapes ... ");
+
+ int countBeforeGr = oShapes.getCount();
+ oGroup = oObj.group(oShapes);
+ countAfterGr = oShapes.getCount();
+ log.println("Number of shapes after grouping: " + countAfterGr);
+ result = oGroup != null ;
+ result &= countAfterGr < countBeforeGr;
+
+ tRes.tested("group()", result);
+ }
+
+ /**
+ * Ungroups the group created before. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> group() </code> : to create a shape group </li>
+ * </ul>
+ */
+ public void _ungroup() {
+ requiredMethod("group()");
+ boolean result = false;
+ log.println("ungrouping the shape...");
+
+ oObj.ungroup((XShapeGroup)oGroup);
+ int countAfterUnGr = oShapes.getCount();
+ log.println("Number of shapes after ungrouping: " + countAfterUnGr);
+
+ result = countAfterUnGr != countAfterGr;
+
+ tRes.tested("ungroup()", result);
+ }
+}
+
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapes.java b/qadevOOo/tests/java/ifc/drawing/_XShapes.java
new file mode 100644
index 000000000000..d995c3e58dd1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapes.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XShapes.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import util.XInstCreator;
+
+
+/**
+* Testing <code>com.sun.star.drawing.XShapes</code>
+* interface methods :
+* <ul>
+* <li><code> add()</code></li>
+* <li><code> remove()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Shape'</code> (of type <code>XShape</code>):
+* a shape which can be inserted into shape collection. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapes
+*/
+public class _XShapes extends MultiMethodTest {
+
+ public XShapes oObj = null; // oObj filled by MultiMethodTest
+ XInstCreator shape = null;
+ XInterface oShape = null;
+
+
+ /**
+ * Retrieves a shape from relation and adds it to the collection.
+ * Number of shapes is checked before and after adding.<p>
+ * Has <b> OK </b> status if after adding number of shapes increases by
+ * 1. <p>
+ */
+ public void _add () {
+
+ boolean result = false;
+ shape = (XInstCreator)tEnv.getObjRelation("Shape");
+ oShape = shape.createInstance();
+ XShape oSh = (XShape) oShape;
+
+ log.println("testing add() ... ");
+
+ int cntBefore = oObj.getCount();
+ oObj.add(oSh);
+ int cntAfter = oObj.getCount();
+ result = cntBefore + 1 == cntAfter ;
+
+ tRes.tested("add()", result);
+ }
+
+ /**
+ * Removes the shape added before from the collection.
+ * Number of shapes is checked before and after removing.<p>
+ * Has <b> OK </b> status if after removing number of shapes decreases by
+ * 1. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> add() </code> : a shape added. </li>
+ * </ul>
+ */
+ public void _remove () {
+ requiredMethod("add()");
+ boolean result = false;
+
+ log.println("removing the shape...");
+
+ int cntBefore = oObj.getCount();
+ oObj.remove((XShape) oShape);
+ int cntAfter = oObj.getCount();
+ result = cntBefore == cntAfter + 1;
+
+ tRes.tested("remove()", result);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_DataAwareControlModel.java b/qadevOOo/tests/java/ifc/form/_DataAwareControlModel.java
new file mode 100644
index 000000000000..b35945626951
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_DataAwareControlModel.java
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DataAwareControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.form.XLoadable;
+import com.sun.star.uno.XInterface;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.form.DataAwareControlModel</code>
+* service properties :
+* <ul>
+* <li><code> DataField</code></li>
+* <li><code> BoundField</code></li>
+* <li><code> LabelControl</code></li>
+* </ul> <p>
+* This test need the following object relations :
+* <ul>
+* <li> <code>'FL'</code> as <code>com.sun.star.form.XLoadable</code>
+* implementation : used to connect control to data source. </li>
+* <li> <code>'LC'</code> as <code>com.sun.star.uno.XInterface</code>
+* implementation : as value for LableControl property (see property
+* documentation). </li>
+* <li> <code>'DataAwareControlModel.NewFieldName'</code> :
+* <b>optional</b> <code>String</code> relation which is used
+* for new value of DataFiled proeprty.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.form.DataAwareControlModel
+*/
+public class _DataAwareControlModel extends MultiPropertyTest {
+
+ /**
+ * First checks if <code>com.sun.star.form.DataAwareControlModel</code>
+ * service is supported by the object. Then <code>load</code> method
+ * of <code>'FL'</code> relation is called to connect control model
+ * to data source. Because the property is READONLY its value is
+ * just checked to be non null. After that model is disconnected. <p>
+ * Has <b> OK </b> status if the property has non null value. <p>
+ * The following property tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> DataField </code> : to bind the control to some database
+ * field.</li>
+ * </ul>
+ */
+ public void _BoundField() {
+ requiredMethod("DataField") ;
+
+ // This property is TRANSIENT and READONLY.
+ boolean bResult = true;
+ Object gValue = null;
+
+ // get the loader to load the form
+ XLoadable loader = (XLoadable) tEnv.getObjRelation("FL");
+
+ try {
+ if (loader.isLoaded()) {
+ loader.unload() ;
+ }
+ loader.load();
+ gValue = oObj.getPropertyValue("BoundField");
+ loader.unload();
+ bResult &= gValue != null;
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log) ;
+ bResult = false;
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ bResult = false;
+ }
+ tRes.tested("BoundField", bResult);
+ }
+
+ /**
+ * Sets the property to a Database field name, and then checks
+ * if it was properly set. If <code>'DataAwareControlModel.NewFieldName'
+ * </code> relation is not found, then new property value is
+ * 'Address'. <p>
+ * Has <b> OK </b> status if the proeprty was properly set
+ * and no exceptions were thrown. If old and new values are equal
+ * the test is OK if no exceptions occured and the value remains
+ * the same.<p>
+ */
+ public void _DataField() {
+ String relVal = (String) tEnv.getObjRelation
+ ("DataAwareControlModel.NewFieldName") ;
+ final String newVal = relVal == null ? "Address" : relVal ;
+ testProperty("DataField", new PropertyTester() {
+ protected Object getNewValue(String p, Object oldVal) {
+ return newVal ;
+ }
+ protected void checkResult(String propName, Object oldValue,
+ Object newValue, Object resValue, Exception exception)
+ throws java.lang.Exception{
+
+ if (exception == null && oldValue.equals(newValue)) {
+ boolean res = true ;
+ if (newValue.equals(resValue)) {
+ log.println("Old value is equal to new value ('" +
+ oldValue + "'). Possibly no other suitable fields found.") ;
+ } else {
+ log.println("The value was '" + oldValue + "', set to the" +
+ " same value, but result is '" + resValue + "' : FAILED") ;
+ res = false ;
+ }
+
+ tRes.tested(propName, res) ;
+ } else {
+ super.checkResult(propName, oldValue, newValue,
+ resValue, exception);
+ }
+ }
+ }) ;
+ }
+
+ /**
+ * Sets the new value (<code>'LC'</code> relation if <code>null</code>
+ * was before, and <code> null </code> otherwise and then checks if
+ * the value have successfully changed. <p>
+ * Has <b>OK</b> status if the value successfully changed.
+ */
+ public void _LabelControl() {
+ final XInterface xTextLabel = (XInterface)tEnv.getObjRelation("LC");
+
+ testProperty("LabelControl", new PropertyTester() {
+ protected Object getNewValue(String p, Object oldVal) {
+ if (utils.isVoid(oldVal)) return xTextLabel ;
+ else return super.getNewValue("LabelControl",oldVal);
+ }
+ }) ;
+ }
+
+ /**
+ * Forces environment recreateation.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_FormComponent.java b/qadevOOo/tests/java/ifc/form/_FormComponent.java
new file mode 100644
index 000000000000..397a36153170
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_FormComponent.java
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * $RCSfile: _FormComponent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.FormComponent</code>
+* service properties :
+* <ul>
+* <li><code> Name</code></li>
+* </ul>
+* @see com.sun.star.form.FormComponent
+*/
+public class _FormComponent extends MultiPropertyTest {
+
+} // finish class _FormComponent
+
diff --git a/qadevOOo/tests/java/ifc/form/_FormControlModel.java b/qadevOOo/tests/java/ifc/form/_FormControlModel.java
new file mode 100644
index 000000000000..b588eccd3d0b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_FormControlModel.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _FormControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.FormControlModel</code>
+* service properties :
+* <ul>
+* <li><code> ClassId</code></li>
+* <li><code> TabIndex</code></li>
+* <li><code> Tag</code></li>
+* </ul>
+* @see com.sun.star.form.FormControlModel
+*/
+public class _FormControlModel extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_XApproveActionBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XApproveActionBroadcaster.java
new file mode 100644
index 000000000000..8b0ab383e0e9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XApproveActionBroadcaster.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XApproveActionBroadcaster.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.form.XApproveActionBroadcaster;
+import com.sun.star.form.XApproveActionListener;
+import com.sun.star.lang.EventObject;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.form.XApproveActionBroadcaster</code>
+* interface methods:
+* <ul>
+* <li><code> addApproveActionListener() </code></li>
+* <li><code> removeApproveActionListener() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XApproveActionBroadcaster
+*/
+public class _XApproveActionBroadcaster extends MultiMethodTest {
+ public XApproveActionBroadcaster oObj = null;
+
+ /**
+ * Class we need to test methods.
+ */
+ protected class TestListener implements XApproveActionListener {
+ public boolean approve = false ;
+
+ public void init() {
+ approve = false ;
+ }
+ public void disposing(EventObject ev) {}
+ public boolean approveAction(EventObject ev) {
+ log.println("XApproveActionListener: ActionListener was called");
+ return approve ;
+ }
+
+ }
+
+ private TestListener listener = new TestListener();
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _addApproveActionListener() {
+ oObj.addApproveActionListener(listener) ;
+ tRes.tested("addApproveActionListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addApproveActionListener() </code> : adds listener to an
+ * object </li>
+ * </ul>
+ */
+ public void _removeApproveActionListener() {
+ requiredMethod("addApproveActionListener()");
+ listener.init() ;
+ listener.approve = true ;
+ oObj.removeApproveActionListener(listener);
+ tRes.tested("removeApproveActionListener()", true);
+ }
+
+
+ /**
+ * Just log output
+ */
+ protected void after() {
+ log.println("Skipping all XApproveActionBroadcaster methods, since they"
+ + " need user interaction");
+ throw new StatusException(Status.skipped(true));
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XBoundComponent.java b/qadevOOo/tests/java/ifc/form/_XBoundComponent.java
new file mode 100644
index 000000000000..be010c7a8c6d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XBoundComponent.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XBoundComponent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.form.XBoundComponent;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XBoundComponent</code>
+* interface methods :
+* <ul>
+* <li><code> commit()</code></li>
+* </ul> <p>
+* More deep tests of this interface are made in
+* <code>com.sun.star.form.XUpdateBroadcaster</code> interface
+* test as it is the ancestor of <code>XBoundComponent</code>
+* interface.
+* @see com.sun.star.form.XBoundComponent
+*/
+public class _XBoundComponent extends MultiMethodTest {
+
+ public XBoundComponent oObj = null;
+
+ public void _commit() {
+ oObj.commit() ;
+
+ tRes.tested("commit()",true);
+ }
+
+} //EOF of XBoundComponent
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XBoundControl.java b/qadevOOo/tests/java/ifc/form/_XBoundControl.java
new file mode 100644
index 000000000000..94e19897d612
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XBoundControl.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XBoundControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.form.XBoundControl;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XBoundControl</code>
+* interface methods:
+* <ul>
+* <li><code> getLock() </code></li>
+* <li><code> setLock() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XBoundControl
+*/
+public class _XBoundControl extends MultiMethodTest {
+ public XBoundControl oObj = null;
+ public boolean defaultState = false;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _getLock() {
+ boolean res = false;
+ defaultState = oObj.getLock();
+ res = true;
+ tRes.tested("getLock()",res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if method locks input (set and gotten values are
+ * equal). <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLock() </code>: determines whether the input is
+ * currently locked or not </li>
+ * </ul>
+ */
+ public void _setLock() {
+ boolean res = false;
+ boolean toSet = !defaultState;
+
+ requiredMethod("getLock()");
+ oObj.setLock(toSet);
+ res = (oObj.getLock() != defaultState);
+ oObj.setLock(defaultState);
+ tRes.tested("setLock()", res);
+ }
+
+} //EOF of XBoundControl
+
diff --git a/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java
new file mode 100644
index 000000000000..3109ba6510b3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java
@@ -0,0 +1,234 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XChangeBroadcaster.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XWindow;
+import com.sun.star.form.XChangeBroadcaster;
+import com.sun.star.form.XChangeListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.form.XChangeBroadcaster</code>
+* interface methods:
+* <ul>
+* <li><code> addChangeListener() </code></li>
+* <li><code> removeChangeListener() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Win1'</code> (of type <code>XWindow</code>):
+* used to change context when testing interface methods</li>
+* <li> <code>'Win2'</code> (of type <code>XWindow</code>):
+* used to change context when testing interface methods </li>
+* <li> <code>'CONTROL'</code> (of type <code>XControl</code> and
+* must implement <code>XTextComponent</code> interface):
+* used to change context when testing interface methods </li>
+* <li> <code>'XChangeBroadcaster.Changer'</code>
+* (of type <code>ifc.form._XChangeBroadcaster.Changer</code>)
+* <b>optional</b> : this relation <b>must be specified</b> when
+* <code>XTextComponent</code> is not supported by the tested
+* component. It is used to change some component content
+* which must cause listener call. </li>
+* </ul> <p>
+*
+* <b>Prerequisites:</b> component must implement <code>XTextComponent</code>
+* interface for changing component's text which must cause listener call.
+* If the component cann't support the interface, then the relation
+* <code>'XChangeBroadcaster.Changer'</code> must be passed. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XChangeBroadcaster
+*/
+public class _XChangeBroadcaster extends MultiMethodTest {
+ public static XChangeBroadcaster oObj = null;
+ protected boolean changed = false;
+
+ /**
+ * This interface must be implemented by component and passed
+ * in relation if it doesn't support <code>XTextComponent</code>
+ * interface. It used to change the content of component.
+ */
+ public static interface Changer {
+ /**
+ * The method must change the component's content to
+ * cause a listener call.
+ */
+ public void change() ;
+ }
+
+ /**
+ * Class we need to test methods
+ */
+ protected class MyChangeListener implements XChangeListener {
+ public void disposing ( EventObject oEvent ) {}
+ public void changed ( EventObject oEvent ) {
+ System.out.println("Listener called");
+ changed = true;
+ }
+ }
+
+ protected XChangeListener listener = new MyChangeListener();
+ protected XTextComponent xText = null ;
+ protected Changer changer = null ;
+
+ /**
+ * Tries to query the tested component for <code>XTextComponent</code>
+ * interface and retrieves a relation
+ * <code>'XChangeBroadcaster.Changer'</code>.
+ * @throw StatusException If neither relation is found nor interface
+ * is queried.
+ */
+ public void before() {
+ xText = (XTextComponent)
+ UnoRuntime.queryInterface(XTextComponent.class,oObj);
+ changer = (Changer) tEnv.getObjRelation("XChangeBroadcaster.Changer") ;
+
+ if (xText == null && changer == null)
+ throw new StatusException(Status.failed
+ ("Neither 'XChangeBroadcaster.Changer' relation found " +
+ "nor XTextComponent is supported")) ;
+ }
+
+ /**
+ * Test calls the method, then object relations 'Win1', 'Win2', 'CONTROL'
+ * are obtained, and context is changed.<p>
+ * Has <b> OK </b> status if listener was called after context has changed.
+ */
+ public void _addChangeListener() {
+ log.println("Testing addChangeListener ...");
+ oObj.addChangeListener( listener );
+ XWindow win1 = (XWindow) tEnv.getObjRelation("Win1");
+ XWindow win2 = (XWindow) tEnv.getObjRelation("Win2");
+ win1.setFocus();
+
+ changeContent() ;
+ shortWait();
+
+ win2.setFocus();
+ XTextComponent TC = (XTextComponent)UnoRuntime.queryInterface
+ (XTextComponent.class,tEnv.getObjRelation("CONTROL"));
+ TC.setText("NOXChangeBroadcaster");
+ shortWait();
+ tRes.tested("addChangeListener()", changed);
+ }
+
+ /**
+ * Test calls the method, then object relations 'Win1', 'Win2', 'CONTROL'
+ * are obtained, and context is changed.<p>
+ * Has <b> OK </b> status if listener was not called after context has
+ * changed.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addChangeListener() </code> : adds the specified listener
+ * to receive the "changed" event</li>
+ * </ul>
+ */
+ public void _removeChangeListener() {
+ requiredMethod("addChangeListener()");
+ changed = false;
+ log.println("Testing removeChangeListener ...");
+ oObj.addChangeListener( listener );
+ XWindow win1 = (XWindow) tEnv.getObjRelation("Win1");
+ XWindow win2 = (XWindow) tEnv.getObjRelation("Win2");
+ win2.setFocus();
+
+ changeContent() ;
+
+ win2.setFocus();
+ shortWait();
+ tRes.tested("removeChangeListener()", !changed);
+ }
+
+ /**
+ * 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) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+ /**
+ * Changes the content of the component depending on whether
+ * <code>XTextComponent</code> is supported or not. If yes
+ * then the text is chahged, if not the relation <code>change()</code>
+ * method is used.
+ */
+ protected void changeContent() {
+ if (xText != null) {
+ xText.setText("XChangeBroadcaster".equals(xText.getText()) ?
+ "NoXChangeBroadcaster" : "XChangeBroadcaster") ;
+ } else {
+ changer.change();
+ }
+ }
+
+} // finished class _XChangeBroadcaster
+
diff --git a/qadevOOo/tests/java/ifc/form/_XFormController.java b/qadevOOo/tests/java/ifc/form/_XFormController.java
new file mode 100644
index 000000000000..68a96f1c34e9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XFormController.java
@@ -0,0 +1,206 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFormController.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XWindow;
+import com.sun.star.form.XFormController;
+import com.sun.star.form.XFormControllerListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XFormController</code>
+* interface methods :
+* <ul>
+* <li><code> getCurrentControl()</code></li>
+* <li><code> addActivateListener()</code></li>
+* <li><code> removeActivateListener()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'otherWindow'</code>
+* (of type <code>com.sun.star.awt.XWindow</code>):
+* The another window is used to activate it, causing deactivating
+* of the component tested. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XFormController
+*/
+public class _XFormController extends MultiMethodTest {
+
+ public static XFormController oObj = null;
+ XWindow otherWind = null;
+
+ /**
+ * Listener which determines and stores events occured.
+ */
+ protected class MyListener implements XFormControllerListener {
+ public boolean activated = false ;
+ public boolean deactivated = false ;
+ public void disposing ( EventObject oEvent ) {}
+
+ public void init() {
+ activated = false;
+ deactivated = false;
+ }
+
+ public void formActivated(EventObject ev) {
+ activated = true ;
+ }
+
+ public void formDeactivated(EventObject ev) {
+ deactivated = true ;
+ }
+ }
+
+ MyListener listener = new MyListener() ;
+
+ /**
+ * Adds a listener, then switches focus between two windows.
+ * The current controller must be deactivated and activated.<p>
+ *
+ * Has <b> OK </b> status if listener <code>deactivate</code>
+ * and <code>activate</code> methods was called. <p>
+ */
+ public void _addActivateListener() {
+ requiredMethod("getCurrentControl()");
+ oObj.addActivateListener(listener) ;
+
+ XWindow wind = (XWindow)UnoRuntime.queryInterface(XWindow.class, cntrl);
+ wind.setFocus();
+ shortWait();
+ XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow");
+ otherWind.setFocus();
+ shortWait();
+ log.println("activated = " + listener.activated +
+ ", deactivated = " + listener.deactivated) ;
+
+ tRes.tested("addActivateListener()",
+ listener.deactivated && listener.activated) ;
+ }
+
+ /**
+ * Removes the litener added before, then switches focus between two windows.
+ *
+ * Has <b> OK </b> status if no listener methods were called. <p>
+ */
+ public void _removeActivateListener() {
+ requiredMethod("addActivateListener()") ;
+
+ oObj.removeActivateListener(listener);
+ log.println("ActiveListener removed");
+ listener.init();
+
+ XWindow wind = (XWindow)UnoRuntime.queryInterface(XWindow.class, cntrl);
+ wind.setFocus();
+ shortWait();
+ XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow");
+ otherWind.setFocus();
+ shortWait();
+ log.println("activated = " + listener.activated +
+ ", deactivated = " + listener.deactivated) ;
+
+ tRes.tested("removeActivateListener()",
+ !listener.activated && !listener.deactivated);
+ }
+
+ XControl cntrl;
+
+ /**
+ * Retrieves current control and searches for it among child controls.
+ *
+ * Has <b>OK</b> status if the current control was found among component
+ * children.
+ */
+ public void _getCurrentControl() {
+ cntrl = oObj.getCurrentControl();
+ XControl[] children = oObj.getControls() ;
+
+ boolean res = false;
+ for(int i = 0; i < children.length; i++) {
+ if (children[i].equals(cntrl)) {
+ log.println("Current control is equal to the object control" +
+ " #" + i + ":");
+ log.println(cntrl);
+ res = true;
+ break;
+ }
+ }
+
+ tRes.tested("getCurrentControl()", res) ;
+ }
+
+ /**
+ * Sleeps for 0.2 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) ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_XFormsSupplier.java b/qadevOOo/tests/java/ifc/form/_XFormsSupplier.java
new file mode 100644
index 000000000000..94458019a1f9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XFormsSupplier.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFormsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.container.XNameContainer;
+
+public class _XFormsSupplier extends lib.MultiMethodTest {
+
+ public com.sun.star.form.XFormsSupplier oObj = null;
+
+ public void _getForms() {
+ XNameContainer forms = oObj.getForms();
+ if (!forms.hasElements()) {
+ log.println("NameContainer doesn't contain forms");
+ }
+ tRes.tested("getForms()",forms.hasElements());
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/_XGrid.java b/qadevOOo/tests/java/ifc/form/_XGrid.java
new file mode 100644
index 000000000000..92fad1b19e80
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XGrid.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XGrid.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.form.XGrid;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XGrid</code>
+* interface methods :
+* <ul>
+* <li><code> getCurrentColumnPosition()</code></li>
+* <li><code> setCurrentColumnPosition(short nPos)</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XGrid
+*/
+public class _XGrid extends MultiMethodTest {
+ public XGrid oObj = null;
+ public short positionValue;
+
+ /**
+ * The method called. Then CurrentColumnPosition is obtained and
+ * compared with previously changed value.
+ * Has <b> OK </b> status if the method successfully returns
+ * and the returned value is correct.
+ */
+ public void _getCurrentColumnPosition() {
+ boolean result;
+
+ requiredMethod("setCurrentColumnPosition()");
+ log.println("Testing getCurrentColumnPosition()...");
+ if (oObj.getCurrentColumnPosition() == positionValue) {
+ result = true;
+ } else {
+ result = false;
+ }
+ tRes.tested("getCurrentColumnPosition()", result);
+ }
+
+ /**
+ * The method called. Then CurrentColumnPosition is obtained, changed
+ * and saved.
+ * Has <b> OK </b> status if no exceptions was occured.
+ */
+ public void _setCurrentColumnPosition() {
+ log.println("Testing setCurrentColumnPosition()...");
+ if (oObj.getCurrentColumnPosition() != 0) {
+ positionValue = 0;
+ } else {
+ positionValue = 1;
+ }
+ oObj.setCurrentColumnPosition(positionValue);
+ tRes.tested("setCurrentColumnPosition()", true);
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/form/_XGridColumnFactory.java b/qadevOOo/tests/java/ifc/form/_XGridColumnFactory.java
new file mode 100644
index 000000000000..e4895e66a388
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XGridColumnFactory.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XGridColumnFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.form.XGridColumnFactory;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.form.XGridColumnFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createColumn()</code></li>
+* <li><code> getColumnTypes()</code></li>
+* </ul>
+* Test is multithread compilant. <p>
+* @see com.sun.star.form.XGridColumnFactory
+*/
+public class _XGridColumnFactory extends MultiMethodTest {
+
+ public XGridColumnFactory oObj = null;
+
+
+ /**
+ * Test calls the method and checks return value. <p>
+ * Has <b> OK </b> status if the method returns
+ * non null value.
+ */
+ public void _getColumnTypes() {
+
+ String[] types = oObj.getColumnTypes();
+ tRes.tested("getColumnTypes()",types!=null);
+ }
+
+ /**
+ * Creates column of type 'TextField'. <p>
+ * Has <b>OK</b> status if non null value returned.
+ */
+ public void _createColumn() {
+
+ try {
+ XPropertySet column = oObj.createColumn("TextField");
+ tRes.tested("createColumn()",column!=null);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured while creating Column");
+ tRes.tested("createColumn()",false);
+ }
+ }
+} // finish class _XGridColumnFactory
+
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XGridFieldDataSupplier.java b/qadevOOo/tests/java/ifc/form/_XGridFieldDataSupplier.java
new file mode 100644
index 000000000000..3552f74ffb6e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XGridFieldDataSupplier.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XGridFieldDataSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.form.XGridFieldDataSupplier;
+import com.sun.star.uno.Type;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XGridFieldDataSupplier</code>
+* interface methods :
+* <ul>
+* <li><code>queryFieldDataType()</code></li>
+* <li><code>queryFieldData()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XGridFieldDataSupplier
+*/
+public class _XGridFieldDataSupplier extends MultiMethodTest {
+ public XGridFieldDataSupplier oObj = null;
+
+ /**
+ * Calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is not null.
+ */
+ public void _queryFieldDataType() {
+ boolean[] dataType = oObj.queryFieldDataType(new Type(String.class));
+ tRes.tested("queryFieldDataType()", dataType != null);
+ }
+
+ /**
+ * Calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is not null.
+ */
+ public void _queryFieldData() {
+ Object[] data = oObj.queryFieldData(0, new Type(String.class));
+ tRes.tested("queryFieldData()", data != null);
+ }
+}// finish class _XGridFieldDataSupplier
+
diff --git a/qadevOOo/tests/java/ifc/form/_XImageProducerSupplier.java b/qadevOOo/tests/java/ifc/form/_XImageProducerSupplier.java
new file mode 100644
index 000000000000..87f40a02a34e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XImageProducerSupplier.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XImageProducerSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.awt.XImageProducer;
+import com.sun.star.form.XImageProducerSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XImageProducerSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getImageProducer()</code></li>
+* </ul>
+* @see com.sun.star.form.XImageProducerSupplier
+*/
+public class _XImageProducerSupplier extends MultiMethodTest {
+
+ public XImageProducerSupplier oObj = null;
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if the method returns non null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getImageProducer() {
+ boolean bResult = false;
+ XImageProducer ip = oObj.getImageProducer();
+ bResult = ip!=null;
+ tRes.tested("getImageProducer()", bResult);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XLoadListener.java b/qadevOOo/tests/java/ifc/form/_XLoadListener.java
new file mode 100644
index 000000000000..5e5fa53615ed
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XLoadListener.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLoadListener.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.form.XLoadListener;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XLoadListener</code>
+* interface methods :
+* <ul>
+* <li><code> loaded()</code></li>
+* <li><code> unloading()</code></li>
+* <li><code> unloaded()</code></li>
+* <li><code> reloading()</code></li>
+* <li><code> reloaded()</code></li>
+* </ul> <p>
+* This interface methods are not testable, because their
+* behaviour is not documented.
+* @see com.sun.star.form.XLoadListener
+*/
+public class _XLoadListener extends MultiMethodTest {
+
+ public XLoadListener oObj = null;
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _loaded() {
+ log.println("nothing to test here");
+ tRes.tested("loaded()",true);
+ }
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _reloaded() {
+ log.println("nothing to test here");
+ tRes.tested("reloaded()",true);
+ }
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _reloading() {
+ log.println("nothing to test here");
+ tRes.tested("reloading()",true);
+ }
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _unloaded() {
+ log.println("nothing to test here");
+ tRes.tested("unloaded()",true);
+ }
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _unloading() {
+ log.println("nothing to test here");
+ tRes.tested("unloading()",true);
+ }
+
+} //EOF of XLoadListener
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XLoadable.java b/qadevOOo/tests/java/ifc/form/_XLoadable.java
new file mode 100644
index 000000000000..378248f9c356
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XLoadable.java
@@ -0,0 +1,276 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLoadable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+
+import com.sun.star.form.XLoadable;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XLoadable</code>
+* interface methods :
+* <ul>
+* <li><code> load()</code></li>
+* <li><code> unload()</code></li>
+* <li><code> reload()</code></li>
+* <li><code> isLoaded()</code></li>
+* <li><code> addLoadListener()</code></li>
+* <li><code> removeLoadListener()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XLoadable
+*/
+public class _XLoadable extends MultiMethodTest {
+
+ public XLoadable oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestLoadListener implements com.sun.star.form.XLoadListener {
+ public boolean disposingCalled = false ;
+ public boolean loadedCalled = false ;
+ public boolean reloadedCalled = false ;
+ public boolean reloadingCalled = false ;
+ public boolean unloadedCalled = false ;
+ public boolean unloadingCalled = false ;
+ private java.io.PrintWriter log = null ;
+
+ public TestLoadListener(java.io.PrintWriter log) {
+ this.log = log ;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ log.println(" disposing was called.") ;
+ }
+
+ public void loaded(com.sun.star.lang.EventObject e) {
+ loadedCalled = true ;
+ log.println(" loaded was called.") ;
+ }
+
+ public void reloaded(com.sun.star.lang.EventObject e) {
+ reloadedCalled = true ;
+ log.println(" reloaded was called.") ;
+ }
+
+ public void reloading(com.sun.star.lang.EventObject e) {
+ reloadingCalled = true ;
+ log.println(" reloading was called.") ;
+ }
+
+ public void unloaded(com.sun.star.lang.EventObject e) {
+ unloadedCalled = true ;
+ log.println(" unloaded was called.") ;
+ }
+
+ public void unloading(com.sun.star.lang.EventObject e) {
+ unloadingCalled = true ;
+ log.println(" unloading was called.") ;
+ }
+ }
+
+ TestLoadListener loadListener = null ;
+
+ /**
+ * Creates new listener.
+ */
+ public void before() {
+ loadListener = new TestLoadListener(log) ;
+ }
+
+ /**
+ * Waits for 0.1 second. Used to get time for load completion.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {}
+ }
+
+ /**
+ * Loads the form. <p>
+ * Has <b> OK </b> status if <code>isLoaded()</code> returns
+ * <code>true</code> and listener method <code>loaded()</code>
+ * is called.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> isLoaded() </code> : to be sure form is not loaded </li>
+ * <li> <code> addLoadListener() </code> : to check if this listener method
+ * is called. </li>
+ * </ul>
+ */
+ public void _load() {
+ requiredMethod("isLoaded()") ;
+ requiredMethod("addLoadListener()") ;
+
+ boolean result = true ;
+ oObj.load() ;
+
+ shortWait() ;
+ result = oObj.isLoaded() && loadListener.loadedCalled ;
+
+ tRes.tested("load()", result) ;
+ }
+
+ /**
+ * Unloads the form. <p>
+ * Has <b> OK </b> status if <code>isLoaded()</code> returns
+ * <code>false</code> and listener method <code>unloaded()</code>
+ * is called.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> reload() </code> : to be sure the form is loaded </li>
+ * <li> <code> addLoadListener() </code> : to check if this listener method
+ * is called. </li>
+ * </ul>
+ */
+ public void _unload() {
+ requiredMethod("reload()") ;
+ requiredMethod("addLoadListener()") ;
+
+ boolean result = true ;
+ oObj.unload() ;
+
+ shortWait() ;
+ result = !oObj.isLoaded() && loadListener.unloadedCalled ;
+
+ tRes.tested("unload()", result) ;
+ }
+
+ /**
+ * Reloads the form. <p>
+ * Has <b> OK </b> status if <code>isLoaded()</code> returns
+ * <code>true</code> and listener method <code>reloaded()</code>
+ * is called.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> load() </code> : to be sure form is loaded </li>
+ * <li> <code> addLoadListener() </code> : to check if this listener method
+ * is called. </li>
+ * </ul>
+ */
+ public void _reload() {
+ requiredMethod("load()") ;
+ requiredMethod("addLoadListener()") ;
+
+ boolean result = true ;
+ oObj.reload() ;
+
+ shortWait() ;
+ result = oObj.isLoaded() && loadListener.reloadedCalled;
+
+ tRes.tested("reload()", result) ;
+ }
+
+ /**
+ * Checks if the component is already loaded. If yes it unloads
+ * it <p>
+ * Has <b> OK </b> status if finally <code>isLoaded()</code> method
+ * returns <code>false</code>.
+ */
+ public void _isLoaded() {
+ boolean result = true ;
+ boolean isLoaded = oObj.isLoaded() ;
+ if (isLoaded) oObj.unload();
+ isLoaded = oObj.isLoaded() ;
+
+ tRes.tested("isLoaded()", !isLoaded) ;
+ }
+
+ /**
+ * Adds a listener. If its methods are called or not is checked
+ * in other object methods. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _addLoadListener() {
+
+ boolean result = true ;
+ oObj.addLoadListener(loadListener) ;
+
+ tRes.tested("addLoadListener()", result) ;
+ }
+
+ /**
+ * Removes the listener added before. <p>
+ * Has <b> OK </b> status if after <code>load()</code> call no
+ * listener methods were called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> unload() </code> : to make this test run finally.</li>
+ * </ul>
+ */
+ public void _removeLoadListener() {
+ requiredMethod("unload()") ;
+
+ boolean result = true ;
+ oObj.removeLoadListener(loadListener) ;
+ loadListener.loadedCalled = false ;
+ oObj.load();
+
+ result = ! loadListener.loadedCalled ;
+
+ tRes.tested("removeLoadListener()", result) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_XReset.java b/qadevOOo/tests/java/ifc/form/_XReset.java
new file mode 100644
index 000000000000..26826ed61477
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XReset.java
@@ -0,0 +1,227 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XReset.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.form.XReset;
+import com.sun.star.form.XResetListener;
+import com.sun.star.lang.EventObject;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XReset</code>
+* interface methods :
+* <ul>
+* <li><code> reset()</code></li>
+* <li><code> addResetListener()</code></li>
+* <li><code> removeResetListener()</code></li>
+* </ul>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XReset
+*/
+public class _XReset extends MultiMethodTest {
+
+ public static XReset oObj = null;
+
+ /**
+ * Indicates if listeners must approve restes requests or not.
+ */
+ protected boolean approve = true;
+ /**
+ * Array of two elements, each of them indicates <code>resetted</code>
+ * call of appropriate listener.
+ */
+ protected boolean resetted[] = new boolean[2];
+ /**
+ * Array of two elements, each of them indicates
+ * <code>approveReset</code> call of appropriate listener.
+ */
+ protected boolean approveReset[] = new boolean[2];
+
+ /**
+ * The listener which sets flags (in array elements with index 0)
+ * on <code>resetted</code> and
+ * <code>approveReset</code> events. It approves reset request
+ * depending on <code>approve</code> field.
+ */
+ protected class MyResetListener implements XResetListener {
+ public void disposing ( EventObject oEvent ) {}
+ public boolean approveReset ( EventObject oEvent ) {
+ approveReset[0] = true;
+ //cancel the reset action
+ return approve;
+ }
+ public void resetted ( EventObject oEvent ) {
+ resetted[0] = true;
+ }
+ }
+
+
+ /**
+ * The listener which sets flags (in array elements with index 1)
+ * on <code>resetted</code> and
+ * <code>approveReset</code> events. It approves reset request
+ * depending on <code>approve</code> field.
+ */
+ protected class MyResetListener2 implements XResetListener {
+ public void disposing ( EventObject oEvent ) {}
+ public boolean approveReset ( EventObject oEvent ) {
+ approveReset[1] = true;
+ //don't cancel the reset action
+ return true;
+ }
+ public void resetted ( EventObject oEvent ) {
+ resetted[1] = true;
+ }
+ }
+
+ /**
+ * Listener which is added in test
+ */
+ protected XResetListener listener1 = new MyResetListener();
+ /**
+ * Listener which is added in test
+ */
+ protected XResetListener listener2 = new MyResetListener2();
+
+ /**
+ * Just adds two reset listeners. <p>
+ * Status for it is set later in <code>reset</code> method test.
+ */
+ public void _addResetListener() {
+
+ log.println("Testing addResetListener ...");
+ oObj.addResetListener( listener2 );
+ oObj.addResetListener( listener1 );
+
+ } // finished _addResetListener()
+
+ /**
+ * First calls <code>reset</code> method without approving
+ * the request, in this case only <code>approveReset</code>
+ * event must be called. Second calls <code>reset</code> with
+ * approving the request. In this case both listener's events
+ * must be called. <p>
+ * Has <b>OK</b> status for <code>reset</code> method if in
+ * the first case only <code>approveReset</code> method was
+ * called. <p>
+ * Has <b>OK</b> status for <code>addResetListener</code> method
+ * if in the second case both listener's methods were called.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addResetListener </code> : to have listeners added.</li>
+ * </ul>
+ */
+ public void _reset() {
+
+ executeMethod("addResetListener()");
+ log.println("Testing reset() ...");
+ approve = false;
+ oObj.reset();
+ shortWait();
+ tRes.tested("reset()", (approveReset[0] && (! resetted[0])));
+ approve = true;
+ oObj.reset();
+ shortWait();
+ tRes.tested("addResetListener()", (approveReset[1] && resetted[1]));
+
+ } // finished _reset
+
+ /**
+ * Removes the first listener, clears it's call flags, and
+ * calls <code>reset</code> method.<p>
+ * Has <b> OK </b> status if no methods of the listener removed
+ * were called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> reset </code> : to test this method last. </li>
+ * </ul>
+ */
+ public void _removeResetListener() {
+ requiredMethod("reset()");
+ log.println("Testing removeResetListener ...");
+ approveReset[0] = resetted[0] = false;
+ oObj.removeResetListener(listener1);
+ oObj.reset();
+ shortWait();
+ tRes.tested("removeResetListener()", !approveReset[0] && !resetted[0]);
+ //removing the second listener here may avoid crashing the office
+
+ return;
+
+ } // finished _removeResetListener()
+
+ /**
+ * 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) ;
+ }
+ }
+
+
+} // finished class _XRefresh
+
+
diff --git a/qadevOOo/tests/java/ifc/form/_XSubmit.java b/qadevOOo/tests/java/ifc/form/_XSubmit.java
new file mode 100644
index 000000000000..417cb3266b58
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XSubmit.java
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSubmit.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.awt.MouseEvent;
+import com.sun.star.awt.XControl;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.form.XSubmit;
+import com.sun.star.form.XSubmitListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.form.XSubmit</code>
+* interface methods :
+* <ul>
+* <li><code> submit()</code></li>
+* <li><code> addSubmitListener()</code></li>
+* <li><code> removeSubmitListener()</code></li>
+* </ul> <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XSubmit.Control'</code> <b>optional</b>
+* (of type <code>com.sun.star.awt.XControl</code>):
+* is used to pass as parameters to <code>submit</code>
+* method. <code>null</code> is passed if the relation
+* is not found.</li>
+* <ul> <p>
+*
+* Other <b> prerequicity </b> is the object must have
+* <code>TargetURL</code> property. <p>
+*
+* Short description : test adds two listeners, call
+* <code> submit </code> method and cecks if both listeners
+* were called. Then one listener is removed and after
+* <code> submit </code> method call it must not be called. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XSubmit
+*/
+public class _XSubmit extends MultiMethodTest {
+
+ public static XSubmit oObj = null;
+
+ public class MySubmitListener implements XSubmitListener {
+ public int called = 0 ;
+ public void disposing ( EventObject oEvent ) {
+ }
+ public boolean approveSubmit( EventObject oEvent ) {
+ called += 1;
+ System.out.println("Listener called");
+ return true;
+ }
+ }
+
+
+ MySubmitListener listener1 = new MySubmitListener();
+ MySubmitListener listener2 = new MySubmitListener();
+
+ /**
+ * Just adds two submit listeners. <p>
+ * Status of this method test is defined in <code>
+ * submit </code> method test.
+ */
+ public void _addSubmitListener() {
+ log.println("Testing addSubmitListener ...");
+ oObj.addSubmitListener( listener1 );
+ oObj.addSubmitListener( listener2 );
+ }
+
+ /**
+ * Before submision tries to set 'TargetURL' property
+ * of component to some value assuming that component
+ * supports <code>com.sun.star.form.HTMLForm</code>
+ * service.
+ * Then calls the <code> submit </code> method and checks
+ * if listener removed were not called, and other was
+ * called only once.<p>
+ *
+ * Has <b> OK </b> status for <code>submit</code> if
+ * listener was called at least ones, for
+ * <code>addSubmitListener</code> method if the remaining
+ * listener was called only once, for
+ * <code>removeSubmitListener</code> method if the removed
+ * listener was not called. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> removeSubmitListener </code> : to have one listener
+ * added and other removed.</li>
+ * </ul>
+ */
+ public void _submit() {
+ executeMethod("removeSubmitListener()");
+ log.println("Testing submit() ...");
+ XControl cntrl = (XControl) tEnv.getObjRelation("XSubmit.Control") ;
+
+ XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oObj) ;
+
+ if (xPS != null) {
+ try {
+ xPS.setPropertyValue("TargetURL", "someserver");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ }
+ } else {
+ log.println("!!! The tested compoennt doesn't support XPropertySet ");
+ }
+
+ oObj.submit(cntrl, new MouseEvent());
+ shortWait();
+
+ log.println("Listener1 called " + listener1.called + " times");
+ log.println("Listener2 called " + listener2.called + " times");
+
+ tRes.tested("addSubmitListener()", listener2.called == 1);
+ tRes.tested("removeSubmitListener()", listener1.called == 0);
+ tRes.tested("submit()", listener2.called > 0);
+ }
+
+ /**
+ * Just removes one of submit listeners. <p>
+ * Status of this method test is defined in <code>
+ * submit </code> method test.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> removeSubmitListener </code> : to have listeners added</li>
+ * </ul>
+ */
+ public void _removeSubmitListener() {
+ requiredMethod("addSubmitListener()");
+ oObj.removeSubmitListener(listener1);
+ }
+
+ /**
+ * 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) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java
new file mode 100644
index 000000000000..c9f0837ac42f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java
@@ -0,0 +1,281 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XUpdateBroadcaster.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form;
+
+import com.sun.star.form.XUpdateBroadcaster;
+import com.sun.star.form.XUpdateListener;
+import com.sun.star.lang.EventObject;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.form.XUpdateBroadcaster</code>
+* interface methods :
+* <ul>
+* <li><code> addUpdateListener()</code></li>
+* <li><code> removeUpdateListener()</code></li>
+* </ul>
+* This test needs the following object relations :
+* <ul>
+* <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>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.form.XUpdateBroadcaster
+*/
+public class _XUpdateBroadcaster extends MultiMethodTest {
+
+ public XUpdateBroadcaster oObj = null;
+ UpdateChecker checker = null ;
+
+ /**
+ * Interface for relation. Updating, commiting and checking
+ * if data was commited is object dependent behaviour.
+ */
+ public static interface UpdateChecker {
+ /**
+ * Method must make some data update in the object tested.
+ */
+ public void update() throws com.sun.star.uno.Exception ;
+ /**
+ * Method must commit data change made by method <code>update</code>.
+ */
+ public void commit() throws com.sun.star.uno.Exception ;
+ /**
+ * Checks if the data commited by <code>commit</code> method
+ * became permanent in data source.
+ * @return <code>true</code> if data was commited.
+ */
+ public boolean wasCommited() throws com.sun.star.uno.Exception ;
+ }
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ checker = (UpdateChecker)
+ tEnv.getObjRelation("XUpdateBroadcaster.Checker") ;
+ if (checker == null) {
+ log.println("Relation not found") ;
+ throw new StatusException("Relation not found",
+ new NullPointerException("Relation not found")) ;
+ }
+ }
+
+ /**
+ * Listener implementation, which can accept or reject update
+ * requests and store event calls.
+ */
+ protected class TestListener implements XUpdateListener {
+ /**
+ * Indicates must listener approve update requests or not.
+ */
+ public boolean approve = false ;
+ /**
+ * Indicates that <code>approveUpdate</code> method was called.
+ */
+ public boolean approveCalled = false ;
+ /**
+ * Indicates that <code>updated</code> method was called.
+ */
+ public boolean updateCalled = false ;
+
+ /**
+ * Clears all flags.
+ */
+ public void init() {
+ approveCalled = false ;
+ updateCalled = false ;
+ }
+ public void disposing(EventObject ev) {}
+ public boolean approveUpdate(EventObject ev) {
+ approveCalled = true ;
+ return approve ;
+ }
+ public void updated(EventObject ev) {
+ updateCalled = true ;
+ }
+ }
+
+ private TestListener listener = new TestListener();
+
+ /**
+ * The listener methods calls are checked twice with approving
+ * and rejecting updates. <p>
+ * Has <b>OK</b> status if on update rejected only <code>
+ * approveUpdate</code> listener method was called, and if
+ * on update approved <code>approveUpdate</code> and
+ * <code>updated</code> methods called, and data was commited
+ * to the source.
+ */
+ public void _addUpdateListener() {
+ boolean bResult = true;
+
+ oObj.addUpdateListener(listener) ;
+
+ try {
+ checker.update() ;
+ shortWait() ;
+ checker.commit() ;
+ shortWait() ;
+ boolean commited = checker.wasCommited() ;
+
+ shortWait() ;
+
+ bResult = listener.approveCalled &&
+ ! listener.updateCalled &&
+ ! commited ;
+
+ log.println("Calling with no approving : approveUpdate() was " +
+ (listener.approveCalled ? "":"NOT")+" called, updated() was "+
+ (listener.updateCalled ? "":"NOT")+" called, the value was " +
+ (commited ? "" : "NOT") + " commited.") ;
+
+ shortWait() ;
+
+ listener.init() ;
+ listener.approve = true ;
+ shortWait() ;
+ checker.update() ;
+ shortWait() ;
+ checker.commit() ;
+ shortWait() ;
+ commited = checker.wasCommited() ;
+
+ shortWait() ;
+
+ log.println("Calling with approving : approveUpdate() was " +
+ (listener.approveCalled ? "":"NOT")+" called, updated() was "+
+ (listener.updateCalled ? "":"NOT")+" called, the value was "+
+ (commited ? "" : "NOT") + " commited.") ;
+
+ bResult = listener.approveCalled &&
+ listener.updateCalled &&
+ commited ;
+ } catch (com.sun.star.uno.Exception e) {
+ bResult = false ;
+ e.printStackTrace(log) ;
+ }
+
+ tRes.tested("addUpdateListener()", bResult);
+ }
+
+ /**
+ * Removes listener, updates data, and checks if no listener
+ * methods were called. <p>
+ * Has <b> OK </b> status if after listener removing no of its methods
+ * were called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addUpdateListener </code> : to have a listener added.</li>
+ * </ul>
+ */
+ public void _removeUpdateListener() {
+ requiredMethod("addUpdateListener()");
+ boolean bResult = true;
+
+ listener.init() ;
+ listener.approve = true ;
+
+ oObj.removeUpdateListener(listener);
+
+ try {
+ checker.update() ;
+ shortWait() ;
+ checker.commit() ;
+
+ shortWait() ;
+
+ bResult = ! listener.approveCalled &&
+ ! listener.updateCalled ;
+ }
+ catch (com.sun.star.uno.Exception e) {
+ log.println("Exception occured during removeUpdateListener()");
+ e.printStackTrace(log);
+ bResult = false;
+ }
+
+ tRes.tested("removeUpdateListener()", bResult);
+ }
+
+ private void shortWait() {
+ try {
+ Thread.sleep(200);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_CheckBox.java b/qadevOOo/tests/java/ifc/form/component/_CheckBox.java
new file mode 100644
index 000000000000..7325fd281c79
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_CheckBox.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CheckBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.CheckBox</code>
+* service properties :
+* <ul>
+* <li><code> DefaultState</code></li>
+* <li><code> RefValue</code></li>
+* </ul> <p>
+* @see com.sun.star.form.component.CheckBox
+*/
+public class _CheckBox extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_ComboBox.java b/qadevOOo/tests/java/ifc/form/component/_ComboBox.java
new file mode 100644
index 000000000000..b789049c558f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_ComboBox.java
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ComboBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.ComboBox</code>
+* service properties :
+* <ul>
+* <li><code> DefaultText</code></li>
+* </ul> <p>
+* @see com.sun.star.form.component.ComboBox
+*/
+public class _ComboBox extends MultiPropertyTest {
+ // these properties don't needed in special code.
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_CommandButton.java b/qadevOOo/tests/java/ifc/form/component/_CommandButton.java
new file mode 100644
index 000000000000..de22ff02371e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_CommandButton.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CommandButton.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.CommandButton</code>
+* service properties :
+* <ul>
+* <li><code> ButtonType</code></li>
+* <li><code> TargetFrame</code></li>
+* <li><code> TargetURL</code></li>
+* </ul>
+* @see com.sun.star.form.component.CommandButton
+*/
+public class _CommandButton extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_CurrencyField.java b/qadevOOo/tests/java/ifc/form/component/_CurrencyField.java
new file mode 100644
index 000000000000..c29eceac8368
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_CurrencyField.java
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CurrencyField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+
+/**
+* Testing <code>com.sun.star.form.component.CurrencyField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultValue</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.CurrencyField
+*/
+public class _CurrencyField extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _DefaultValue() {
+ testProperty("DefaultValue", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return util.utils.isVoid(old) ? new Double(17.5) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+} // finish class _CurrencyField
+
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DataForm.java b/qadevOOo/tests/java/ifc/form/component/_DataForm.java
new file mode 100644
index 000000000000..78ff7d104568
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DataForm.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DataForm.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import com.sun.star.form.TabulatorCycle;
+import com.sun.star.uno.Enum;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.form.component.DataForm</code>
+* service properties :
+* <ul>
+* <li><code> MasterFields</code></li>
+* <li><code> DetailFields</code></li>
+* <li><code> Cycle</code></li>
+* <li><code> NavigationBarMode</code></li>
+* <li><code> AllowInserts</code></li>
+* <li><code> AllowUpdates</code></li>
+* <li><code> AllowDeletes</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DataForm
+*/
+public class _DataForm extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _NavigationBarMode() {
+ testProperty("NavigationBarMode", new PropertyTester() {
+ public String toString(Object obj) {
+ if (util.utils.isVoid(obj)) {
+ return "null";
+ } else {
+ return "(" + obj.getClass().toString() + ")"
+ + ((Enum)obj).getValue();
+ }
+ }
+ });
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _Cycle() {
+ testProperty("Cycle", new PropertyTester() {
+ public Object getNewValue(String propName, Object oldValue) {
+ return TabulatorCycle.CURRENT;
+ }
+ public String toString(Object obj) {
+ if (util.utils.isVoid(obj))
+ return "null";
+ else
+ return "(" + obj.getClass().toString() + ")"
+ + ((Enum)obj).getValue();
+ }
+ });
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseComboBox.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseComboBox.java
new file mode 100644
index 000000000000..31e759161664
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseComboBox.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DatabaseComboBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component ;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.DatabaseComboBox</code>
+* service properties :
+* <ul>
+* <li><code> ConvertEmptyToNull</code></li>
+* <li><code> ListSource</code></li>
+* <li><code> ListSourceType</code></li>
+* </ul> <p>
+* All properties are tested by class <code>MultiPropertyTest</code>
+* @see com.sun.star.form.component.DatabaseComboBox
+*/
+public class _DatabaseComboBox extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseFormattedField.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseFormattedField.java
new file mode 100644
index 000000000000..57b4d8fc5862
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseFormattedField.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DatabaseFormattedField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component ;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.DatabaseFormattedField</code>
+* service properties :
+* <ul>
+* <li><code> ConvertEmptyToNull</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DatabaseFormattedField
+*/
+public class _DatabaseFormattedField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseImageControl.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseImageControl.java
new file mode 100644
index 000000000000..5c6828329911
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseImageControl.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DatabaseImageControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.DatabaseImageControl</code>
+* service properties :
+* <ul>
+* <li><code> ReadOnly</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DatabaseImageControl
+*/
+public class _DatabaseImageControl extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseListBox.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseListBox.java
new file mode 100644
index 000000000000..3c762b674669
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseListBox.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DatabaseListBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/*
+* Testing <code>com.sun.star.form.component.DatabaseListBox</code>
+* service properties :
+* <ul>
+* <li><code> BoundColumn</code></li>
+* <li><code> ListSourceType</code></li>
+* </ul> <p>
+* All properties testing is automated by
+* <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DatabaseListBox
+*/
+public class _DatabaseListBox extends MultiPropertyTest {
+ // these properties don't needed in special code.
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabasePatternField.java b/qadevOOo/tests/java/ifc/form/component/_DatabasePatternField.java
new file mode 100644
index 000000000000..37a0a71e6567
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabasePatternField.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DatabasePatternField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.DatabasePatternField</code>
+* service properties :
+* <ul>
+* <li><code> ConvertEmptyToNull</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.DatabasePatternField
+*/
+public class _DatabasePatternField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DatabaseTextField.java b/qadevOOo/tests/java/ifc/form/component/_DatabaseTextField.java
new file mode 100644
index 000000000000..97448832dbe0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DatabaseTextField.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DatabaseTextField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.DatabaseTextField</code>
+* service properties :
+* <ul>
+* <li><code> ConvertEmptyToNull</code></li>
+* </ul> <p>
+* All properties are tested by class <code>MultiPropertyTest</code>
+* @see com.sun.star.form.component.DatabaseTextField
+*/
+public class _DatabaseTextField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_DateField.java b/qadevOOo/tests/java/ifc/form/component/_DateField.java
new file mode 100644
index 000000000000..cce06b46280e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_DateField.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DateField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.form.component.DateField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultDate</code></li>
+* </ul>
+* @see com.sun.star.form.component.DateField
+*/
+public class _DateField extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _DefaultDate() {
+ testProperty("DefaultDate", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Integer(20010507) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_FileControl.java b/qadevOOo/tests/java/ifc/form/component/_FileControl.java
new file mode 100644
index 000000000000..acaa2e5dba3f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_FileControl.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _FileControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/*
+* Testing <code>com.sun.star.form.component.FileControl</code>
+* service properties :
+* <ul>
+* <li><code> DefaultText</code></li>
+* </ul>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.FileControl
+*/
+public class _FileControl extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_GridControl.java b/qadevOOo/tests/java/ifc/form/component/_GridControl.java
new file mode 100644
index 000000000000..ec83ef64cd1e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_GridControl.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: _GridControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.form.component.GridControl</code>
+* service properties :
+* <ul>
+* <li><code> Border</code></li>
+* <li><code> Enabled</code></li>
+* <li><code> FontDescriptor</code></li>
+* <li><code> RowHeight</code></li>
+* <li><code> Tabstop</code></li>
+* <li><code> TextColor</code></li>
+* </ul>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.GridControl
+*/
+public class _GridControl extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _RowHeight() {
+ testProperty("RowHeight", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Integer(11) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _Tabstop() {
+ testProperty("Tabstop", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Boolean(true) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _TextColor() {
+ testProperty("TextColor", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Integer(342) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+} // finish class _GridControl
+
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_HTMLForm.java b/qadevOOo/tests/java/ifc/form/component/_HTMLForm.java
new file mode 100644
index 000000000000..fc2b7e344d9e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_HTMLForm.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * $RCSfile: _HTMLForm.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.HTMLForm</code>
+* service properties :
+* <ul>
+* <li><code> TargetFrame</code></li>
+* <li><code> TargetURL</code></li>
+* <li><code> SubmitMethod</code></li>
+* <li><code> SubmitEncoding</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.HTMLForm
+*/
+public class _HTMLForm extends MultiPropertyTest {
+
+} // finish class _HTMLForm
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_HiddenControl.java b/qadevOOo/tests/java/ifc/form/component/_HiddenControl.java
new file mode 100644
index 000000000000..4418f0b6d5bc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_HiddenControl.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _HiddenControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.HiddenControl</code>
+* service properties :
+* <ul>
+* <li><code> HiddenValue</code></li>
+* </ul>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.HiddenControl
+*/
+public class _HiddenControl extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_ImageButton.java b/qadevOOo/tests/java/ifc/form/component/_ImageButton.java
new file mode 100644
index 000000000000..a688cecdd4dc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_ImageButton.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ImageButton.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.ImageButton</code>
+* service properties :
+* <ul>
+* <li><code> ButtonType</code></li>
+* <li><code> TargetFrame</code></li>
+* <li><code> TargetURL</code></li>
+* </ul>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.ImageButton
+*/
+public class _ImageButton extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_ListBox.java b/qadevOOo/tests/java/ifc/form/component/_ListBox.java
new file mode 100644
index 000000000000..0df8855d49b1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_ListBox.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ListBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.ListBox</code>
+* service properties :
+* <ul>
+* <li><code> DefaultSelection</code></li>
+* <li><code> ListSource</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.ListBox
+*/
+public class _ListBox extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_NumericField.java b/qadevOOo/tests/java/ifc/form/component/_NumericField.java
new file mode 100644
index 000000000000..142098267a6f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_NumericField.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: _NumericField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+
+/**
+* Testing <code>com.sun.star.form.component.NumericField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultValue</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.NumericField
+*/
+public class _NumericField extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _DefaultValue() {
+ testProperty("DefaultValue", new PropertyTester() {
+ protected Object getNewValue(String prop, Object old) {
+ return util.utils.isVoid(old) ? new Double(111.11) :
+ super.getNewValue(prop, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_PatternField.java b/qadevOOo/tests/java/ifc/form/component/_PatternField.java
new file mode 100644
index 000000000000..2a97a87a86d0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_PatternField.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _PatternField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.PatternField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultText</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.PatternField
+*/
+public class _PatternField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_RadioButton.java b/qadevOOo/tests/java/ifc/form/component/_RadioButton.java
new file mode 100644
index 000000000000..298df33417b2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_RadioButton.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _RadioButton.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.form.component.RadioButton</code>
+* service properties :
+* <ul>
+* <li><code> DefaultState</code></li>
+* <li><code> RefValue</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.RadioButton
+*/
+public class _RadioButton extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_TextField.java b/qadevOOo/tests/java/ifc/form/component/_TextField.java
new file mode 100644
index 000000000000..15fdf477bc8e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_TextField.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.form.component.TextField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultText</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.TextField
+*/
+public class _TextField extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/form/component/_TimeField.java b/qadevOOo/tests/java/ifc/form/component/_TimeField.java
new file mode 100644
index 000000000000..f7948fa4e739
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/form/component/_TimeField.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TimeField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:09:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.form.component;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.form.component.TimeField</code>
+* service properties :
+* <ul>
+* <li><code> DefaultTime</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.form.component.TimeField
+*/
+public class _TimeField extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must defined.
+ */
+ public void _DefaultTime() {
+ testProperty("DefaultTime", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return utils.isVoid(old) ? new Integer(4321) :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/formula/_FormulaProperties.java b/qadevOOo/tests/java/ifc/formula/_FormulaProperties.java
new file mode 100644
index 000000000000..74c499988d30
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/formula/_FormulaProperties.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * $RCSfile: _FormulaProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.formula;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.formula.FormulaProperties</code>
+* service properties :
+* <ul>
+* <li><code> Alignment</code></li>
+* <li><code> BaseFontHeight</code></li>
+* <li><code> CustomFontNameFixed</code></li>
+* <li><code> FontFixedIsItalic</code></li>
+* <li><code> FontFixedIsBold</code></li>
+* <li><code> CustomFontNameSans</code></li>
+* <li><code> FontSansIsItalic</code></li>
+* <li><code> FontSansIsBold</code></li>
+* <li><code> CustomFontNameSerif</code></li>
+* <li><code> FontSerifIsItalic</code></li>
+* <li><code> FontSerifIsBold</code></li>
+* <li><code> FontNameFunctions</code></li>
+* <li><code> FontFunctionsIsItalic</code></li>
+* <li><code> FontFunctionsIsBold</code></li>
+* <li><code> FontNameNumbers</code></li>
+* <li><code> FontNumbersIsItalic</code></li>
+* <li><code> FontNumbersIsBold</code></li>
+* <li><code> FontNameText</code></li>
+* <li><code> FontTextIsItalic</code></li>
+* <li><code> FontTextIsBold</code></li>
+* <li><code> FontNameVariables</code></li>
+* <li><code> FontVariablesIsItalic</code></li>
+* <li><code> FontVariablesIsBold</code></li>
+* <li><code> Formula</code></li>
+* <li><code> IsScaleAllBrackets</code></li>
+* <li><code> IsTextMode</code></li>
+* <li><code> RelativeFontHeightFunctions</code></li>
+* <li><code> RelativeFontHeightIndices</code></li>
+* <li><code> RelativeFontHeightLimits</code></li>
+* <li><code> RelativeFontHeightOperators</code></li>
+* <li><code> RelativeFontHeightText</code></li>
+* <li><code> RelativeBracketDistance</code></li>
+* <li><code> RelativeBracketExcessSize</code></li>
+* <li><code> RelativeFractionBarExcessLength</code></li>
+* <li><code> RelativeFractionBarLineWeight</code></li>
+* <li><code> RelativeFractionDenominatorDepth</code></li>
+* <li><code> RelativeFractionNumeratorHeight</code></li>
+* <li><code> RelativeIndexSubscript</code></li>
+* <li><code> RelativeIndexSuperscript</code></li>
+* <li><code> RelativeLineSpacing</code></li>
+* <li><code> RelativeLowerLimitDistance</code></li>
+* <li><code> RelativeMatrixColumnSpacing</code></li>
+* <li><code> RelativeMatrixLineSpacing</code></li>
+* <li><code> RelativeOperatorExcessSize</code></li>
+* <li><code> RelativeOperatorSpacing</code></li>
+* <li><code> RelativeRootSpacing</code></li>
+* <li><code> RelativeScaleBracketExcessSize</code></li>
+* <li><code> RelativeSpacing</code></li>
+* <li><code> RelativeSymbolMinimumHeight</code></li>
+* <li><code> RelativeSymbolPrimaryHeight</code></li>
+* <li><code> RelativeUpperLimitDistance</code></li>
+* <li><code> TopMargin</code></li>
+* <li><code> BottomMargin</code></li>
+* <li><code> LeftMargin</code></li>
+* <li><code> RightMargin</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.formula.FormulaProperties
+*/
+public class _FormulaProperties extends MultiPropertyTest {
+
+
+} // finish class _FormulaProperties
+
diff --git a/qadevOOo/tests/java/ifc/frame/_Frame.java b/qadevOOo/tests/java/ifc/frame/_Frame.java
new file mode 100644
index 000000000000..215af076f0df
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_Frame.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Frame.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import lib.MultiPropertyTest;
+
+public class _Frame extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_SynchronousFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_SynchronousFrameLoader.java
new file mode 100644
index 000000000000..ef975ce139ae
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_SynchronousFrameLoader.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SynchronousFrameLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.frame.SynchronousFrameLoader</code>
+* service properties :
+* <ul>
+* <li><code> Types</code></li>
+* <li><code> UIName</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.frame.SynchronousFrameLoader
+*/
+public class _SynchronousFrameLoader extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java
new file mode 100644
index 000000000000..6ca2bf6fdcc1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XComponentLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.beans.PropertyState;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.lang.XComponent;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.frame.XComponentLoader</code>
+* interface methods:
+* <ul>
+* <li><code> loadComponentFromURL() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XComponentLoader
+*/
+public class _XComponentLoader extends MultiMethodTest {
+ public XComponentLoader oObj = null; // oObj filled by MultiMethodTest
+
+ /**
+ * Method which tests the objects ability to load a
+ * component from URL. All available components are loaded by turns. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * @see XComponent
+ */
+ public void _loadComponentFromURL() {
+ boolean result = true;
+
+ log.println("testing loadComponentFromURL() ... ");
+ try {
+ PropertyValue [] szEmptyArgs = new PropertyValue [0];
+ String frameName = "_blank";
+ XComponent oDoc = null;
+
+ log.println("load writer doc that contains links");
+ PropertyValue [] szArgs = new PropertyValue [1];
+ PropertyValue Arg = new PropertyValue();
+ Arg.Name = "UpdateDocMode";
+ Arg.Value = new Short(com.sun.star.document.UpdateDocMode.NO_UPDATE);
+ szArgs[0]=Arg;
+ String url = util.utils.getFullTestURL("Writer_Link.sxw");
+ oDoc = oObj.loadComponentFromURL(
+ url, frameName, 0, szArgs);
+
+ try {
+ Thread.sleep(500);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ oDoc.dispose();
+
+ url = util.utils.getFullTestURL("Calc_Link.sxc");
+ oDoc = oObj.loadComponentFromURL(
+ url, frameName, 0, szArgs);
+
+ try {
+ Thread.sleep(500);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ oDoc.dispose();
+
+
+
+ log.println("load a blank impress doc");
+ Arg.Name = "OpenFlags";
+ Arg.Value = "S";
+ Arg.Handle = -1;
+ Arg.State = PropertyState.DEFAULT_VALUE;
+ szArgs[0]=Arg;
+ oDoc = oObj.loadComponentFromURL(
+ "private:factory/simpress", frameName, 0, szArgs );
+
+ log.println("disposing impress doc");
+ oDoc.dispose();
+
+ log.println("load a blank writer doc");
+ oDoc = oObj.loadComponentFromURL(
+ "private:factory/swriter", frameName, 0, szEmptyArgs );
+
+ log.println("disposing writer doc");
+ oDoc.dispose();
+
+ log.println("load a blank calc doc");
+ oDoc = oObj.loadComponentFromURL(
+ "private:factory/scalc", frameName, 0, szEmptyArgs );
+
+ log.println("disposing calc doc");
+ oDoc.dispose();
+
+ log.println("load a blank draw doc");
+ oDoc = oObj.loadComponentFromURL(
+ "private:factory/sdraw", frameName, 0, szEmptyArgs );
+
+ log.println("disposing draw doc");
+ oDoc.dispose();
+
+ log.println("load a blank math doc");
+ oDoc = oObj.loadComponentFromURL(
+ "private:factory/smath", frameName, 0, szEmptyArgs );
+
+ log.println("disposing math doc");
+ oDoc.dispose();
+
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while loading");
+ e.printStackTrace(log);
+ result=false;
+ }
+ catch (com.sun.star.io.IOException e) {
+ log.println("Exception occured while loading");
+ e.printStackTrace(log);
+ result=false;
+ }
+
+ tRes.tested("loadComponentFromURL()", result);
+ return;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XController.java b/qadevOOo/tests/java/ifc/frame/_XController.java
new file mode 100644
index 000000000000..b7d739d72ce0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XController.java
@@ -0,0 +1,259 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XController.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import lib.MultiMethodTest;
+import com.sun.star.util.XModifiable;
+
+
+/**
+* Testing <code>com.sun.star.frame.XController</code>
+* interface methods:
+* <ul>
+* <li><code> getFrame() </code></li>
+* <li><code> attachFrame() </code></li>
+* <li><code> getModel() </code></li>
+* <li><code> attachModel() </code></li>
+* <li><code> getViewData() </code></li>
+* <li><code> restoreViewData() </code></li>
+* <li><code> suspend() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Frame'</code> (of type <code>XFrame</code>):
+* any other frame, used for tests</li>
+* <li> <code>'FirstModel'</code> (of type <code>XModel</code>):
+* model of a controller tested</li>
+* <li> <code>'SecondModel'</code> (of type <code>XModel</code>):
+* other model, used for tests </li>
+* <li> <code>'HasViewData'</code> (of type <code>Boolean</code>):
+* (optional relation) if it exsists, so controller has no view data</li>
+* <li> <code>'SecondController'</code> (of type <code>XController</code>):
+* other controller, used for tests </li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XController
+*/
+public class _XController extends MultiMethodTest {
+ public XController oObj = null;
+ public XModel firstModel = null;
+ public XModel secondModel = null;
+ public XFrame frame = null;
+ public Object ViewData = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns object, that's equal to
+ * previously obtained object relation 'Frame'.
+ * The following method tests are to be completed successfully before:
+ * <ul>
+ * <li> <code> attachFrame() </code> : attachs frame obtained object
+ * relation 'Frame' </li>
+ * </ul>
+ */
+ public void _getFrame() {
+ requiredMethod("attachFrame()");
+ XFrame getting = oObj.getFrame();
+ boolean eq = getting.equals(frame);
+ if ( !eq ) {
+ log.println("Getting: " + getting.toString());
+ log.println("Expected: " + frame.toString());
+ }
+ tRes.tested("getFrame()", eq);
+ }
+
+ /**
+ * After obtaining a corresponding object relation test calls the method.
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _attachFrame() {
+ frame = (XFrame) tEnv.getObjRelation("Frame");
+ oObj.attachFrame(frame);
+ tRes.tested("attachFrame()", true);
+ }
+
+ /**
+ * At first object relation 'FirstModel' is gotten. Then test calls the
+ * method. <p>
+ * Has <b> OK </b> status if string repersentation of an object, returned by
+ * the method is equal to string representation of corresponding object
+ * relation.
+ */
+ public void _getModel() {
+ firstModel = (XModel) tEnv.getObjRelation("FirstModel");
+ XModel getting = oObj.getModel();
+ String out1 = "";
+ String out2 = "";
+ if ( (firstModel == null) ) out1="none";
+ else out1 = firstModel.toString();
+ if ( (getting == null) ) out2="none"; else out2 = getting.toString();
+ boolean eq = out1.equals(out2);
+ if ( !eq ) {
+ log.println("Getting: " + out2);
+ log.println("Expected: " + out1);
+ }
+ tRes.tested("getModel()", eq);
+ }
+
+ /**
+ * At first, we obtain an object relation 'SecondModel'. Then test calls
+ * the method and check result. <p>
+ * Has <b> OK </b> status if method returns true and attached model is
+ * equal to a model 'SecondModel' obtained before.
+ * <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getModel() </code> : returns model (XModel) of the
+ * XController object</li>
+ * </ul>
+ */
+ public void _attachModel() {
+ boolean result = false;
+
+ requiredMethod("getModel()");
+ secondModel = (XModel) tEnv.getObjRelation("SecondModel");
+ XModel gotBefore = oObj.getModel();
+ boolean attached = oObj.attachModel(secondModel);
+ XModel gotAfter = oObj.getModel();
+ if ( attached ) {
+ if ( ! gotBefore.equals(gotAfter) ) {
+ if ( gotAfter.equals(secondModel) ) {
+ result = true;
+ } else {
+ log.println("Attached and gotten models are not equal");
+ log.println("Getting: " + gotAfter.toString());
+ log.println("Expected: " + secondModel.toString());
+ }
+ } else {
+ log.println("method did not change model");
+ }
+ } else {
+ result=true;
+ log.println("attachModel() returns false");
+ log.println("as expected, see #82938");
+ }
+ tRes.tested("attachModel()", result);
+ oObj.attachModel(firstModel);
+ }
+
+ /**
+ * At first gotten object relation 'HasViewData' is checked. Then if
+ * 'HasViewData' is null, test calls the method. <p>
+ * Has <b> OK </b> status if obtained object relation is not null, or if
+ * the method does not return null.
+ */
+ public void _getViewData() {
+ if (tEnv.getObjRelation("HasViewData") != null) {
+ log.println("This Object has no View Data");
+ tRes.tested("getViewData()", true);
+ return;
+ }
+ ViewData = oObj.getViewData();
+ tRes.tested( "getViewData()", ViewData != null );
+ }
+
+ /**
+ * If obtained object relation 'HasViewData' is null, test calls the method.
+ * <p>Has <b> OK </b> status if obtained object relation is not null, or
+ * if no exceptions were thrown while method call.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getViewData() </code> : gets view data of an object. </li>
+ * </ul>
+ */
+ public void _restoreViewData() {
+ requiredMethod("getViewData()");
+ if (tEnv.getObjRelation("HasViewData") != null) {
+ log.println("This Object has no View Data");
+ tRes.tested("restoreViewData()", true);
+ return;
+ }
+ oObj.restoreViewData(ViewData);
+ tRes.tested( "restoreViewData()", true );
+ }
+
+ /**
+ * Has <b> OK </b> status if the method returns true.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> restoreViewData() </code> : restores view status of an
+ * object </li>
+ * </ul>
+ */
+ public void _suspend() {
+ requiredMethod("restoreViewData()");
+ XModifiable modify = (XModifiable) tEnv.getObjRelation("Modifiable");
+ if (modify != null) {
+ try {
+ modify.setModified(false);
+ } catch (com.sun.star.beans.PropertyVetoException pve) {
+ log.println("PropertyVetoException, couldn't change Modify flag");
+ }
+ }
+ tRes.tested( "suspend()", oObj.suspend(true) );
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XDesktop.java b/qadevOOo/tests/java/ifc/frame/_XDesktop.java
new file mode 100644
index 000000000000..9960cb2298fa
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XDesktop.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDesktop.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.frame.XDesktop</code>
+* interface methods:
+* <ul>
+* <li><code> getComponents() </code></li>
+* <li><code> terminate() </code></li>
+* <li><code> addTerminateListener() </code></li>
+* <li><code> removeTerminateListener() </code></li>
+* <li><code> getCurrentComponent() </code></li>
+* <li><code> getCurrentFrame() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XDesktop
+*/
+public class _XDesktop extends MultiMethodTest {
+ public XDesktop oObj = null; // oObj filled by MultiMethodTest
+
+ /**
+ * Test calls the method. Then elements enumeration is created and tested.<p>
+ * Has <b> OK </b> status if no exceptions were thrown.
+ */
+ public void _getComponents() {
+ XEnumerationAccess xComps = oObj.getComponents();
+ XEnumeration xEnum = xComps.createEnumeration();
+ boolean result = false;
+
+ try {
+ for (; xEnum.hasMoreElements();) {
+ XInterface xInt = (XInterface) xEnum.nextElement();
+ }
+ result = true;
+ } catch (WrappedTargetException e) {
+ log.println("Couldn't get a component : " + e.getMessage());
+ e.printStackTrace();
+ } catch (NoSuchElementException e) {
+ log.println("Couldn't get a component : " + e.getMessage());
+ e.printStackTrace();
+ }
+ tRes.tested("getComponents()", result);
+ }
+
+ /**
+ * Cannot test the method because it requires
+ * terminating StarOffice. Will add real test later.
+ */
+ public void _terminate() {
+ tRes.tested("terminate()", true);
+ }
+
+ /**
+ * Cannot test the method because of terminate().
+ * Will add real test later.
+ */
+ public void _addTerminateListener() {
+ tRes.tested("addTerminateListener()", true);
+ }
+
+ /**
+ * Cannot test the method because of terminate().
+ * Will add real test later.
+ */
+ public void _removeTerminateListener() {
+ tRes.tested("removeTerminateListener()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getCurrentComponent() {
+ tRes.tested("getCurrentComponent()",
+ oObj.getCurrentComponent() != null);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getCurrentFrame() {
+ tRes.tested("getCurrentFrame()", oObj.getCurrentFrame() != null);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatch.java b/qadevOOo/tests/java/ifc/frame/_XDispatch.java
new file mode 100644
index 000000000000..3cc81fb6f725
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XDispatch.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDispatch.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.util.URL;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.frame.XDispatch</code>
+* interface methods :
+* <ul>
+* <li><code> dispatch()</code></li>
+* <li><code> addStatusListener()</code></li>
+* <li><code> removeStatusListener()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XDispatch.URL'</code> (of type <code>com.sun.star.util.URL
+* </code>): URL for passing to <code>dispatch()</code> method. </li>
+* <ul> <p>
+* @see com.sun.star.frame.XDispatch
+*/
+public class _XDispatch extends MultiMethodTest {
+
+ public XDispatch oObj = null;
+
+ /**
+ * Listener implementation which sets flags on appropriate method calls
+ */
+ protected class TestStatusListener implements
+ com.sun.star.frame.XStatusListener {
+ public boolean disposingCalled = false ;
+ public boolean statusChangedCalled = false ;
+ private java.io.PrintWriter log = null ;
+
+ public TestStatusListener(java.io.PrintWriter log) {
+ this.log = log ;
+ }
+
+ public void disposing(com.sun.star.lang.EventObject e) {
+ disposingCalled = true ;
+ log.println(" disposing was called.") ;
+ }
+
+ public void statusChanged(com.sun.star.frame.FeatureStateEvent e) {
+ statusChangedCalled = true ;
+ log.println(" statusChanged was called.") ;
+ log.println(" FeatureURL = '" + e.FeatureURL + "'");
+ log.println(" FeatureDescriptor = '" + e.FeatureDescriptor + "'");
+ log.println(" IsEnabled = " + e.IsEnabled);
+ log.println(" Requery = " + e.Requery);
+ log.println(" State = '" + e.State.toString() + "'");
+ }
+
+ }
+
+ TestStatusListener listener = null ;
+ URL url = null ;
+
+ /**
+ * Retrieves object relations and creates new listeners.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ listener = new TestStatusListener(log) ;
+ url = (URL) tEnv.getObjRelation("XDispatch.URL") ;
+
+ if (url == null) throw new StatusException
+ (Status.failed("Relation not found.")) ;
+ }
+
+ /**
+ * Calls the method using URL from relation. <p>
+ * Has <b> OK </b> status if one listener (not removed) is called, and
+ * another (removed) is not.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>addStatusListener</code> :
+ * to check that the listener is called
+ * </li>
+ * </ul>
+ */
+ public void _dispatch() {
+ requiredMethod("addStatusListener()") ;
+
+ boolean result = true ;
+
+ oObj.dispatch(url, new PropertyValue[0]) ;
+
+ try {
+ Thread.sleep(200);
+ }
+ catch(java.lang.InterruptedException e) {}
+
+ System.out.println("Listener called: "+ listener.statusChangedCalled);
+
+ result = listener.statusChangedCalled;
+
+ tRes.tested("dispatch()", result) ;
+ }
+
+ /**
+ * Adds two listeners. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _addStatusListener() {
+
+ boolean result = true ;
+ oObj.addStatusListener(listener, url) ;
+
+ tRes.tested("addStatusListener()", result) ;
+ }
+
+ /**
+ * Removes the listener added before. <p>
+ * Has <b> OK </b> status if the dispatch call doesn't call the listener.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> dispatch() </code> : to have a listener to remove
+ * </li>
+ * </ul>
+ */
+ public void _removeStatusListener() {
+ requiredMethod("dispatch()") ;
+ listener.statusChangedCalled = false;
+ boolean result = true ;
+ oObj.removeStatusListener(listener, url) ;
+
+ oObj.dispatch(url, new PropertyValue[0]) ;
+
+ try {
+ Thread.sleep(200);
+ }
+ catch(java.lang.InterruptedException e) {}
+
+ System.out.println("Listener called: "+ listener.statusChangedCalled);
+
+ result = ! listener.statusChangedCalled;
+
+ tRes.tested("removeStatusListener()", result) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchProvider.java b/qadevOOo/tests/java/ifc/frame/_XDispatchProvider.java
new file mode 100644
index 000000000000..4279276fbfac
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XDispatchProvider.java
@@ -0,0 +1,199 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDispatchProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.frame.DispatchDescriptor;
+import com.sun.star.frame.FrameSearchFlag;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import lib.MultiMethodTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.frame.XDispatchProvider</code>
+* interface methods:
+* <ul>
+* <li><code> queryDispatch() </code></li>
+* <li><code> queryDispatches() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XDispatchProvider.URL'</code> (of type <code>String</code>):
+* used to obtain unparsed url of DispatchProvider </li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XDispatchProvider
+*/
+public class _XDispatchProvider extends MultiMethodTest {
+ public static XDispatchProvider oObj = null;
+ private String dispatchUrl = null ;
+
+ /**
+ * Retrieves object relation.
+ */
+ public void before() {
+ dispatchUrl = (String) tEnv.getObjRelation("XDispatchProvider.URL") ;
+ if (dispatchUrl == null) {
+ dispatchUrl = utils.getFullTestDocName("index.html");
+ }
+ log.println("Using URL: '" + dispatchUrl + "'");
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _queryDispatch() {
+ URL url = new URL();
+ String frameName = "_top";
+
+ url.Complete = dispatchUrl;
+ try {
+ XURLTransformer xParser=(XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ tParam.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 = dispatchUrl;
+ xParser.parseStrict(aParseURL);
+ url = aParseURL[0];
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't parse URL");
+ }
+ XDispatch xDispatch = oObj.queryDispatch(url,
+ frameName, FrameSearchFlag.ALL);
+ tRes.tested("queryDispatch()", xDispatch != null);
+ }
+
+ /**
+ * Before test calls the method, DispatchDescriptor sequence is defined.<p>
+ * Has <b> OK </b> status if the method does not return null, returned
+ * sequence length is equal to a number of DispatchDescriptors
+ * and returned sequence consists of non-null elements.
+ */
+ public void _queryDispatches() {
+ String name1 = "_self";
+ String name2 = "_top";
+ URL url1 = new URL();
+ URL url2 = new URL();
+
+ url1.Complete = dispatchUrl;
+ url2.Complete = dispatchUrl;
+ try {
+ log.println("Parsing URL");
+ XURLTransformer xParser = (XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ tParam.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 = dispatchUrl;
+ xParser.parseStrict(aParseURL);
+ url1 = aParseURL[0];
+ url2 = aParseURL[0];
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't parse URL");
+ }
+ DispatchDescriptor descs[] = new DispatchDescriptor[] {
+ new DispatchDescriptor(url1, name1, FrameSearchFlag.ALL),
+ new DispatchDescriptor(url2, name2, FrameSearchFlag.ALL)
+ };
+ XDispatch[] xDispatches = oObj.queryDispatches(descs);
+
+ if (xDispatches == null) {
+ log.println("queryDispatches() returned null");
+ tRes.tested("queryDispatches()", false);
+ return;
+ }
+
+ if (xDispatches.length != descs.length) {
+ log.println("queryDispatches() returned "
+ + xDispatches.length
+ + " amount of XDispatch instead of "
+ + descs.length);
+ tRes.tested("queryDispatches()", false);
+ return;
+ }
+
+ for (int i = 0; i < xDispatches.length; i++) {
+ if (xDispatches[i] == null) {
+ log.println("queryDispatches() result contains"
+ + " null object");
+ tRes.tested("queryDispatches()", false);
+ return;
+ }
+ }
+
+ tRes.tested("queryDispatches()", true);
+ return;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchProviderInterception.java b/qadevOOo/tests/java/ifc/frame/_XDispatchProviderInterception.java
new file mode 100644
index 000000000000..65214883238d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XDispatchProviderInterception.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDispatchProviderInterception.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.frame.DispatchDescriptor;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XDispatchProviderInterception;
+import com.sun.star.frame.XDispatchProviderInterceptor;
+import com.sun.star.util.URL;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.frame.XDispatchProviderInterception</code>
+* interface methods :
+* <ul>
+* <li><code> registerDispatchProviderInterceptor()</code></li>
+* <li><code> releaseDispatchProviderInterceptor()</code></li>
+* </ul> <p>
+* @see com.sun.star.frame.XDispatchProviderInterception
+*/
+public class _XDispatchProviderInterception extends MultiMethodTest {
+
+ public XDispatchProviderInterception oObj = null;
+
+ /**
+ * Implementation of <code>XDispatchProviderInterceptor</code> interface
+ * which writes info about method calls to log, stores master and
+ * slave interceptors, and redirect all dispatch queries to the master
+ * provider.
+ */
+ public class TestInterceptor implements XDispatchProviderInterceptor {
+ private PrintWriter log = null ;
+ public XDispatchProvider master = null, slave = null ;
+
+ public TestInterceptor(PrintWriter log) {
+ this.log = log ;
+ }
+
+ public XDispatchProvider getSlaveDispatchProvider() {
+ log.println("getSlaveDispatchProvider() called.") ;
+ return slave;
+ }
+ public XDispatchProvider getMasterDispatchProvider() {
+ log.println("getMasterDispatchProvider() called.") ;
+ return master;
+ }
+ public void setSlaveDispatchProvider(XDispatchProvider prov) {
+ log.println("setSlaveDispatchProvider(" + prov + ") called.") ;
+ slave = prov ;
+ }
+ public void setMasterDispatchProvider(XDispatchProvider prov) {
+ log.println("setMasterDispatchProvider(" + prov + ") called.") ;
+ master = prov ;
+ }
+
+ public XDispatch queryDispatch(URL url, String frame, int flags) {
+ log.println("queryDispatch('" + url.Complete + "', '" +
+ frame + "', " + flags + ") called.") ;
+ return master.queryDispatch(url, frame, flags) ;
+ }
+ public XDispatch[] queryDispatches(DispatchDescriptor[] desc) {
+ log.println("queryDispatch() called.") ;
+ return master.queryDispatches(desc) ;
+ }
+ }
+
+
+ TestInterceptor interceptor = null ;
+ /**
+ * Cereates new interceptor implementation.
+ */
+ public void before() {
+ interceptor = new TestInterceptor(log) ;
+ }
+
+ /**
+ * Registers new interceptor implementation. <p>
+ * Has <b> OK </b> status if during registering interceptor's
+ * <code>setMasterDispatchProvider</code> method with non null
+ * parameter was called. <p>
+ */
+ public void _registerDispatchProviderInterceptor() {
+
+ boolean result = true ;
+ oObj.registerDispatchProviderInterceptor(interceptor) ;
+
+ result = interceptor.master != null ;
+
+ tRes.tested("registerDispatchProviderInterceptor()", result) ;
+ }
+
+ /**
+ * Releases interceptor. <p>
+ * Has <b> OK </b> status if during method call interceptor's
+ * <code>setMasterDispatchProvider</code> method with <code>null</code>
+ * parameter was called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerDispatchProviderInterceptor </code> </li>
+ * </ul>
+ */
+ public void _releaseDispatchProviderInterceptor() {
+ requiredMethod("registerDispatchProviderInterceptor()") ;
+
+ boolean result = true ;
+ oObj.releaseDispatchProviderInterceptor(interceptor) ;
+
+ result = interceptor.master == null ;
+
+ tRes.tested("releaseDispatchProviderInterceptor()", result) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java
new file mode 100644
index 000000000000..07a9fb8f69bc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java
@@ -0,0 +1,225 @@
+ /*************************************************************************
+ *
+ * $RCSfile: _XDispatchRecorder.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XDispatchRecorder;
+import com.sun.star.frame.XFrame;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.URL;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.frame.XDispatchRecorder</code>
+* interface methods:
+* <ul>
+* <li><code> startRecording() </code></li>
+* <li><code> recordDispatch() </code></li>
+* <li><code> recordDispatchAsComment() </code></li>
+* <li><code> endRecording() </code></li>
+* <li><code> getRecordedMacro() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XDispatchRecorder
+*/
+public class _XDispatchRecorder extends MultiMethodTest {
+ public static XDispatchRecorder oObj = null;
+
+ XFrame xFrame = null;
+ URL dispURL = null;
+ PropertyValue[] dispArgs = new PropertyValue[0];
+
+ protected void before() {
+ xFrame = (XFrame) tEnv.getObjRelation("XDispatchRecorder.Frame");
+
+ if (xFrame == null) {
+ throw new StatusException(Status.failed("Relation not found"));
+ }
+ }
+
+ public void _startRecording() {
+ oObj.startRecording(xFrame);
+
+ tRes.tested("startRecording()", true);
+ }
+
+ public void _endRecording() {
+ requiredMethod("startRecording()");
+
+ dispURL = utils.parseURL(tParam.getMSF(), ".uno:InsertText");
+
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "Text";
+ prop.Value = "XDispatchRecorder.endRecording()";
+ dispArgs = new PropertyValue[] {prop};
+
+ log.println("Dispatching event for frame ...");
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xFrame);
+ XDispatch xDisp = xDispProv.queryDispatch(dispURL, "", 0);
+ xDisp.dispatch(dispURL, dispArgs);
+
+ shortWait();
+
+ log.println("Ending record ...");
+ oObj.endRecording();
+
+ log.println("Getting macro ... :");
+ String macro = oObj.getRecordedMacro();
+ log.println(macro);
+
+ boolean res = macro != null
+ && macro.indexOf(dispURL.Complete) > -1
+ && macro.indexOf((String)dispArgs[0].Value) > -1;
+ if (!res) log.println("Dispatch URL '" + dispURL.Complete
+ + "' or its argument '" + dispArgs[0].Value
+ + "' was not found in macro returned - FAILED");
+
+ tRes.tested("endRecording()", res);
+ }
+
+ public void _recordDispatch() {
+ executeMethod("endRecording()");
+
+ dispURL = utils.parseURL(tParam.getMSF(), ".uno:InsertText");
+
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "Text";
+ prop.Value = "XDispatchRecorder.recordDispatch()";
+ dispArgs = new PropertyValue[] {prop};
+
+ log.println("Recording dispatch ...");
+ oObj.recordDispatch(dispURL, dispArgs);
+
+ log.println("Getting macro ... :");
+ String macro = oObj.getRecordedMacro();
+ log.println(macro);
+
+ boolean res = macro != null
+ && macro.indexOf(dispURL.Complete) > -1
+ && macro.indexOf((String)dispArgs[0].Value) > -1;
+ if (!res) log.println("Dispatch URL '" + dispURL.Complete
+ + "' or its argument '" + dispArgs[0].Value
+ + "' was not found in macro returned - FAILED");
+
+ tRes.tested("recordDispatch()", res);
+ }
+
+ public void _recordDispatchAsComment() {
+ executeMethod("endRecording()");
+
+ dispURL = utils.parseURL(tParam.getMSF(), ".uno:InsertText");
+
+ PropertyValue prop = new PropertyValue();
+ prop.Name = "Text";
+ prop.Value = "XDispatchRecorder.recordDispatchAsComment()";
+ dispArgs = new PropertyValue[] {prop};
+
+ log.println("Recording dispatch ...");
+ oObj.recordDispatchAsComment(dispURL, dispArgs);
+
+ log.println("Getting macro ... :");
+ String macro = oObj.getRecordedMacro();
+ log.println(macro);
+
+ boolean res = macro != null
+ && macro.indexOf(dispURL.Complete) > -1
+ && macro.indexOf((String)dispArgs[0].Value) > -1;
+ if (!res) log.println("Dispatch URL '" + dispURL.Complete
+ + "' or its argument '" + dispArgs[0].Value
+ + "' was not found in macro returned - FAILED");
+
+ log.println("Checking if macro is commented ...");
+ int idx = macro.indexOf((String)dispArgs[0].Value);
+ int lineStartIdx = macro.lastIndexOf("\n", idx);
+ String lineStart = macro.substring(lineStartIdx + 1, idx).toLowerCase();
+ log.println("Line start is '" + lineStart + "'");
+
+ if (lineStart.startsWith("'") || lineStart.startsWith("rem")) {
+ log.println("Line is commented : OK");
+ } else {
+ log.println("Line is not commented : FAILED");
+ res =false;
+ }
+
+ tRes.tested("recordDispatchAsComment()", res);
+ }
+
+ public void _getRecordedMacro() {
+ executeMethod("endRecording()");
+ executeMethod("recordDispatch()");
+ executeMethod("recordDispatchAsComment()");
+
+ tRes.tested("getRecordedMacro()", oObj.getRecordedMacro() != null);
+ }
+
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java
new file mode 100644
index 000000000000..100bdd1d6dd5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java
@@ -0,0 +1,284 @@
+ /*************************************************************************
+ *
+ * $RCSfile: _XDispatchRecorderSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import lib.MultiMethodTest;
+import lib.StatusException;
+import util.SOfficeFactory;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.frame.XDispatchRecorderSupplier</code>
+* interface methods:
+* <ul>
+* <li><code> setDispatchRecorder() </code></li>
+* <li><code> getDispatchRecorder() </code></li>
+* <li><code> dispatchAndRecord() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XDispatchRecorderSupplier
+*/
+public class _XDispatchRecorderSupplier extends MultiMethodTest {
+ public static XDispatchRecorderSupplier oObj = null;
+
+ XComponent xTextDoc = null;
+ XDispatchRecorder recorder = null;
+ XDesktop desktop = null;
+
+ /**
+ * Simple <code>XDispatchRecorder</code> implementation
+ * which method <code>getRecordedMacro</code> returns a fixed
+ * string.
+ */
+ private static class MyRecorder implements XDispatchRecorder {
+ public void startRecording(XFrame p0) {}
+ public void recordDispatch(URL p0, PropertyValue[] p1) {}
+ public void recordDispatchAsComment(URL p0, PropertyValue[] p1) {}
+ public void endRecording(){}
+ public String getRecordedMacro() {
+ return "MyRecorder implementation";
+ }
+ }
+
+ /**
+ * Creates a new document which supplies a frame.
+ * Also a <code>com.sun.star.frame.Desktop</code>
+ * service created for obtaining document's frame.
+ */
+ protected void before() {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(tParam.getMSF());
+
+ try {
+ log.println( "creating a text document" );
+ xTextDoc = SOF.createTextDoc(null);
+
+ Object inst = (XInterface)tParam.getMSF().createInstance
+ ("com.sun.star.frame.Desktop");
+ desktop = (XDesktop) UnoRuntime.queryInterface
+ (XDesktop.class, inst);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * Creates an instance of <code>MyRecorder</code> and set if,
+ * then get the current recorder. Second case is setting
+ * recorder to null. Finally restores the old macro recorder. <p>
+ *
+ * Has <b>OK</b> status if in the first case custom recorder
+ * was successfully returned, and in second case current
+ * recorder is null.
+ */
+ public void _setDispatchRecorder() {
+ requiredMethod("getDispatchRecorder()");
+
+ boolean res = true,
+ locRes = true;
+ log.print("Setting custom macro recorder ...");
+ oObj.setDispatchRecorder(new MyRecorder());
+ XDispatchRecorder rec = oObj.getDispatchRecorder();
+
+ locRes = rec != null &&
+ "MyRecorder implementation".equals(rec.getRecordedMacro());
+ if (locRes) log.println("OK");
+ else log.println("FAILED");
+ res &= locRes;
+
+ log.print("Setting null dispatch recorder ...");
+ oObj.setDispatchRecorder(null);
+ locRes = oObj.getDispatchRecorder() == null;
+ if (locRes) log.println("OK");
+ else log.println("FAILED");
+ res &= locRes;
+
+ log.println("Setting old macro recorder ...");
+ oObj.setDispatchRecorder(recorder);
+
+ tRes.tested("setDispatchRecorder()", res);
+ }
+
+ /**
+ * Just gets the current recorder and stores it.
+ *
+ * Has <b>OK</b> status.
+ */
+ public void _getDispatchRecorder() {
+ recorder = oObj.getDispatchRecorder();
+ tRes.tested("getDispatchRecorder()", true);
+ }
+
+ /**
+ * First sets the current dispatch recorder to new
+ * <code>DispatchRecorder</code> instance if the current one
+ * is null. The a <code>Dispatch</code> instance is created
+ * which inserts some text into text document.
+ * A number of cases is checked :
+ * <ul>
+ * <li> A valid call : here the recorded macro must contain
+ * inserted string and URL </li>
+ * <li> Call with invalid URL : the macro recorded must not
+ * contain this URL </li>
+ * <li> Call with null dispatcher : checking for GPF </li>
+ * <li> Call with the current recorder set to null :
+ * checking for GPF </li>
+ * </ul>
+ *
+ * Has <b>OK</b> status if all cases are OK.
+ */
+ public void _dispatchAndRecord() {
+ requiredMethod("getDispatchRecorder()");
+
+ boolean res = true;
+ if (recorder == null) {
+ try {
+ Object inst = tParam.getMSF().createInstance
+ ("com.sun.star.comp.framework.DispatchRecorder");
+ recorder = (XDispatchRecorder) UnoRuntime.queryInterface
+ (XDispatchRecorder.class, inst);
+ oObj.setDispatchRecorder(recorder);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Couldn't create recorder", e);
+ }
+ }
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+
+ XFrame fr = desktop.getCurrentFrame();
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, fr);
+
+ URL dispURL = utils.parseURL(tParam.getMSF(), ".uno:InsertText");
+ XDispatch xDisp = xDispProv.queryDispatch(dispURL,"",0);
+
+ PropertyValue[] args = new PropertyValue[1];
+ args[0] = new PropertyValue();
+ args[0].Name = "Text";
+ args[0].Value = "XDispatchRecorderSupplier";
+
+ log.print("Dispatching and recording ...");
+ oObj.dispatchAndRecord(dispURL, args, xDisp);
+
+ String macro = recorder.getRecordedMacro();
+ boolean locRes = macro != null &&
+ macro.indexOf("XDispatchRecorderSupplier")>-1 &&
+ macro.indexOf(".uno:InsertText")>-1;
+ if (locRes) log.println("OK");
+ else log.println("FAILED");
+ res &= locRes;
+ log.println("Recorder macro :\n" + macro);
+
+ log.print("Trying to dispatch with invalid URL ...");
+ URL badURL = utils.parseURL(tParam.getMSF(), ".uno:AbraCadabra");
+ oObj.dispatchAndRecord(badURL, args, xDisp);
+ macro = recorder.getRecordedMacro();
+ locRes &= macro != null && macro.indexOf(".uno:AbraCadabra")==-1;
+ if (locRes) log.println("OK");
+ else log.println("FAILED");
+ res &= locRes;
+ log.println("Recorder macro :\n" + macro);
+
+ log.print("Trying to set dispatch with null Dispatcher ...");
+ try {
+ oObj.dispatchAndRecord(dispURL, args, null);
+ log.println("OK");
+ } catch (java.lang.Exception e){
+ log.println("Exception is OK: " + e);
+ }
+
+ log.print("Trying to set dispatch recorder to null and record ...");
+ oObj.setDispatchRecorder(null);
+ try {
+ oObj.dispatchAndRecord(dispURL, args, xDisp);
+ log.println("OK");
+ } catch (java.lang.Exception e){
+ log.println("Exception is OK: " + e);
+ }
+
+ oObj.setDispatchRecorder(recorder);
+
+ tRes.tested("dispatchAndRecord()", res);
+ }
+
+ /**
+ * Disposes the document created in <code>before()</code>
+ */
+ protected void after() {
+ xTextDoc.dispose();
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java b/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java
new file mode 100644
index 000000000000..6b83032cdaed
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java
@@ -0,0 +1,306 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDocumentTemplates.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.beans.Property;
+import com.sun.star.frame.XDocumentTemplates;
+import com.sun.star.frame.XStorable;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.sdbc.XRow;
+import com.sun.star.ucb.Command;
+import com.sun.star.ucb.OpenCommandArgument2;
+import com.sun.star.ucb.XCommandProcessor;
+import com.sun.star.ucb.XContent;
+import com.sun.star.ucb.XContentAccess;
+import com.sun.star.ucb.XDynamicResultSet;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import util.utils;
+/**
+* Testing <code>com.sun.star.frame.XDesktop</code>
+* interface methods:
+* <ul>
+* <li><code> getContent() </code></li>
+* <li><code> storeTemplate() </code></li>
+* <li><code> addTemplate() </code></li>
+* <li><code> removeTemplate() </code></li>
+* <li><code> renameTemplate() </code></li>
+* <li><code> addGroup() </code></li>
+* <li><code> removeGroup() </code></li>
+* <li><code> renameGroup() </code></li>
+* <li><code> update() </code></li>
+* </ul><p>
+*/
+public class _XDocumentTemplates extends MultiMethodTest {
+ public XDocumentTemplates oObj = null; // oObj filled by MultiMethodTest
+ protected XContent content = null;
+ /**
+ * Test calls the method and prints contents list to log.<p>
+ * Has <b> OK </b> status if the XContent isn't empty.
+ */
+ public void _getContent() {
+ content = oObj.getContent();
+ log.println("Content list:" + getContentList(content));
+ tRes.tested("getContent()", content != null);
+ }
+
+ /**
+ * Test calls the method and checks that new group was added. <p>
+ * Has <b> OK </b> status if method returns true and new group was added.
+ */
+ public void _addGroup() {
+ requiredMethod("getContent()");
+ if (getSubContent(content, "XDocumentTemplatesTemp") != null ) {
+ oObj.removeGroup("XDocumentTemplatesTemp");
+ }
+ if (getSubContent(content, "XDocumentTemplates") != null ) {
+ oObj.removeGroup("XDocumentTemplates");
+ }
+ boolean res = oObj.addGroup("XDocumentTemplatesTemp");
+ log.println("Method returned: " + res);
+ res &= getSubContent(content, "XDocumentTemplatesTemp") != null;
+ tRes.tested("addGroup()", res);
+ }
+
+ XContent groupContent = null;
+ /**
+ * Test calls the method and checks that content has no group with old name
+ * and that content has group with new name. <p>
+ * Has <b> OK </b> status if method returns true, content has no group with
+ * old name and content has group with new name.<p>
+ */
+ public void _renameGroup() {
+ requiredMethod("addGroup()");
+ boolean res = oObj.renameGroup("XDocumentTemplatesTemp",
+ "XDocumentTemplates");
+ log.println("Method returned: " + res);
+ groupContent = getSubContent(content, "XDocumentTemplates");
+ res &= getSubContent(content, "XDocumentTemplatesTemp") == null;
+ res &= groupContent != null;
+ tRes.tested("renameGroup()", res);
+ }
+
+ /**
+ * Test calls the method and checks that group content has new template. <p>
+ * Has <b> OK </b> status if method returns true and group content has new
+ * template.<p>
+ */
+ public void _addTemplate() {
+ requiredMethod("renameGroup()");
+ String testDoc = utils.getFullTestURL("report.stw");
+ log.println("Adding template from " + testDoc);
+ boolean res = oObj.addTemplate("XDocumentTemplates",
+ "ANewTemplateTemp",testDoc);
+ log.println("Method returned: " + res);
+ res &= getSubContent(groupContent, "ANewTemplateTemp") != null;
+ tRes.tested("addTemplate()", res);
+ }
+
+ /**
+ * Test calls the method and checks that group content has no template with
+ * old name and that group content has template with new name. <p>
+ * Has <b> OK </b> status if method returns true, group content has no
+ * template with old name and group content has template with new name.<p>
+ */
+ public void _renameTemplate() {
+ requiredMethod("addTemplate()");
+ boolean res = oObj.renameTemplate("XDocumentTemplates",
+ "ANewTemplateTemp",
+ "ANewTemplate");
+ log.println("Method returned: " + res);
+ res &= getSubContent(groupContent, "ANewTemplateTemp") == null;
+ res &= getSubContent(groupContent, "ANewTemplate") != null;
+
+ tRes.tested("renameTemplate()", res);
+ }
+
+ /**
+ * Test calls the method and checks that group content has new template. <p>
+ * Has <b> OK </b> status if method returns true and new template was created.<p>
+ */
+ public void _storeTemplate() {
+ requiredMethod("renameGroup()");
+ XStorable store = (XStorable) tEnv.getObjRelation("Store");
+ boolean res = oObj.storeTemplate("XDocumentTemplates",
+ "NewStoreTemplate",
+ store);
+ log.println("Method returned: " + res);
+ res &= getSubContent(groupContent, "NewStoreTemplate") != null;
+ tRes.tested("storeTemplate()", res);
+ }
+
+ /**
+ * Test calls the method and checks that group content has no deleted template. <p>
+ * Has <b> OK </b> status if method returns true and group content has no
+ * deleted template.<p>
+ */
+ public void _removeTemplate() {
+ requiredMethod("renameTemplate()");
+ boolean res = oObj.removeTemplate("XDocumentTemplates", "ANewTemplate");
+ log.println("Method returned: " + res);
+ res &= getSubContent(groupContent, "ANewTemplate") == null;
+ tRes.tested("removeTemplate()", res);
+ }
+
+ /**
+ * Test calls the method and checks that content has no deleted group. <p>
+ * Has <b> OK </b> status if method returns true and content has no deleted
+ * group.<p>
+ */
+ public void _removeGroup() {
+ requiredMethod("renameGroup()");
+ executeMethod("renameTemplate()");
+ boolean res = oObj.removeGroup("XDocumentTemplates");
+ log.println("Method returned: " + res);
+ res &= getSubContent(content, "XDocumentTemplates") == null;
+ tRes.tested("removeGroup()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if no exception occurs.<p>
+ */
+ public void _update() {
+ oObj.update();
+ tRes.tested("update()",true);
+ }
+
+ /**
+ * Returns the string representation of content passed as parameter.
+ */
+ protected String getContentList(XContent content) {
+ XResultSet statRes = getStatResultSet(content);
+ String ret = "";
+ try {
+ statRes.first();
+ XRow row = (XRow)UnoRuntime.queryInterface(XRow.class, statRes);
+ while(! statRes.isAfterLast()) {
+ ret += "\n " + row.getString(1);
+ statRes.next();
+ }
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("Exception occured:" + e);
+ }
+
+ return ret;
+ }
+
+ protected XResultSet getStatResultSet(XContent content) {
+ XResultSet statResSet = null;
+ try {
+ statResSet = getDynaResultSet(content).getStaticResultSet();
+ } catch(com.sun.star.ucb.ListenerAlreadySetException e) {
+ log.println("Exception occured:" + e);
+ }
+ return statResSet;
+ }
+
+ protected XDynamicResultSet getDynaResultSet(XContent content) {
+ Command command = new Command();
+ OpenCommandArgument2 comArg = new OpenCommandArgument2();
+ Property[] comProps = new Property[1];
+ comArg.Mode = com.sun.star.ucb.OpenMode.ALL;
+ comProps[0] = new Property();
+ comProps[0].Name = "Title";
+ comArg.Properties = comProps;
+
+ command.Name = "open";
+ command.Handle = -1;
+ command.Argument = comArg;
+
+ XCommandProcessor comProc = (XCommandProcessor)
+ UnoRuntime.queryInterface(XCommandProcessor.class, content);
+
+ XDynamicResultSet DynResSet = null;
+ try {
+ DynResSet = (XDynamicResultSet)comProc.execute(command, 0, null);
+ } catch(com.sun.star.ucb.CommandAbortedException e) {
+ log.println("Couldn't execute command:" + e);
+ } catch(com.sun.star.uno.Exception e) {
+ log.println("Couldn't execute command:" + e);
+ }
+
+ return DynResSet;
+ }
+
+ protected XContent getSubContent(XContent content, String subName) {
+ XResultSet statRes = getStatResultSet(content);
+ XRow row = (XRow)UnoRuntime.queryInterface(XRow.class, statRes);
+ XContentAccess contAcc = (XContentAccess)
+ UnoRuntime.queryInterface(XContentAccess.class, statRes);
+ XContent subContent = null;
+ try {
+ statRes.first();
+ while(!statRes.isAfterLast()) {
+ if ( subName.equals(row.getString(1)) ) {
+ subContent = contAcc.queryContent();
+ }
+ statRes.next();
+ }
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Exception occured:" + e);
+ }
+
+ return subContent;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XFrame.java b/qadevOOo/tests/java/ifc/frame/_XFrame.java
new file mode 100644
index 000000000000..aebb26c43ea5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XFrame.java
@@ -0,0 +1,561 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFrame.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.FrameAction;
+import com.sun.star.frame.FrameActionEvent;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XFrameActionListener;
+import com.sun.star.frame.XFramesSupplier;
+import com.sun.star.lang.EventObject;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+import lib.TestEnvironment;
+
+/**
+* Testing <code>com.sun.star.frame.XFrame</code>
+* interface methods:
+* <ul>
+* <li><code> getName() </code></li>
+* <li><code> setName() </code></li>
+* <li><code> activate() </code></li>
+* <li><code> deactivate() </code></li>
+* <li><code> isActive() </code></li>
+* <li><code> addFrameActionListener() </code></li>
+* <li><code> removeFrameActionListener() </code></li>
+* <li><code> getCreator() </code></li>
+* <li><code> getComponentWindow() </code></li>
+* <li><code> getContainerWindow() </code></li>
+* <li><code> getController() </code></li>
+* <li><code> isTop() </code></li>
+* <li><code> findFrame() </code></li>
+* <li><code> contextChanged() </code></li>
+* <li><code> setCreator() </code></li>
+* <li><code> setComponent() </code></li>
+* <li><code> initialize() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XFrame'</code> (of type <code>XFrame</code>)
+* <b>optional</b>: any frame named 'XFrame'.
+* Could be used by <code>findFrame</code> method to try
+* to find other frame than itself.</li>
+*
+* <li> <code>'Desktop'</code> (of type <code>Object</code>):
+* if exsists, then desktop component is tested</li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XFrame
+*/
+public class _XFrame extends MultiMethodTest {
+ final FrameAction[] actionEvent = new FrameAction[1] ;
+ final boolean[] listenerCalled = new boolean[] {false} ;
+ final boolean[] activatedCalled = new boolean[] {false} ;
+ final boolean[] deactivatedCalled = new boolean[] {false} ;
+ final TestFrameActionListener listener =
+ new TestFrameActionListener() ;
+ public static XFrame oObj = null;
+
+ /**
+ * Class used to test listeners.
+ */
+ private class TestFrameActionListener
+ implements XFrameActionListener {
+
+ public void frameAction(FrameActionEvent e) {
+ listenerCalled[0] = true ;
+ activatedCalled[0] |= e.Action == FrameAction.FRAME_ACTIVATED;
+ deactivatedCalled[0] |= e.Action == FrameAction.FRAME_DEACTIVATING;
+ actionEvent[0] = e.Action;
+ }
+
+ public void disposing(EventObject e) {}
+
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getName() {
+ String name = oObj.getName() ;
+ if (name == null)
+ log.println("getName() returned null: FAILED") ;
+
+ tRes.tested("getName()", name!=null) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if set and gotten names are equal.
+ */
+ public void _setName() {
+ String sName = "XFrame" ;
+
+ oObj.setName(sName);
+ String gName = oObj.getName();
+ boolean res = sName.equals(gName);
+ if (! res)
+ log.println("setName('" + sName +
+ "'), but getName() return '" + gName + "'") ;
+ tRes.tested("setName()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _activate() {
+ oObj.activate() ;
+ tRes.tested("activate()", true) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _deactivate() {
+ oObj.deactivate() ;
+ tRes.tested("deactivate()", true) ;
+ }
+
+ /**
+ * Test calls the method. Then frame is deactivated and method called
+ * again. <p>
+ * Has <b> OK </b> status if isDesktop() returns true or if the method
+ * always display real status of a frame during activation/deactivation.
+ */
+ public void _isActive() {
+ boolean result = true;
+
+ if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
+ log.println("Desktop is always active");
+ tRes.tested("isActive()", oObj.isActive()) ;
+ return;
+ }
+
+ oObj.activate();
+ result &= oObj.isActive();
+ if (!oObj.isActive())
+ log.println("after activate() method call, isActive() returned false") ;
+ oObj.deactivate();
+ result &= !oObj.isActive();
+ if (oObj.isActive())
+ log.println("after deactivate() method call, isActive() returned true");
+ boolean res = isDesktop(log,tEnv,"isActive()");
+ if (res) result=res;
+
+ tRes.tested("isActive()", result) ;
+ }
+
+ /**
+ * Test calls the method. Then frame status (activated/deactivated) is
+ * changed, and the listener is checked.<p>
+ * Has <b> OK </b> status if isDesktop() method returnes true, or if the
+ * listener was called and frame was activated.
+ */
+ public void _addFrameActionListener() {
+ boolean result = true ;
+
+ oObj.addFrameActionListener(listener) ;
+ oObj.activate() ;
+ oObj.deactivate() ;
+ oObj.activate() ;
+
+ if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
+ log.println("No actions supported by Desktop");
+ tRes.tested("addFrameActionListener()", true) ;
+ return;
+ }
+
+ try {
+ Thread.sleep(500);
+ }catch (InterruptedException ex) {}
+
+
+ if (!listenerCalled[0]) {
+ log.println("listener was not called.") ;
+ result = false ;
+ } else {
+ if (!activatedCalled[0]) {
+ log.println("Listener was called, FRAME_ACTIVATED was not") ;
+ result = false ;
+ }
+ if (!deactivatedCalled[0]) {
+ log.println("Listener was called, FRAME_DEACTIVATING was not") ;
+ result = false ;
+ }
+ }
+
+ boolean res = isDesktop(log, tEnv, "addFrameActionListener()");
+ if (res) result=res;
+
+ tRes.tested("addFrameActionListener()", result) ;
+ }
+
+ /**
+ * Test calls the method. Then frame status (activated/deactivated) is
+ * changed, and the listener is checked.<p>
+ * Has <b> OK </b> status if isDesktop() method returns true, or if the
+ * method actually removes listener so it does not react on
+ * activate/deactivate events. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addFrameActionListener() </code>: adds action listener
+ * to a frame </li>
+ * </ul>
+ */
+ public void _removeFrameActionListener() {
+ boolean result = true;
+
+ requiredMethod("addFrameActionListener()");
+ listenerCalled[0] = false;
+ oObj.removeFrameActionListener(listener);
+ oObj.activate();
+ oObj.deactivate();
+ if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
+ log.println("No actions supported by Desktop");
+ tRes.tested("removeFrameActionListener()", true) ;
+ return;
+ }
+
+ if (listenerCalled[0])
+ log.println("Listener wasn't removed, and was called");
+ boolean res = isDesktop(log, tEnv, "removeFrameActionListener()");
+ if (res) result=res; else result = (!listenerCalled[0]);
+
+ tRes.tested("removeFrameActionListener()", result);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if isDesktop() method returns true or if the method
+ * does not return null.
+ */
+ public void _getCreator() {
+ boolean result = true;
+
+ if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
+ log.println("Desktop has no creator");
+ tRes.tested("getCreator()", true) ;
+ return;
+ }
+
+ XFramesSupplier creator = oObj.getCreator() ;
+ if (creator == null)
+ log.println("getCreator() returns null") ;
+ boolean res = isDesktop(log,tEnv,"getCreator()");
+ if (res) result=res; else result = (creator != null);
+ tRes.tested("getCreator()", result) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if isDesktop() method returns true or if the method
+ * does not return null.
+ */
+ public void _getComponentWindow() {
+ boolean result = true;
+
+ XWindow win = oObj.getComponentWindow() ;
+
+ if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
+ log.println("Desktop has no component window");
+ tRes.tested("getComponentWindow()", true) ;
+ return;
+ }
+
+ if (win == null)
+ log.println("getComponentWindow() returns null") ;
+ boolean res = isDesktop(log,tEnv,"getComponentWindow()");
+ if (res) result=res; else result = (win != null);
+ tRes.tested("getComponentWindow()", result) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if isDesktop() method returns true or if the method
+ * does not return null.
+ */
+ public void _getContainerWindow() {
+ boolean result = true;
+
+ if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
+ log.println("Desktop has no container window");
+ tRes.tested("getContainerWindow()", true) ;
+ return;
+ }
+
+ XWindow win = oObj.getContainerWindow() ;
+ if (win == null)
+ log.println("getContainerWindow() returns null") ;
+ boolean res = isDesktop(log,tEnv,"getContainerWindow()");
+ if (res) result=res; else result = (win != null);
+ tRes.tested("getContainerWindow()", result) ;
+ }
+
+ /**
+ * Test calls the method. Then returned controller is checked. <p>
+ * Has <b> OK </b> status if isDesktop() method returns true or
+ * if the method returns non-null controller, having frame that's equal to
+ * a (XFrame) oObj.
+ */
+ public void _getController() {
+ boolean result = true;
+ XController ctrl = oObj.getController();
+
+ if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
+ log.println("Desktop has no controller");
+ tRes.tested("getController()", true) ;
+ return;
+ }
+
+ if (ctrl == null) {
+ log.println("getController() returns null");
+ result = false;
+ } else {
+ XFrame frm = ctrl.getFrame();
+ if (!oObj.equals(frm)) {
+ log.println("Frame returned by controller not " +
+ "equals to frame testing");
+ result = false;
+ }
+ }
+ boolean res = isDesktop(log, tEnv, "getController()");
+ if (res) result=res;
+ tRes.tested("getController()", result) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _isTop() {
+ log.println("isTop() = " + oObj.isTop());
+ tRes.tested("isTop()", true) ;
+ }
+
+ /**
+ * After obtaining an object relation 'XFrame', test tries to find a frame
+ * named 'XFrame'. <p>
+ * Has <b> OK </b> status if the method returns non-null object that's equal
+ * to previously obtained object relation.
+ */
+ public void _findFrame() {
+ boolean result = true ;
+
+ XFrame aFrame = (XFrame) tEnv.getObjRelation("XFrame");
+
+ if (aFrame != null) {
+ log.println("Trying to find a frame with name 'XFrame' ...");
+ XFrame frame = oObj.findFrame("XFrame",
+ com.sun.star.frame.FrameSearchFlag.GLOBAL) ;
+ if (frame == null) {
+ log.println("findFrame(\"XFrame,com.sun.star.frame.FrameSearchFlag.GLOBAL\") returns null") ;
+ result = false ;
+ } else if ( !aFrame.equals(frame) ) {
+ log.println("findFrame(\"XFrame,com.sun.star.frame.FrameSearchFlag.GLOBAL\") "
+ + " returns frame which is not equal to passed in relation") ;
+ result = false ;
+ }
+ }
+
+ log.println("Trying to find a frame with name '_self' ...");
+ XFrame frame = oObj.findFrame("_self",
+ com.sun.star.frame.FrameSearchFlag.AUTO) ;
+ if (frame == null) {
+ log.println("findFrame(\"_self\") returns null") ;
+ result = false ;
+ } else if ( !oObj.equals(frame) ) {
+ log.println("findFrame(\"_self\") "
+ + " returns frame which is not equal to tested") ;
+ result = false ;
+ }
+
+ tRes.tested("findFrame()", result) ;
+ }
+
+ /**
+ * At first new listener is added, then test calls the method and result
+ * is checked. <p>
+ * Has <b> OK </b> status if isDesktop() method returnes true or if the
+ * listener was called and proper event past to listener.
+ */
+ public void _contextChanged() {
+ boolean result = true;
+ TestFrameActionListener listener = new TestFrameActionListener();
+
+ if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
+ log.println("Desktop cann't change context");
+ tRes.tested("contextChanged()", true) ;
+ return;
+ }
+
+ listenerCalled[0] = false;
+ oObj.addFrameActionListener(listener);
+ try {
+ oObj.contextChanged();
+ if ( !listenerCalled[0] ) {
+ log.println("listener was not called on contextChanged() call.") ;
+ result = false;
+ } else if (actionEvent[0] != FrameAction.CONTEXT_CHANGED) {
+ log.println("listener was called, but Action != CONTEXT_CHANGED") ;
+ result = false;
+ }
+ } finally {
+ oObj.removeFrameActionListener(listener);
+ }
+
+ boolean res = isDesktop(log, tEnv, "contextChanged()");
+ if (res) result = res;
+ tRes.tested("contextChanged()", result);
+ }
+
+
+ /**
+ * Test calls the method. Remembered old creater is restored at the end. <p>
+ * Has <b> OK </b> status if the method sucessfully set new value to (XFrame)
+ * oObj object.
+ */
+ public void _setCreator() {
+ if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
+ log.println("Desktop has no creator");
+ tRes.tested("setCreator()", true) ;
+ return;
+ }
+
+ XFramesSupplier oldCreator = oObj.getCreator() ;
+ oObj.setCreator(null) ;
+ tRes.tested("setCreator()", oObj.getCreator() == null) ;
+ oObj.setCreator(oldCreator) ;
+ }
+
+ /**
+ * Test calls the method, then result is checked. Values, stored at the
+ * beginning are restored at the end of method.<p>
+ * Has <b> OK </b> status if method returns true, and values, set by the
+ * method are nulls, or if method returns false, and values are not changed.
+ */
+ public void _setComponent() {
+ boolean result = true;
+
+ XWindow oldWindow = oObj.getComponentWindow();
+ XController oldController = oObj.getController();
+ boolean rs = oObj.setComponent(null, null);
+ if (rs) { // component must be changed
+ result &= oObj.getComponentWindow() == null;
+ result &= oObj.getController() == null;
+ if (!result)
+ log.println("setComponent() returns true, but component is " +
+ "not changed.");
+ } else { // frame is not allowed to change component
+ result &= oObj.getComponentWindow() == oldWindow ;
+ result &= oObj.getController() == oldController ;
+ if (!result)
+ log.println("setComponent() returns false, but component is" +
+ "changed.");
+ }
+ tRes.tested("setComponent()", result);
+
+ oObj.setComponent(oldWindow, oldController);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setComponent() </code> : sets window and controller to the
+ * object</li>
+ * </ul>
+ */
+ public void _initialize() {
+ requiredMethod("setComponent()") ;
+ XWindow win = oObj.getContainerWindow() ;
+ oObj.initialize(win) ;
+ tRes.tested("initialize()", true) ;
+ }
+
+ /**
+ * Checks does relation 'Desktop' exist. Returns true if exist.
+ */
+ public static boolean isDesktop(PrintWriter log,
+ TestEnvironment env, String method) {
+ Object isD = env.getObjRelation("Desktop");
+ if (isD != null) {
+ log.println("The Desktop doesn't support the method " + method);
+ log.println("It will always return true");
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java
new file mode 100644
index 000000000000..e0f03bd19053
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java
@@ -0,0 +1,242 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFrameLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XFrameLoader;
+import com.sun.star.frame.XLoadEventListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.SOfficeFactory;
+
+
+/**
+* Testing <code>com.sun.star.frame.XFrameLoader</code>
+* interface methods :
+* <ul>
+* <li><code> load()</code></li>
+* <li><code> cancel()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'FrameLoader.URL'</code> (of type <code>String</code>):
+* an url or component to be loaded </li>
+* <li> <code>'FrameLoader.Frame'</code> <b>(optional)</b>
+* (of type <code>com.sun.star.frame.XFrame</code>):
+* a target frame where component to be loaded. If this
+* relation is ommited then a text document created and its
+* frame is used. </li>
+* <li> <code>'FrameLoader.args'</code> <b>(optional)</b>
+* (of type <code>Object[]</code>):
+* necessary arguuments for loading a component. If ommited
+* then zero length array is passed as parameter</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XFrameLoader
+*/
+public class _XFrameLoader extends MultiMethodTest {
+
+ public XFrameLoader oObj = null; // oObj filled by MultiMethodTest
+ private String url = null ;
+ private XFrame frame = null ;
+ private PropertyValue[] args = new PropertyValue[0] ;
+
+ /**
+ * Implemetation of load listener which geristers all it's calls.
+ */
+ protected class TestListener implements XLoadEventListener {
+ public boolean finished = false ;
+ public boolean cancelled = false ;
+
+ public void loadFinished(XFrameLoader l) {
+ finished = true ;
+ }
+ public void loadCancelled(XFrameLoader l) {
+ cancelled = true ;
+ }
+ public void disposing(EventObject e) {}
+ }
+
+ TestListener listener = new TestListener() ;
+ XComponent frameSup = null ;
+
+ /**
+ * Retrieves all relations. If optional ones are not found
+ * creates their default values. <p>
+ * @throws StatusException If one of required relations not found.
+ */
+ public void before() {
+ url = (String) tEnv.getObjRelation("FrameLoader.URL") ;
+ frame = (XFrame) tEnv.getObjRelation("FrameLoader.Frame") ;
+
+ if (frame == null) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ frameSup = SOF.createTextDoc( null );
+
+ Object oDsk = tParam.getMSF().createInstance
+ ("com.sun.star.frame.Desktop") ;
+ XDesktop dsk = (XDesktop)
+ UnoRuntime.queryInterface(XDesktop.class, oDsk) ;
+
+ shortWait() ;
+ frame = dsk.getCurrentFrame() ;
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create a frame.", e );
+ }
+ }
+
+ Object args = tEnv.getObjRelation("FrameLoader.args") ;
+ if (args != null) this.args = (PropertyValue[]) args ;
+
+ if (url == null /*|| frame == null*/) {
+ throw new StatusException
+ (Status.failed("Some relations not found")) ;
+ }
+ }
+
+ private boolean loaded = false ;
+
+ /**
+ * Firts <code>cancel</code> method test is called.
+ * If in that test loaing process was interrupted by
+ * <code>cancel</code> call then <code>load</code> test
+ * executes. It loads a component, waits some moment to
+ * listener have a chance to be called and then checks
+ * if the load listener was called. <p>
+ * Has <b>OK</b> status if <code>cancel</code> method test
+ * didn't interrupt loading and it was successfull, or
+ * if in this method it loads successfull and listener's
+ * <code>finished</code> method was called.
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> cancel() </code> </li>
+ * </ul>
+ */
+ public void _load() {
+ executeMethod("cancel()") ;
+
+ if (!loaded) {
+ oObj.load(frame, url, args, listener) ;
+
+ shortWait();
+
+ loaded = listener.finished ;
+ }
+
+ tRes.tested("load()", loaded) ;
+ }
+
+ /**
+ * Starts to load a component and then immediatly tries to
+ * cancel the process. <p>
+ * Has <b>OK</b> status if the process was cancelled or
+ * finished (appropriate listener methods were called).
+ */
+ public void _cancel() {
+ boolean result = true ;
+
+ oObj.load(frame, url, args, listener) ;
+ oObj.cancel() ;
+
+ shortWait();
+
+ if (listener.cancelled) {
+ log.println("Loading was canceled.") ;
+ }
+ if (listener.finished) {
+ log.println("Loading was finished.") ;
+ loaded = true ;
+ }
+ if (!listener.cancelled && !listener.finished) {
+ log.println("Loading was not canceled and not finished") ;
+ result = false ;
+ }
+
+ tRes.tested("cancel()", result) ;
+ }
+
+ public void after() {
+ if (frameSup != null) frameSup.dispose() ;
+ frame.dispose();
+ }
+
+ private void shortWait() {
+ try {
+ Thread.sleep(5000);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XFramesSupplier.java b/qadevOOo/tests/java/ifc/frame/_XFramesSupplier.java
new file mode 100644
index 000000000000..c30fbc727c49
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XFramesSupplier.java
@@ -0,0 +1,226 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFramesSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XFramesSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.frame.XFramesSupplier</code>
+* interface methods:
+* <ul>
+* <li><code> getActiveFrame() </code></li>
+* <li><code> getFrames() </code></li>
+* <li><code> setActiveFrame() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XFramesSupplier
+*/
+public class _XFramesSupplier extends MultiMethodTest {
+ public static XFramesSupplier oObj = null;
+ protected XIndexAccess frames = null ;
+ protected XFrame active = null ;
+ protected int activeIdx = -1 ;
+
+ /**
+ * Test calls the method, then result is checked. Also active frame index
+ * is saved in activeIdx variable.<p>
+ *
+ * Has <b> OK </b> status if the method does not return null and the object
+ * contains returned frame. Or if no frames available and the method
+ * returns null.<p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFrames() </code> : obtains frames from the object </li>
+ * </ul>
+ */
+ public void _getActiveFrame() {
+ boolean result = true ;
+
+ requiredMethod("getFrames()") ;
+ active = oObj.getActiveFrame() ;
+ if (active == null) {
+ // if no child frames then no active frame could be
+ result = oObj.getFrames().getCount() == 0;
+ log.println("getActiveFrame() returned null") ;
+ }
+ else {
+ boolean hasActiveFrame = false ;
+ for (int i = 0; i < frames.getCount(); i++) {
+ XFrame fr = null ;
+ try {
+ fr = (XFrame) frames.getByIndex(i) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while calling getByIndex() method :") ;
+ e.printStackTrace(log) ;
+ return;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occured while calling getByIndex() method :") ;
+ e.printStackTrace(log) ;
+ return;
+ }
+ if (active.equals(fr)) {
+ hasActiveFrame = true ;
+ activeIdx = i ;
+ }
+ }
+ if (!hasActiveFrame) {
+ log.println("getActiveFrame() isn't contained " +
+ "in getFrames() collection") ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getActiveFrame()", result) ;
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method does not return null,
+ * number of returned frames is not zero and each of them is not null too.
+ */
+ public void _getFrames() {
+ boolean result = true ;
+ int cnt = 0;
+
+ frames = oObj.getFrames() ;
+ if (frames != null) {
+ cnt = frames.getCount() ;
+// if (cnt == 0) result = false ;
+ log.println("There are " + cnt + " frames.") ;
+ } else {
+ log.println("getFrames() returned null !!!") ;
+ result = false ;
+ }
+ for (int i = 0; i < cnt; i++) {
+ try {
+ if (frames.getByIndex(i) == null) {
+ log.println("Frame(" + i + ") == null") ;
+ result = false ;
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while calling getByIndex() method :") ;
+ e.printStackTrace(log) ;
+ return;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occured while calling getByIndex() method :") ;
+ e.printStackTrace(log) ;
+ return;
+ }
+ }
+
+ tRes.tested("getFrames()", result) ;
+ }
+
+ /**
+ * After selecting frame to be activated, test calls the method. <p>
+ *
+ * Has <b> OK </b> status if set and gotten active frames are equal.<p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getActiveFrame() </code> : gets active frame </li>
+ * </ul>
+ */
+ public void _setActiveFrame() {
+ boolean result = true ;
+ XFrame sFrame = null ;
+
+ requiredMethod("getActiveFrame()") ;
+ if (frames.getCount() > 1) {
+ try {
+ if (activeIdx != 0)
+ sFrame = (XFrame) frames.getByIndex(0) ;
+ else
+ sFrame = (XFrame) frames.getByIndex(1) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while calling getByIndex() method :") ;
+ e.printStackTrace(log) ;
+ return;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occured while calling getByIndex() method :") ;
+ e.printStackTrace(log) ;
+ return;
+ }
+ } else if (frames.getCount() > 0) {
+ sFrame = active ;
+ } else {
+ sFrame = null;
+ }
+
+ oObj.setActiveFrame(sFrame) ;
+ XFrame gFrame = oObj.getActiveFrame() ;
+ if (!(gFrame == null && sFrame == null
+ || sFrame.equals(gFrame))) {
+
+ log.println("Active frame set is not equal frame get: FAILED");
+ result = false ;
+ }
+
+ tRes.tested("setActiveFrame()", result) ;
+ }
+
+} // finished class _XFramesSupplier
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XModel.java b/qadevOOo/tests/java/ifc/frame/_XModel.java
new file mode 100644
index 000000000000..7d1dc47f0efd
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XModel.java
@@ -0,0 +1,278 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.view.XSelectionSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.frame.XModel</code>
+* interface methods:
+* <ul>
+* <li><code> attachResource() </code></li>
+* <li><code> connectController() </code></li>
+* <li><code> disconnectController() </code></li>
+* <li><code> getArgs() </code></li>
+* <li><code> getCurrentController() </code></li>
+* <li><code> getCurrentSelection() </code></li>
+* <li><code> getURL() </code></li>
+* <li><code> hasControllersLocked() </code></li>
+* <li><code> lockControllers() </code></li>
+* <li><code> setCurrentController() </code></li>
+* <li><code> unlockControllers() </code></li>
+* </ul><p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CONT2'</code> (of type <code>XController</code>):
+* a controller used as an argument for several test methods </li>
+* <li> <code>'TOSELECT'</code> (of type <code>Object</code>):
+* something, we want to select from document </li>
+* <li> <code>'SELSUPP'</code> (of type <code>XSelectionSupplier</code>):
+* supplier, we use to select something in a document </li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XModel
+*/
+public class _XModel extends MultiMethodTest {
+ public XModel oObj = null;
+ boolean result = true;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns true.
+ */
+ public void _attachResource() {
+ log.println( "opening DataSourceBrowser" );
+ PropertyValue[] noArgs = new PropertyValue[0];
+ result = oObj.attachResource(".component:DB/DataSourceBrowser",noArgs);
+ tRes.tested("attachResource()", result);
+ }
+
+ /**
+ * After obtaining object relation 'CONT2' and storing old controller,
+ * test calls the method, then result is checked.<p>
+ * Has <b> OK </b> status if controller, gotten after method call is not
+ * equal to a previous controller.
+ */
+ public void _connectController() {
+ XController cont2 = (XController) tEnv.getObjRelation("CONT2");
+ XController old = oObj.getCurrentController();
+ result = false;
+ if (cont2 == null) {
+ log.println("No controller no show");
+ } else {
+ oObj.connectController(cont2);
+ result = (oObj.getCurrentController() != old);
+ }
+ tRes.tested("connectController()", result);
+ }
+
+ /**
+ * After obtaining object relation 'CONT2', test calls the method,
+ * then result is checked.<p>
+ * Has <b> OK </b> status if controller, gotten after method call is not
+ * equal to a controller we use as an argument to method.
+ */
+ public void _disconnectController() {
+ XController cont2 = (XController) tEnv.getObjRelation("CONT2");
+ result = false;
+ if (cont2 == null) {
+ log.println("No controller no show");
+ } else {
+ oObj.disconnectController(cont2);
+ result = (oObj.getCurrentController() != cont2);
+ }
+ tRes.tested("disconnectController()", result);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getArgs() {
+ tRes.tested("getArgs()", oObj.getArgs() != null);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getCurrentController() {
+ XController ctrl = oObj.getCurrentController();
+ tRes.tested("getCurrentController()", ctrl != null);
+ }
+
+ /**
+ * After obtaining object relations 'SELSUPP' and 'TOSELECT', test prepares
+ * selection and calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getCurrentSelection() {
+ XSelectionSupplier selsupp = (XSelectionSupplier)
+ tEnv.getObjRelation("SELSUPP");
+ Object toSelect = tEnv.getObjRelation("TOSELECT");
+ result = false;
+ if ( selsupp == null ) {
+ log.println("No Selection Supplier no show");
+ } else {
+ try {
+ selsupp.select(toSelect);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while select:");
+ e.printStackTrace(log);
+ return;
+ }
+ Object sel = oObj.getCurrentSelection();
+ result = (sel != null);
+ }
+
+ tRes.tested("getCurrentSelection()", result);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method does not return null.
+ */
+ public void _getURL() {
+ String url = oObj.getURL();
+ log.println("The url: " + url);
+ tRes.tested("getURL()", url != null);
+ }
+
+ /**
+ * if controller is not locked, test calls the method. <p>
+ * Has <b> OK </b> status if the method returns true. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> lockControllers() </code> : locks controllers </li>
+ * </ul>
+ */
+ public void _hasControllersLocked() {
+ requiredMethod("lockControllers()");
+ tRes.tested("hasControllersLocked()", oObj.hasControllersLocked());
+ }
+
+ /**
+ * Test calls the method, then result is checked.<p>
+ * Has <b> OK </b> status if method locks controllers.
+ */
+ public void _lockControllers() {
+ oObj.lockControllers();
+ result = oObj.hasControllersLocked();
+ tRes.tested("lockControllers()", result);
+ }
+
+ /**
+ * After obtaining object relation 'CONT2' and storing old controller,
+ * controller cont2 is connected, then this controller is
+ * setting as current.
+ * Sets the old controller as current.
+ * <p>Has <b> OK </b> status if set and gotten controllers are not equal.
+ */
+ public void _setCurrentController() {
+ XController cont2 = (XController) tEnv.getObjRelation("CONT2");
+ XController old = oObj.getCurrentController();
+ result = false;
+ if (cont2 == null) {
+ log.println("No controller no show");
+ } else {
+ oObj.connectController(cont2);
+ try {
+ oObj.setCurrentController(cont2);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.print("Cannot set current controller:");
+ e.printStackTrace(log);
+ }
+ result = (oObj.getCurrentController() != old);
+ try {
+ oObj.setCurrentController(old);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.print("Cannot set current controller:");
+ e.printStackTrace(log);
+ }
+ }
+ tRes.tested("setCurrentController()", result);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if method unlocks controllers.
+ * <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> hasControllersLocked() </code> : checks if controllers are
+ * locked </li>
+ * </ul>
+ */
+ public void _unlockControllers() {
+ requiredMethod("hasControllersLocked()");
+ oObj.unlockControllers();
+ result = ! oObj.hasControllersLocked();
+ tRes.tested("unlockControllers()", result);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XStorable.java b/qadevOOo/tests/java/ifc/frame/_XStorable.java
new file mode 100644
index 000000000000..b1f4edc9c804
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XStorable.java
@@ -0,0 +1,256 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XStorable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XStorable;
+import com.sun.star.io.IOException;
+import lib.MultiMethodTest;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.frame.XStorable</code>
+* interface methods:
+* <ul>
+* <li><code> getLocation() </code></li>
+* <li><code> hasLocation() </code></li>
+* <li><code> isReadonly() </code></li>
+* <li><code> storeAsURL() </code></li>
+* <li><code> storeToURL() </code></li>
+* <li><code> store() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XStorable
+*/
+public class _XStorable extends MultiMethodTest {
+ public XStorable oObj = null; // oObj filled by MultiMethodTest
+ String storeUrl;
+ boolean stored;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status in three cases:
+ * <ol>
+ * <li>An object has location stored in. Then if method does not return
+ * null, it has <b> OK </b> status</li>
+ * <li>An object has no location stored in. Then method storeAsURL() is
+ * called, and if url is not null and equals to a url where component
+ * was stored, method has <b> OK </b> status</li>
+ * <li>An object has no location stored in. Then method storeAsURL() is
+ * called, and if url is null and method returns null too, method
+ * has <b> OK </b> status </li>
+ * </ol><p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> storeAsURL() </code> : stores the object's persistent data
+ * to a URL and lets the object become the representation of this new
+ * URL</li>
+ * </ul>
+ */
+ public void _getLocation() {
+ if (oObj.hasLocation()) {
+ // if it has location it should know it
+ tRes.tested("getLocation()", oObj.getLocation() != null);
+ } else {
+ // else try to obtain location
+ requiredMethod("storeAsURL()");
+ if (storeUrl != null) {
+ // if stored succesfully - check location
+ log.println(oObj.getLocation() + "--" + storeUrl);
+ tRes.tested("getLocation()",
+ storeUrl.equals(oObj.getLocation()));
+ } else {
+ // if not - it should not have a location
+ tRes.tested("getLocation()", oObj.getLocation() == null);
+ }
+ }
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if stored url is not null and method does not
+ * return null or if stored url is null and the method returns null.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> storeAsURL() </code>: stores the object's persistent data
+ * to a URL and lets the object become the representation of this new
+ * URL</li>
+ * </ul>
+ */
+ public void _hasLocation() {
+ requiredMethod("storeAsURL()");
+ if (storeUrl != null) {
+ // if stored succesfully - it should have a location
+ tRes.tested("hasLocation()", oObj.hasLocation());
+ } else {
+ // if not - it should not
+ tRes.tested("hasLocation()", !oObj.hasLocation());
+ }
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if value, returned by the method is not equal to
+ * 'stored' variable. ( If it's readonly it should not have been stored. )
+ * <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> store() </code> : stores data to the URL from which it
+ * was loaded </li>
+ * </ul>
+ */
+ public void _isReadonly() {
+ requiredMethod("store()");
+ tRes.tested("isReadonly()", oObj.isReadonly() != stored);
+ }
+
+ /**
+ * Object is stored into temporary directory. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _storeAsURL() {
+ // getting an url to store
+ String url = (String) utils.getOfficeTemp(tParam.getMSF());
+
+ url += "xstorable.store.as.test";
+ if (url != null) {
+ try {
+ oObj.storeAsURL(url, new PropertyValue[0]);
+ storeUrl = url;
+ tRes.tested("storeAsURL()", true);
+ } catch (IOException e) {
+ log.println("Couldn't store as "+url+" : "+e.getMessage());
+ e.printStackTrace(log);
+ storeUrl = null;
+ tRes.tested("storeAsURL()", false);
+ }
+ } else {
+ log.println("an url to store is not found");
+ }
+ }
+
+ /**
+ * Object is stored into temporary directory. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _storeToURL() {
+ // getting an url to store
+ String url = (String) utils.getOfficeTemp(tParam.getMSF());
+
+ url += "xstorable.store.as.test";
+ if (url != null) {
+ try {
+ oObj.storeToURL(url, new PropertyValue[0]);
+ tRes.tested("storeToURL()", true);
+ } catch (IOException e) {
+ log.println("Couldn't store to "+url+" : "+e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("storeToURL()", false);
+ }
+ } else {
+ log.println("an url to store is not found");
+ }
+ }
+
+ /**
+ * Test calls the method. Then result is checked.<p>
+ * Has <b> OK </b> status if:
+ * <ol>
+ * <li>component was stored, object is not readonly and has location</li>
+ * <li>exception occured because of component is readonly
+ * and wasn't stored</li>
+ * </ol>
+ */
+ public void _store() {
+ IOException ioE = null;
+
+ try {
+ oObj.store();
+ stored = true;
+ } catch (IOException e) {
+ stored = false;
+ ioE = e;
+ }
+ if (oObj.hasLocation() && !oObj.isReadonly()) {
+ tRes.tested("store()", stored);
+ if (!stored) {
+ log.println("Couldn't store : " + ioE.getMessage());
+ ioE.printStackTrace(log);
+ }
+ } else {
+ tRes.tested("store()", !stored);
+ if (stored) {
+ if (!oObj.hasLocation()) {
+ log.println("Shouldn't store successfully"
+ + " a document without location");
+ } else {
+ log.println("Shouldn't store successfully"
+ + " a read-only document");
+ }
+ }
+ }
+ }
+
+}// finished class _XStorable
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java
new file mode 100644
index 000000000000..5e9d824430b3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSynchronousFrameLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XSynchronousFrameLoader;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.*;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.SOfficeFactory;
+
+/**
+ * Testing <code>com.sun.star.frame.XSynchronousFrameLoader</code>
+ * interface methods :
+ * <ul>
+ * <li><code> load()</code></li>
+ * <li><code> cancel()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'FrameLoader.URL'</code> (of type <code>String</code>):
+ * an url of component to be loaded </li>
+ * <li> <code>'FrameLoader.Frame'</code> <b>(optional)</b>
+ * (of type <code>com.sun.star.frame.XFrame</code>):
+ * a target frame where component to be loaded. If this
+ * relation is ommited then a text document created and its
+ * frame is used. </li>
+ * <ul> <p>
+ *
+ * @see com.sun.star.frame.XSynchronousFrameLoader
+ */
+public class _XSynchronousFrameLoader extends MultiMethodTest {
+
+ public XSynchronousFrameLoader oObj = null; // oObj filled by MultiMethodTest
+ private String url = null ;
+ private XFrame frame = null ;
+ private XComponent frameSup = null ;
+ private PropertyValue[] descr = null;
+
+ /**
+ * Retrieves all relations. If optional relation
+ * <code>FrameLoader.Frame</code> not found
+ * creates a new document and otains its frame for loading. <p>
+ *
+ * Also <code>MediaDescriptor</code> is created using
+ * URL from <code>FrameLoader.URL</code> relation.
+ *
+ * @throws StatusException If one of required relations not found.
+ */
+ public void before() {
+ url = (String) tEnv.getObjRelation("FrameLoader.URL") ;
+ frame = (XFrame) tEnv.getObjRelation("FrameLoader.Frame") ;
+
+ if (url == null) {
+ throw new StatusException(Status.failed("Some relations not found")) ;
+ }
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+
+ XURLTransformer xURLTrans = null;
+
+ // if frame is not contained in relations the writer frmame will be used.
+ if (frame == null) {
+ try {
+ log.println( "creating a textdocument" );
+ frameSup = SOF.createTextDoc( null );
+
+ Object oDsk = tParam.getMSF().createInstance
+ ("com.sun.star.frame.Desktop") ;
+ XDesktop dsk = (XDesktop) UnoRuntime.queryInterface
+ (XDesktop.class, oDsk) ;
+ frame = dsk.getCurrentFrame() ;
+
+ Object o = tParam.getMSF().createInstance
+ ("com.sun.star.util.URLTransformer") ;
+ xURLTrans = (XURLTransformer) UnoRuntime.queryInterface
+ (XURLTransformer.class, o) ;
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create a document.", e );
+ }
+ }
+
+ URL[] urlS = new URL[1];
+ urlS[0] = new URL();
+ urlS[0].Complete = url;
+ boolean res = xURLTrans.parseStrict(urlS);
+ log.println("Parsing URL '" + url + "': " + res);
+ descr = new PropertyValue[1] ;
+ descr[0] = new PropertyValue();
+ descr[0].Name = "URL" ;
+ descr[0].Value = urlS[0] ;
+ }
+
+ private boolean loaded = false ;
+
+ /**
+ * Tries to load component to a frame. <p>
+ * Has <b> OK </b> status if <code>true</code> is returned.
+ */
+ public void _load() {
+ boolean result = oObj.load(descr, frame) ;
+
+ tRes.tested("load()", result) ;
+ }
+
+ /**
+ * Tries to load component to a frame in separate thread to
+ * avoid blocking of the current thread and imediately
+ * cancels loading. <p>
+ *
+ * Has <b> OK </b> status if <code>flase</code> is returned,
+ * i.e. loading was not completed.
+ */
+ public void _cancel() {
+ requiredMethod("load()") ;
+
+ final boolean[] result = new boolean[1] ;
+
+ (new Thread() {
+ public void run() {
+ result[0] = oObj.load(descr, frame);
+ }
+ }).start();
+
+ oObj.cancel() ;
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {}
+
+
+ tRes.tested("cancel()", !result[0]) ;
+ }
+
+ /**
+ * Disposes document if it was created for frame supplying.
+ */
+ protected void after() {
+ if (frameSup != null) {
+ frameSup.dispose();
+ }
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/frame/_XTasksSupplier.java b/qadevOOo/tests/java/ifc/frame/_XTasksSupplier.java
new file mode 100644
index 000000000000..28e58acce0d0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/frame/_XTasksSupplier.java
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTasksSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.frame;
+
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.frame.XTask;
+import com.sun.star.frame.XTasksSupplier;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.frame.XTasksSupplier</code>
+* interface methods:
+* <ul>
+* <li><code> getActiveTask() </code></li>
+* <li><code> getTasks() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.frame.XTasksSupplier
+*/
+public class _XTasksSupplier extends MultiMethodTest {
+ public static XTasksSupplier oObj = null;
+
+ /**
+ * DEPRECATED. <p>
+ * Has <b> OK </b> status .
+ */
+ public void _getActiveTask() {
+// XTask active = oObj.getActiveTask() ;
+// if (active == null)
+// log.println("There is no active task");
+// else
+// log.println("Active task: " + active.getName());
+ log.println("DEPRECATED");
+
+ tRes.tested("getActiveTask()", true) ;
+ } // finished _getTasks()
+
+ /**
+ * DEPRECATED. <p>
+ * Has <b> OK </b> status.
+ */
+ public void _getTasks() {
+// int cnt = 0 ;
+// boolean result = true ;
+// XTask task = null ;
+//
+// XEnumerationAccess enumAcc = oObj.getTasks() ;
+// XEnumeration enum = enumAcc.createEnumeration() ;
+// while (enum.hasMoreElements()) {
+// cnt ++ ;
+// try {
+// task = (XTask) enum.nextElement() ;
+// } catch (com.sun.star.container.NoSuchElementException e) {
+// e.printStackTrace(log);
+// } catch (com.sun.star.lang.WrappedTargetException e) {
+// e.printStackTrace(log);
+// }
+// if (task == null)
+// log.println("" + cnt + " task: null !!!") ;
+// else
+// log.println("" + cnt + " task: " + task.getName()) ;
+// result &= (task != null) ;
+// }
+// log.println("Totaly tasks: " + cnt) ;
+//
+// if (cnt > 0 && result) tRes.tested("getTasks()", true) ;
+
+ log.println("DEPRECATED");
+
+ tRes.tested("getTasks()", true);
+
+ } // finished _removeResetListener()
+
+} // finished class _XTaskSupplier
+
diff --git a/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java b/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java
new file mode 100644
index 000000000000..860eb360bbcc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java
@@ -0,0 +1,714 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XBreakIterator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.i18n;
+
+import com.sun.star.i18n.Boundary;
+import com.sun.star.i18n.LineBreakHyphenationOptions;
+import com.sun.star.i18n.LineBreakResults;
+import com.sun.star.i18n.LineBreakUserOptions;
+import com.sun.star.i18n.ScriptType;
+import com.sun.star.i18n.WordType;
+import com.sun.star.i18n.XBreakIterator;
+import com.sun.star.lang.Locale;
+import java.util.Vector;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.i18n.XBreakIterator</code>
+* interface methods :
+* <ul>
+* <li><code> nextCharacters()</code></li>
+* <li><code> previousCharacters()</code></li>
+* <li><code> nextWord()</code></li>
+* <li><code> previousWord()</code></li>
+* <li><code> getWordBoundary()</code></li>
+* <li><code> getWordType()</code></li>
+* <li><code> isBeginWord()</code></li>
+* <li><code> isEndWord()</code></li>
+* <li><code> beginOfSentence()</code></li>
+* <li><code> endOfSentence()</code></li>
+* <li><code> getLineBreak()</code></li>
+* <li><code> beginOfScript()</code></li>
+* <li><code> endOfScript()</code></li>
+* <li><code> nextScript()</code></li>
+* <li><code> previousScript()</code></li>
+* <li><code> getScriptType()</code></li>
+* <li><code> beginOfCharBlock()</code></li>
+* <li><code> endOfCharBlock()</code></li>
+* <li><code> nextCharBlock()</code></li>
+* <li><code> previousCharBlock()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Locale'</code>
+* (of type <code>com.sun.star.lang.Locale</code>):
+* this locale is used as locale argument for tested methods.
+* </li>
+* <li> <code>'UnicodeString'</code>
+* (of type <code>String</code>): Unicode string which is passed
+* to methods except 'CharacterBlock' methods.
+* </li>
+* <ul> <p>
+* @see com.sun.star.i18n.XBreakIterator
+*/
+public class _XBreakIterator extends MultiMethodTest {
+
+ public XBreakIterator oObj = null;
+
+ Locale locale = null;
+ String UnicodeString = null;
+
+ short wordType = WordType.ANYWORD_IGNOREWHITESPACES;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ protected void before() {
+ locale = (Locale)tEnv.getObjRelation("Locale");
+ if (locale == null) {
+ throw new StatusException
+ (Status.failed("Relation 'Locale' not found")) ;
+ }
+
+ UnicodeString = (String)tEnv.getObjRelation("UnicodeString");
+ if (UnicodeString == null) {
+ throw new StatusException(Status.failed
+ ("Relation 'UnicodeString' not found")) ;
+ }
+ }
+
+ /**
+ * Compares returned next character positions with expected values. <p>
+ *
+ * Has <b>OK</b> status if position after travel and traveled length
+ * has expected values.
+ */
+ public void _nextCharacters() {
+ short nCharacterIteratorMode =
+ com.sun.star.i18n.CharacterIteratorMode.SKIPCHARACTER;
+
+ int strLength = UnicodeString.length();
+
+ //Start from position : Travel ... chars :
+ // Actual position after : How many chars traveled
+ int[][] nextCharacters = {
+ { 1, 5000, strLength , strLength - 1 },
+ { 10, 6, 16, 6}};
+
+ boolean bRes = true;
+
+ for(int i = 0; i < nextCharacters.length; i++) {
+ int[] lDone = new int[1];
+ long lRes = oObj.nextCharacters(UnicodeString, nextCharacters[i][0],
+ locale, nCharacterIteratorMode, nextCharacters[i][1], lDone);
+ log.println("Expected result is: lRes = " + nextCharacters[i][2] +
+ "; lDone = " + nextCharacters[i][3] );
+ log.println("Actual result is: lRes = " + lRes +
+ "; lDone = " + lDone[0] );
+
+ bRes = bRes && lRes == nextCharacters[i][2];
+ bRes = bRes && lDone[0] == nextCharacters[i][3];
+ }
+
+ tRes.tested("nextCharacters()", bRes);
+ }
+
+ /**
+ * Compares returned previous character positions with expected values. <p>
+ *
+ * Has <b>OK</b> status if position after travel and traveled length
+ * has expected values.
+ */
+ public void _previousCharacters() {
+ short nCharacterIteratorMode =
+ com.sun.star.i18n.CharacterIteratorMode.SKIPCHARACTER;
+
+ int strLength = UnicodeString.length();
+
+ //Start from position : Travel ... chars : Actual position after :
+ //How many chars traveled
+ int[][] previousCharacters = {
+ {5, 5000, 0, 5},
+ {10, 6, 4, 6}};
+
+ boolean bRes = true;
+ for(int i = 0; i < previousCharacters.length; i++) {
+ int[] lDone = new int[1];
+ int lRes = oObj.previousCharacters(UnicodeString,
+ previousCharacters[i][0],
+ locale, nCharacterIteratorMode,
+ previousCharacters[i][1], lDone);
+ log.println("Expected result is: lRes = " + previousCharacters[i][2]
+ + "; lDone = " + previousCharacters[i][3] );
+ log.println("Actual result is: lRes = " + lRes
+ + "; lDone = " + lDone[0]);
+
+ bRes = bRes && lRes == previousCharacters[i][2];
+ bRes = bRes && lDone[0] == previousCharacters[i][3];
+ }
+
+ tRes.tested("previousCharacters()", bRes);
+ }
+
+ Vector vBounds = new Vector();
+
+ /**
+ * Saves bounds of all returned words for the future tests. <p>
+ * Has <b>OK</b> status.
+ */
+ public void _nextWord() {
+ int i = 0;
+
+ while( i < UnicodeString.length() - 1 ) {
+ Boundary bounds = oObj.nextWord
+ (UnicodeString, i, locale, wordType);
+ if (bounds.endPos - bounds.startPos > 3) {
+ vBounds.add( bounds );
+ log.println("Word " + vBounds.size() + "("
+ + bounds.startPos + "," + bounds.endPos + "): '" +
+ UnicodeString.substring(bounds.startPos,
+ bounds.endPos) + "'");
+ }
+ i = bounds.endPos - 1;
+ }
+ log.println("In text there are " + vBounds.size()
+ + " words, if count from left to right");
+ tRes.tested("nextWord()", true);
+ }
+
+ /**
+ * Compares number of word bounds with number of word bounds saved
+ * by the method _nextWord().<p>
+ * Has <b>OK</b> status if number of word bounds are equal.
+ */
+ public void _previousWord() {
+ requiredMethod("nextWord()");
+
+ int i = UnicodeString.length() - 1;
+ Vector vPrevBounds = new Vector();
+ while( i > 0 ) {
+ Boundary bounds =
+ oObj.previousWord(UnicodeString, i, locale, wordType);
+ if (bounds.endPos - bounds.startPos > 3) {
+ vPrevBounds.add( bounds );
+ log.println("Word " + vPrevBounds.size() + "("
+ + bounds.startPos + "," + bounds.endPos + "): '"
+ + UnicodeString.substring(bounds.startPos, bounds.endPos)
+ + "'");
+ }
+ i = bounds.startPos;
+ }
+ log.println("In text there are " + vPrevBounds.size()
+ + " words, if count from right to left");
+ tRes.tested("previousWord()", vPrevBounds.size() == vBounds.size() );
+ }
+
+ /**
+ * For every word in array obtained by <code>nextWord</code> method test
+ * computes bounds of the word, passing its internal character position.<p>
+ *
+ * Has <b>OK</b> status if bounds calculated by <code>getWordBoundary()</code>
+ * method are the same as bounds obtained by <code>nextWord</code> method.
+ */
+ public void _getWordBoundary() {
+ requiredMethod("nextWord()");
+
+ boolean bRes = true;
+
+ for(int i = 0; i < vBounds.size(); i++) {
+ // calculate middle of the word
+ Boundary iBounds = (Boundary)vBounds.get(i);
+ int iPos = (iBounds.endPos - iBounds.startPos) / 2
+ + iBounds.startPos;
+ Boundary bounds = oObj.getWordBoundary(UnicodeString, iPos,
+ locale, wordType, true);
+ log.println("Expected result is: startPos = " + iBounds.startPos +
+ "; endPos = " + iBounds.endPos);
+ log.println("Actual result is: startPos = " + bounds.startPos
+ + "; endPos = " + bounds.endPos + " Word is: '"
+ + UnicodeString.substring(bounds.startPos, bounds.endPos) + "'");
+
+ bRes = bRes && iBounds.startPos == bounds.startPos;
+ bRes = bRes && iBounds.endPos == bounds.endPos;
+ }
+
+ tRes.tested("getWordBoundary()", bRes);
+ }
+
+ /**
+ * For every word in array obtained by <code>nextWord</code> method test
+ * get its type, passing its internal character position.<p>
+ *
+ * Has <b>OK</b> status if every word has type <code>WordType.ANY_WORD</code>
+ */
+ public void _getWordType() {
+ requiredMethod("nextWord()");
+
+ boolean bRes = true;
+
+ for(int i = 0; i < vBounds.size(); i++) {
+ // calculate middle of the word
+ Boundary iBounds = (Boundary)vBounds.get(i);
+ int iPos = (iBounds.endPos - iBounds.startPos) / 2
+ + iBounds.startPos;
+
+ short type = oObj.getWordType(UnicodeString, iPos, locale);
+
+ bRes = bRes && type == WordType.ANY_WORD;
+ }
+
+ tRes.tested("getWordType()", bRes);
+ }
+
+ /**
+ * For every word in array obtained by <code>nextWord</code> method test
+ * tries to determine if the character at a position starts a word.
+ * First word starting position is passed, then internal character
+ * position is passed. <p>
+ * Has <b>OK</b> status if in the first case <code>true</code>
+ * returned and in the second - <code>false</code> for every word.
+ */
+ public void _isBeginWord() {
+ requiredMethod("nextWord()");
+
+ boolean bRes = true;
+
+ for(int i = 0; i < vBounds.size(); i++) {
+ Boundary iBounds = (Boundary)vBounds.get(i);
+ boolean isBegin = oObj.isBeginWord(UnicodeString, iBounds.startPos,
+ locale, WordType.ANY_WORD);
+ bRes = bRes && isBegin;
+ boolean isNotBegin = !oObj.isBeginWord(UnicodeString,
+ iBounds.startPos + 1, locale, WordType.ANY_WORD);
+ bRes = bRes && isNotBegin;
+
+ log.println("At position + " + iBounds.startPos
+ + " isBeginWord? " + isBegin);
+ log.println("At position + " + (iBounds.startPos + 1)
+ + " isBeginWord? " + !isNotBegin);
+ }
+
+ tRes.tested("isBeginWord()", bRes);
+ }
+
+ /**
+ * For every word in array obtained by <code>nextWord</code> method test
+ * tries to determine if the character at a position ends a word.
+ * First word ending position is passed, then internal character
+ * position is passed. <p>
+ *
+ * Has <b>OK</b> status if in the first case <code>true</code>
+ * returned and in the second - <code>false</code> for every word.
+ */
+ public void _isEndWord() {
+ requiredMethod("nextWord()");
+
+ boolean bRes = true;
+
+ for(int i = 0; i < vBounds.size(); i++) {
+ Boundary iBounds = (Boundary)vBounds.get(i);
+ boolean isEnd = oObj.isEndWord(UnicodeString, iBounds.endPos,
+ locale, WordType.ANY_WORD);
+ bRes = bRes && isEnd;
+ boolean isNotEnd = !oObj.isEndWord(UnicodeString,
+ iBounds.endPos - 1, locale, WordType.ANY_WORD);
+ bRes = bRes && isNotEnd;
+
+ log.println("At position + " + iBounds.endPos
+ + " isEndWord? " + isEnd);
+ log.println("At position + " + (iBounds.endPos - 1)
+ + " isEndWord? " + !isNotEnd);
+ }
+
+ tRes.tested("isEndWord()", bRes);
+ }
+
+ Vector vSentenceStart = new Vector();
+ /**
+ * Tries to find all sentences starting positions passing every character
+ * as position parameter and stores them. Then tries to pass invalid
+ * position parameters.
+ *
+ * Has <b>OK</b> status if -1 is returned for wrong position arguments.
+ */
+ public void _beginOfSentence() {
+ int iPos = 0;
+ while( iPos < UnicodeString.length() ) {
+ Integer start = new Integer( oObj.beginOfSentence(UnicodeString,
+ iPos, locale) );
+ if (start.intValue() >= 0 && !vSentenceStart.contains(start) ) {
+ vSentenceStart.add( start );
+ log.println("Sentence " + vSentenceStart.size()
+ + " : start from position " + start);
+ }
+ iPos++;
+ }
+
+ //test for invalid nStartPosition
+ boolean bRes = oObj.beginOfSentence(UnicodeString, -10, locale) == -1;
+ bRes &= oObj.beginOfSentence(UnicodeString,
+ UnicodeString.length() + 1, locale) == -1;
+
+ if (!bRes) {
+ log.println("When invalid position, returned value isn't equal to -1");
+ }
+
+ tRes.tested("beginOfSentence()", bRes);
+ }
+
+ /**
+ * For every sentence starting position found in
+ * <code>beginOfSentence()</code> test tries to compute end
+ * position of a sentence and checks that the end position is
+ * greater than starting.
+ * Then wrong position arguments are passed.
+ *
+ * Has <b>OK</b> status if the end position of every sentence
+ * greater than starting and -1 returned for invalid arguments.
+ */
+ public void _endOfSentence() {
+ boolean bRes = true;
+ for(int i = 0; i < vSentenceStart.size(); i++) {
+ int start = ((Integer)vSentenceStart.get(i)).intValue();
+ int end = oObj.endOfSentence(UnicodeString, start, locale);
+ bRes &= end > start;
+ log.println("Sentence " + i + " range is [" + start + ", "
+ + end + "]");
+ }
+
+ //test for invalid nStartPosition
+ boolean bInvRes = oObj.endOfSentence(UnicodeString, -10, locale) == -1;
+ bInvRes &= oObj.endOfSentence(UnicodeString,
+ UnicodeString.length() + 1, locale) == -1;
+
+ if (!bInvRes) {
+ log.println("When invalid position, returned value isn't equal to -1");
+ }
+
+ tRes.tested("endOfSentence()", bRes && bInvRes);
+ }
+
+ /**
+ * Tries to break a string in position other than 0 iterating characters
+ * from the string beginning (Hyphenation is not used for a while). <p>
+ *
+ * Has <b>OK</b> status if non-zero break position was found and it is
+ * less or equal than position we trying to break.
+ */
+ public void _getLineBreak() {
+ boolean bRes = true;
+ LineBreakResults lineBreakResults;
+ LineBreakHyphenationOptions lineBreakHyphenationOptions =
+ new LineBreakHyphenationOptions();
+ LineBreakUserOptions lineBreakUserOptions = new LineBreakUserOptions();
+
+ lineBreakUserOptions.applyForbiddenRules = false;
+ lineBreakUserOptions.allowHyphenateEnglish = false;
+
+ int breakPos = 0;
+ int pos = 0;
+
+ while(breakPos == 0 && pos < UnicodeString.length() ) {
+ lineBreakResults = oObj.getLineBreak(UnicodeString, pos,
+ locale, 0, lineBreakHyphenationOptions, lineBreakUserOptions);
+ breakPos = lineBreakResults.breakIndex;
+ pos++;
+ }
+
+ // finally the position of break must be found in the middle and
+ // it must be before the break position specified
+ bRes = breakPos <= pos && breakPos > 0;
+
+ if (!bRes) {
+ log.println("The last position was: " + pos
+ + ", and the break position was: " + breakPos);
+ }
+
+ tRes.tested("getLineBreak()", bRes);
+ }
+
+ // Asian type script
+ private static String katakana = new String(new char[] {0x30A1, 0x30A2}) ;
+ // Weak type script
+ private static String arrows = new String(new char[] {0x2190, 0x2191}) ;
+ // Complex type script
+ private static String arabic = new String(new char[] {0x0641, 0x0642}) ;
+
+ /**
+ * Tries to find the begining of the nearest script specified
+ * relatively to position passed. <p>
+ * Has <b>OK</b> status if the starting position of script is returned.
+ */
+ public void _beginOfScript() {
+ String multiScript = "ab" + katakana ;
+
+ int pos = oObj.beginOfScript(multiScript, 3, ScriptType.ASIAN) ;
+
+ log.println("Position = " + pos) ;
+
+ tRes.tested("beginOfScript()", pos == 2) ;
+ }
+
+ /**
+ * Tries to find the end of the nearest script specified
+ * relatively to position passed. <p>
+ * Has <b>OK</b> status if the end position of script is returned.
+ */
+ public void _endOfScript() {
+ String multiScript = "ab" + katakana + "cd" ;
+
+ int pos = oObj.endOfScript(multiScript, 2, ScriptType.ASIAN) ;
+
+ log.println("Position = " + pos) ;
+
+ tRes.tested("endOfScript()", pos == 4) ;
+ }
+
+ /**
+ * Tries to find the next script starting position specified
+ * relatively to position passed. <p>
+ * Has <b>OK</b> status if the appropriate position is returned.
+ */
+ public void _nextScript() {
+ String multiScript = "ab" + katakana + "cd" ;
+
+ int pos = oObj.nextScript(multiScript, 0, ScriptType.LATIN) ;
+
+ log.println("Position = " + pos) ;
+
+ tRes.tested("nextScript()", pos == 4) ;
+ }
+
+ /**
+ * Tries to find the previous script starting position specified
+ * relatively to position passed. <p>
+ * Has <b>OK</b> status if the appropriate position is returned.
+ */
+ public void _previousScript() {
+ String multiScript = "ab" + katakana + "cd" ;
+
+ int pos = oObj.previousScript(multiScript, 5, ScriptType.ASIAN) ;
+
+ log.println("Position = " + pos) ;
+
+ tRes.tested("previousScript()", pos == 2) ;
+ }
+
+ /**
+ * Tries to determine script type (of all four types). <p>
+ * Has <b>OK</b> status if <code>LATIN</code> type returned
+ * for ACSII character, <code>ASIAN</code> for Katakana Unicode
+ * codepoints, <code>COMPLEX</code> for Arabic Unicode
+ * codepoints and <code>WEAK</code> for codepoints from Arrows
+ * Unicode block.
+ */
+ public void _getScriptType() {
+ boolean res = true ;
+
+ res &= oObj.getScriptType("abcd", 0) == ScriptType.LATIN ;
+ res &= oObj.getScriptType(katakana, 0) == ScriptType.ASIAN;
+ res &= oObj.getScriptType(arabic, 0) == ScriptType.COMPLEX ;
+ res &= oObj.getScriptType(arrows, 0) == ScriptType.WEAK ;
+
+ tRes.tested("getScriptType()", res) ;
+ }
+
+ boolean bCharBlockRes = true;
+
+ protected short getCharBlockType(int pos) {
+ short i = 1;
+ short cType = 0;
+ while (i < 31) {
+ if (oObj.beginOfCharBlock(UnicodeString, pos, locale, i) != -1) {
+ cType = i;
+ i = 100;
+ }
+ i++;
+ }
+
+ return cType;
+ }
+
+ Vector vCharBlockBounds = new Vector();
+ Vector vCharBlockTypes = new Vector();
+
+ /**
+ * Creates array of all char blocks with their boundaries and
+ * types using <code>beginOfCharBlock()</code> and
+ * <code>endOfCharBlock()</code> methods. <p>
+ *
+ * Has <b>OK</b> status if the end of each boundary is the same
+ * as start of the next one and if the start of the first block
+ * has position 0 and the end of the last block is at the end
+ * of the whole string.
+ */
+ public void _beginOfCharBlock() {
+ int iPos = 0;
+
+ while( iPos < UnicodeString.length() && iPos > -1) {
+ short charType = getCharBlockType(iPos);
+ int startPos = oObj.beginOfCharBlock(UnicodeString, iPos,
+ locale, charType);
+ int endPos = oObj.endOfCharBlock(UnicodeString, iPos,
+ locale, charType);
+ iPos = endPos;
+ vCharBlockBounds.add(new Boundary(startPos, endPos));
+ log.println("" + vCharBlockBounds.size() + "). Bounds: ["
+ + startPos + "," + endPos + "]; Type = " + charType);
+ vCharBlockTypes.add(new Short(charType));
+ }
+
+ for(int i = 0; i < vCharBlockBounds.size() - 1; i++) {
+ int endPos = ((Boundary)vCharBlockBounds.get(i)).endPos;
+ int startPos = ((Boundary)vCharBlockBounds.get(i + 1)).startPos;
+ bCharBlockRes &= endPos == startPos;
+ }
+
+ log.println("Testing for no intersections : " + bCharBlockRes);
+ int startPos = ((Boundary)vCharBlockBounds.get(0)).startPos;
+ bCharBlockRes &= startPos == 0;
+ int endPos = ((Boundary)vCharBlockBounds.get
+ (vCharBlockBounds.size() - 1)).endPos;
+ bCharBlockRes &= endPos == UnicodeString.length();
+ log.println("Regions should starts with 0 and ends with "
+ + UnicodeString.length());
+
+ tRes.tested("beginOfCharBlock()", bCharBlockRes);
+ }
+
+ /**
+ * Testing of this method is performed in <code>beginOfCharBlock()</code>
+ * method test. <p>
+ *
+ * Has the status same as <code>beginOfCharBlock()</code> method status.
+ */
+ public void _endOfCharBlock() {
+ requiredMethod("beginOfCharBlock()");
+ tRes.tested("endOfCharBlock()", bCharBlockRes);
+ }
+
+ /**
+ * For every character block obtained in <code>beginOfCharBlock()</code>
+ * method test (except the first) tries to find its starting position
+ * by mean of <code>nextCharBlock()</code> method passing as position
+ * argument the position before the start of a block. <p>
+ *
+ * Has <b>OK</b> status if the start of every block was found and it's
+ * equal to this block boundary start.
+ */
+ public void _nextCharBlock() {
+ requiredMethod("beginOfCharBlock()");
+
+ boolean bRes = true;
+ for(int i = 0; i < vCharBlockBounds.size(); i++) {
+ Boundary bounds = (Boundary)vCharBlockBounds.get(i);
+ Short type = (Short)vCharBlockTypes.get(i);
+ if (bounds.startPos - 1 < 0) continue;
+ int iPos = oObj.nextCharBlock(UnicodeString, bounds.startPos - 1,
+ locale, type.shortValue());
+ if (iPos != bounds.startPos) {
+ bRes = false;
+ log.println("nextCharBlock(UnicodeString, "
+ + (bounds.startPos - 1) + ", locale, " + type
+ + ") should return " + bounds.startPos);
+ log.println("... and actual value is " + iPos);
+ }
+ }
+
+ tRes.tested("nextCharBlock()", bRes);
+ }
+
+ /**
+ * For every character block obtained in <code>beginOfCharBlock()</code>
+ * method test (except the first) tries to find its starting position
+ * by mean of <code>previousCharBlock()</code> method passing as position
+ * argument the position after the end of a block. <p>
+ *
+ * Has <b>OK</b> status if the start of every block was found and it's
+ * equal to this block boundary start.
+ */
+ public void _previousCharBlock() {
+ requiredMethod("beginOfCharBlock()");
+
+ boolean bRes = true;
+ for(int i = 0; i < vCharBlockBounds.size(); i++) {
+ Boundary bounds = (Boundary)vCharBlockBounds.get(i);
+ Short type = (Short)vCharBlockTypes.get(i);
+ int iPos = oObj.previousCharBlock(UnicodeString,
+ bounds.endPos + 1, locale, type.shortValue());
+ if (iPos != bounds.startPos) {
+ bRes = false;
+ log.println("previousCharBlock(UnicodeString, "
+ + (bounds.endPos + 1) + ", locale, " + type
+ + ") should return " + bounds.startPos);
+ log.println("... and actual value is " + iPos);
+ }
+ }
+
+ tRes.tested("previousCharBlock()", bRes);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/i18n/_XCalendar.java b/qadevOOo/tests/java/ifc/i18n/_XCalendar.java
new file mode 100644
index 000000000000..601a06d28c7a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/i18n/_XCalendar.java
@@ -0,0 +1,550 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCalendar.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.i18n;
+
+import com.sun.star.i18n.Calendar;
+import com.sun.star.i18n.CalendarDisplayIndex;
+import com.sun.star.i18n.CalendarFieldIndex;
+import com.sun.star.i18n.CalendarItem;
+import com.sun.star.i18n.XCalendar;
+import com.sun.star.i18n.XLocaleData;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.lang.Locale;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.i18n.XCalendar</code>
+* interface methods :
+* <ul>
+* <li><code> loadDefaultCalendar()</code></li>
+* <li><code> loadCalendar()</code></li>
+* <li><code> getLoadedCalendar()</code></li>
+* <li><code> getAllCalendars()</code></li>
+* <li><code> getUniqueID()</code></li>
+* <li><code> setDateTime()</code></li>
+* <li><code> getDateTime()</code></li>
+* <li><code> setValue()</code></li>
+* <li><code> getValue()</code></li>
+* <li><code> isValid()</code></li>
+* <li><code> addValue()</code></li>
+* <li><code> getFirstDayOfWeek()</code></li>
+* <li><code> setFirstDayOfWeek()</code></li>
+* <li><code> setMinimumNumberOfDaysForFirstWeek()</code></li>
+* <li><code> getMinimumNumberOfDaysForFirstWeek()</code></li>
+* <li><code> getNumberOfMonthsInYear()</code></li>
+* <li><code> getNumberOfDaysInWeek()</code></li>
+* <li><code> getMonths()</code></li>
+* <li><code> getDays()</code></li>
+* <li><code> getDisplayName()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.i18n.XCalendar
+*/
+public class _XCalendar extends MultiMethodTest {
+ public XCalendar oObj = null;
+ public String[][] calendars;
+ public int[] count;
+ public double newDTime = 1000.75;
+ public short newValue = 0;
+ public short firstDay = 2;
+ public short mdfw = 3;
+ Locale[] installed_locales;
+
+ public void before() {
+ XLocaleData locData = null;
+ try {
+ locData = (XLocaleData) UnoRuntime.queryInterface(
+ XLocaleData.class,tParam.getMSF().createInstance(
+ "com.sun.star.i18n.LocaleData"));
+ } catch (com.sun.star.uno.Exception e) {
+
+ }
+ installed_locales = locData.getAllInstalledLocaleNames();
+ calendars = new String[installed_locales.length][];
+ count = new int[installed_locales.length];
+ }
+
+ /**
+ * Loads default calendar for different locales. <p>
+ * Has <b> OK </b> status if method loads calendar, that is
+ * default for a given locale.
+ */
+ public void _loadDefaultCalendar() {
+ boolean res = true;
+
+ for (int i=0; i<installed_locales.length; i++) {
+ String lang = "Language: "+installed_locales[i].Language +
+ ", Country: "+ installed_locales[i].Country +
+ ", Variant: "+ installed_locales[i].Country;
+ oObj.loadDefaultCalendar(installed_locales[i]);
+ if (oObj.getLoadedCalendar().Default) {
+ //log.println(lang + " ... OK");
+ } else {
+ log.println(lang + " ... FAILED");
+ }
+ res &= oObj.getLoadedCalendar().Default;
+ }
+
+ tRes.tested("loadDefaultCalendar()", res);
+ }
+
+ /**
+ * Tries to obtain calendars for a number of locales. <p>
+ * Has <b> OK </b> status if the method returns more than zero calendars for
+ * every locale.
+ */
+ public void _getAllCalendars() {
+ boolean res = true;
+
+ for (int i=0; i<installed_locales.length; i++) {
+ String lang = "Language: "+installed_locales[i].Language +
+ ", Country: "+ installed_locales[i].Country +
+ ", Variant: "+ installed_locales[i].Country;
+ calendars[i] = oObj.getAllCalendars(installed_locales[i]);
+ count[i] = calendars[i].length-1;
+ if (calendars[i].length > 0) {
+ //log.println(lang + " ... OK");
+ } else {
+ log.println(lang + " ... FAILED");
+ }
+ res &= (calendars[i].length > 0);
+ }
+ tRes.tested("getAllCalendars()", res);
+ }
+
+ /**
+ * Loads calendars for a number of locales. <p>
+ * Has <b> OK </b> status if loaded calendar names are equal to gotten
+ * calendar names after loading.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getAllCalendars() </code> : gets all calendars for a given
+ * locale </li>
+ * </ul>
+ */
+ public void _loadCalendar() {
+ boolean res = true;
+ requiredMethod("getAllCalendars()");
+
+ for (int i=0; i<installed_locales.length; i++) {
+ String lang = "Language: "+installed_locales[i].Language +
+ ", Country: "+ installed_locales[i].Country +
+ ", Variant: "+ installed_locales[i].Country;
+ oObj.loadCalendar(calendars[i][0], installed_locales[i]);
+ if (calendars[i][0].equals(oObj.getLoadedCalendar().Name)) {
+ //log.println(lang + " ... OK");
+ } else {
+ log.println(lang + " ... FAILED");
+ }
+ res &= calendars[i][0].equals(oObj.getLoadedCalendar().Name);
+ }
+
+ tRes.tested("loadCalendar()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if loaded calendar names are equal to gotten
+ * calendar names after loading.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> loadCalendar() </code> : loads calendar using a given name
+ * and locale </li>
+ * </ul>
+ */
+ public void _getLoadedCalendar() {
+ boolean res = true;
+
+ requiredMethod("loadCalendar()");
+ for (int i=0; i<installed_locales.length; i++) {
+ String lang = "Language: "+installed_locales[i].Language +
+ ", Country: "+ installed_locales[i].Country +
+ ", Variant: "+ installed_locales[i].Country;
+ oObj.loadCalendar(calendars[i][0], installed_locales[i]);
+ if (calendars[i][0].equals(oObj.getLoadedCalendar().Name)) {
+ //log.println(lang + " ... OK");
+ } else {
+ log.println(lang + " ... FAILED");
+ }
+ res &= calendars[i][0].equals(oObj.getLoadedCalendar().Name);
+ }
+ tRes.tested("getLoadedCalendar()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns value that's equal to a
+ * calendar name. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> loadCalendar() </code> : loads calendar using a given name
+ * and locale </li>
+ * </ul>
+ */
+ public void _getUniqueID() {
+ boolean res = true;
+ for (int i=0; i<installed_locales.length; i++) {
+ String lang = "Language: "+installed_locales[i].Language +
+ ", Country: "+ installed_locales[i].Country +
+ ", Variant: "+ installed_locales[i].Country;
+ oObj.loadCalendar(calendars[i][0], installed_locales[i]);
+ String uID = oObj.getUniqueID();
+ if (uID.equals(calendars[i][0])) {
+ //log.println(lang + " ... OK");
+ } else {
+ log.println(lang + " ... FAILED");
+ }
+ res &= uID.equals(calendars[i][0]);
+ }
+
+ tRes.tested("getUniqueID()",res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns value, that's equal to
+ * value set before. <p>
+ */
+
+ public void _setDateTime() {
+ boolean res = true;
+ for (int i=0; i<installed_locales.length; i++) {
+ String lang = "Language: "+installed_locales[i].Language +
+ ", Country: "+ installed_locales[i].Country +
+ ", Variant: "+ installed_locales[i].Country;
+ oObj.setDateTime(newDTime);
+ double aDTime = oObj.getDateTime();
+ if (aDTime == newDTime) {
+ //log.println(lang + " ... OK");
+ } else {
+ log.println(lang + " ... FAILED");
+ }
+ res &= (aDTime == newDTime);
+ }
+
+ tRes.tested("setDateTime()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns value, that's equal to
+ * value set before. <p>
+ */
+
+ public void _getDateTime() {
+ boolean res = true;
+
+ for (int i=0; i<installed_locales.length; i++) {
+ String lang = "Language: "+installed_locales[i].Language +
+ ", Country: "+ installed_locales[i].Country +
+ ", Variant: "+ installed_locales[i].Country;
+ oObj.setDateTime(newDTime);
+ double aDTime = oObj.getDateTime();
+ if (aDTime == newDTime) {
+ //log.println(lang + " ... OK");
+ } else {
+ log.println(lang + " ... FAILED");
+ }
+ res &= (aDTime == newDTime);
+ }
+
+ tRes.tested("getDateTime()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns value, that's equal to
+ * value set before. <p>
+ */
+
+ public void _setValue() {
+ boolean res = true;
+ for (int i=0; i<installed_locales.length; i++) {
+ String error = "";
+ String lang = "Language: "+installed_locales[i].Language +
+ ", Country: "+ installed_locales[i].Country +
+ ", Variant: "+ installed_locales[i].Country +
+ ", Name: "+calendars[i][count[i]];
+ String[] names = new String[]{"DAY_OF_MONTH",
+ "HOUR","MINUTE","SECOND","MILLISECOND",
+ "YEAR","MONTH"};
+ oObj.loadCalendar(calendars[i][count[i]],installed_locales[i]);
+ short[] fields = new short[]{CalendarFieldIndex.DAY_OF_MONTH,
+ CalendarFieldIndex.HOUR,
+ CalendarFieldIndex.MINUTE,
+ CalendarFieldIndex.SECOND,
+ CalendarFieldIndex.MILLISECOND,
+ CalendarFieldIndex.YEAR,
+ CalendarFieldIndex.MONTH
+ };
+ for (int k=0; k<fields.length;k++) {
+ //log.println("Setting: " + names[k]+" to "+ valueSet[k]);
+ oObj.setDateTime(0.0);
+ short set = oObj.getValue(fields[k]);
+ oObj.setValue(fields[k],set);
+ short get = oObj.getValue(fields[k]);
+ if (get != set) {
+ error += "failed for "+names[k]+" expected "+
+ set+" gained "+get+" ; ";
+ }
+ }
+ if (error.equals("")) {
+ //log.println(lang + " ... OK");
+ } else {
+ log.println("*** "+lang + " ... FAILED ***");
+ log.println(error);
+ }
+ res &= (error.equals(""));
+ }
+
+ tRes.tested("setValue()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns value, that's equal to
+ * value set before. <p>
+ */
+
+ public void _getValue() {
+ boolean res = true;
+
+ requiredMethod("setValue()");
+ short aValue = oObj.getValue(CalendarFieldIndex.MONTH);
+ res &= (aValue == newValue);
+ tRes.tested("getValue()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if value, added by the method is greater than
+ * previously defined "newValue".
+ * <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getValue() </code> : gets the value of a field </li>
+ * </ul>
+ */
+ public void _addValue() {
+ boolean res = true;
+
+ requiredMethod("getValue()");
+ oObj.addValue(CalendarFieldIndex.MONTH, 1);
+ short aValue = oObj.getValue(CalendarFieldIndex.MONTH);
+ res &= (aValue > newValue);
+ tRes.tested("addValue()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setFirstDayOfWeek() {
+ boolean res = true;
+
+ oObj.setFirstDayOfWeek(firstDay);
+ res &= true;
+ tRes.tested("setFirstDayOfWeek()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns value that is equal to
+ * value set before. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setFirstDayOfWeek() </code> : set the first day of a
+ * week</li>
+ * </ul>
+ */
+ public void _getFirstDayOfWeek() {
+ boolean res = true;
+
+ requiredMethod("setFirstDayOfWeek()");
+ short aFirstDayOfWeek = oObj.getFirstDayOfWeek();
+ res &= (aFirstDayOfWeek == firstDay);
+ tRes.tested("getFirstDayOfWeek()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _setMinimumNumberOfDaysForFirstWeek() {
+ boolean res = true;
+
+ oObj.setMinimumNumberOfDaysForFirstWeek(mdfw);
+ res &= true;
+ tRes.tested("setMinimumNumberOfDaysForFirstWeek()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns value that is equal to
+ * value set before. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setMinimumNumberOfDaysForFirstWeek() </code> : sets how
+ * many days of a week must reside in the first week of a year</li>
+ * </ul>
+ */
+ public void _getMinimumNumberOfDaysForFirstWeek() {
+ boolean res = true;
+
+ requiredMethod("setMinimumNumberOfDaysForFirstWeek()");
+ short aShort = oObj.getMinimumNumberOfDaysForFirstWeek();
+ res &= (aShort == mdfw);
+ tRes.tested("getMinimumNumberOfDaysForFirstWeek()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns 12.
+ */
+ public void _getNumberOfMonthsInYear() {
+ boolean res = true;
+ short aShort = oObj.getNumberOfMonthsInYear();
+
+ res &= (aShort == (short) 12);
+ tRes.tested("getNumberOfMonthsInYear()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns 7.
+ */
+ public void _getNumberOfDaysInWeek() {
+ boolean res = true;
+ short aShort = oObj.getNumberOfDaysInWeek();
+
+ res &= (aShort == (short) 7);
+ tRes.tested("getNumberOfDaysInWeek()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if length of array, returned by the method is 12.
+ */
+ public void _getMonths() {
+ boolean res = true;
+ CalendarItem[] months = oObj.getMonths();
+
+ res &= (months.length == 12);
+ tRes.tested("getMonths()", res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if length of array, returned by the method is 7.
+ */
+ public void _getDays() {
+ boolean res = true;
+ CalendarItem[] Days = oObj.getDays();
+
+ res &= (Days.length == 7);
+ tRes.tested("getDays()", res);
+ }
+
+ /**
+ * After loading calendar, test calls the method, then result is checked.<p>
+ * Has <b> OK </b> status if length of string, returned by the method is 3.
+ */
+ public void _getDisplayName() {
+ boolean res = true;
+
+ oObj.loadCalendar(calendars[0][0],installed_locales[0]);
+ String DisplayName = oObj.getDisplayName(CalendarDisplayIndex.MONTH,
+ newValue, (short) 0);
+ res &= (DisplayName.length() == 3);
+ tRes.tested("getDisplayName()", res);
+ }
+
+
+ /**
+ * The test sets obviously wrong value, then calls a method. After that the
+ * test sets correct value, and again calls a method. <p>
+ * Has <b> OK </b> status if the method returns true when valid month is
+ * set, and if the method returns false when set month is not valid.
+ */
+ public void _isValid() {
+ boolean res = true;
+
+ oObj.setValue(CalendarFieldIndex.MONTH, (short) 37);
+ res &= !oObj.isValid();
+ oObj.setValue(CalendarFieldIndex.MONTH, (short) 10);
+ res &= oObj.isValid();
+
+ tRes.tested("isValid()", res);
+ }
+
+ /**
+ * Method returns locale for a given language and country.
+ * @param localeIndex index of needed locale.
+ */
+/* public Locale getLocale(int localeIndex) {
+ return new Locale(languages[localeIndex], countries[localeIndex], "");
+ }*/
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/i18n/_XCharacterClassification.java b/qadevOOo/tests/java/ifc/i18n/_XCharacterClassification.java
new file mode 100644
index 000000000000..6cad655e5f54
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/i18n/_XCharacterClassification.java
@@ -0,0 +1,447 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCharacterClassification.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.i18n;
+
+import com.sun.star.i18n.KParseTokens;
+import com.sun.star.i18n.KParseType;
+import com.sun.star.i18n.ParseResult;
+import com.sun.star.i18n.XCharacterClassification;
+import com.sun.star.lang.Locale;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.i18n.XCharacterClassification</code>
+* interface methods:
+* <ul>
+* <li><code> toUpper() </code></li>
+* <li><code> toLower() </code></li>
+* <li><code> toTitle() </code></li>
+* <li><code> getType() </code></li>
+* <li><code> getCharacterType() </code></li>
+* <li><code> getStringType() </code></li>
+* <li><code> getCharacterDirection() </code></li>
+* <li><code> getScript() </code></li>
+* <li><code> parseAnyToken() </code></li>
+* <li><code> parsePredefinedToken() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.i18n.XCharacterClassification
+*/
+public class _XCharacterClassification extends MultiMethodTest {
+ public XCharacterClassification oObj = null;
+ public String[] languages = new String[]{"de","en","es","fr","ja","ko","zh"};
+ public String[] countries = new String[]{"DE","US","ES","FR","JP","KR","CN"};
+
+ public String[] charstyles_java = new String[] {"UNASSIGNED","UPPERCASE_LETTER",
+ "LOWERCASE_LETTER","TITLECASE_LETTER","MODIFIER_LETTER","OTHER_LETTER",
+ "NON_SPACING_MARK","ENCLOSING_MARK","COMBINING_SPACING_MARK",
+ "DECIMAL_DIGIT_NUMBER","LETTER_NUMBER","OTHER_NUMBER","SPACE_SEPARATOR",
+ "LINE_SEPARATOR","PARAGRAPH_SEPARATOR","CONTROL","FORMAT","none17",
+ "PRIVATE_USE","none19","DASH_PUNCTUATION","START_PUNCTUATION","END_PUNCTUATION",
+ "CONNECTOR_PUNCTUATION","OTHER_PUNCTUATION","MATH_SYMBOL","CURRENCY_SYMBOL",
+ "MODIFIER_SYMBOL","OTHER_SYMBOL"};
+
+ public String[] charstyles_office = new String[] {"UNASSIGNED","UPPERCASE_LETTER",
+ "LOWERCASE_LETTER","TITLECASE_LETTER","MODIFIER_LETTER","OTHER_LETTER",
+ "NON_SPACING_MARK","ENCLOSING_MARK","COMBINING_SPACING_MARK",
+ "DECIMAL_DIGIT_NUMBER","LETTER_NUMBER","OTHER_NUMBER","SPACE_SEPARATOR",
+ "LINE_SEPARATOR","PARAGRAPH_SEPARATOR","CONTROL","FORMAT","PRIVATE_USE",
+ "SURROGATE","DASH_PUNCTUATION","START_PUNCTUATION","END_PUNCTUATION",
+ "CONNECTOR_PUNCTUATION",
+ "OTHER_PUNCTUATION","MATH_SYMBOL","CURRENCY_SYMBOL","MODIFIER_SYMBOL",
+ "OTHER_SYMBOL","INITIAL_PUNCTUATION","FINAL_PUNCTUATION","GENERAL_TYPES_COUNT"};
+
+ public String[] unicode_script = new String[] {"U_BASIC_LATIN","U_LATIN_1_SUPPLEMENT",
+ "U_LATIN_EXTENDED_A","U_LATIN_EXTENDED_B","U_IPA_EXTENSIONS","U_SPACING_MODIFIER_LETTERS",
+ "U_COMBINING_DIACRITICAL_MARKS","U_GREEK","U_CYRILLIC","U_ARMENIAN","U_HEBREW",
+ "U_ARABIC","U_SYRIAC","U_THAANA","U_DEVANAGARI","U_BENGALI","U_GURMUKHI",
+ "U_GUJARATI","U_ORIYA","U_TAMIL","U_TELUGU","U_KANNADA","U_MALAYALAM",
+ "U_SINHALA","U_THAI","U_LAO","U_TIBETAN","U_MYANMAR","U_GEORGIAN",
+ "U_HANGUL_JAMO","U_ETHIOPIC","U_CHEROKEE","U_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS",
+ "U_OGHAM","U_RUNIC","U_KHMER","U_MONGOLIAN","U_LATIN_EXTENDED_ADDITIONAL",
+ "U_GREEK_EXTENDED","U_GENERAL_PUNCTUATION","U_SUPERSCRIPTS_AND_SUBSCRIPTS",
+ "U_CURRENCY_SYMBOLS","U_COMBINING_MARKS_FOR_SYMBOLS","U_LETTERLIKE_SYMBOLS",
+ "U_NUMBER_FORMS","U_ARROWS","U_MATHEMATICAL_OPERATORS","U_MISCELLANEOUS_TECHNICAL",
+ "U_CONTROL_PICTURES","U_OPTICAL_CHARACTER_RECOGNITION","U_ENCLOSED_ALPHANUMERICS",
+ "U_BOX_DRAWING","U_BLOCK_ELEMENTS","U_GEOMETRIC_SHAPES","U_MISCELLANEOUS_SYMBOLS",
+ "U_DINGBATS","U_BRAILLE_PATTERNS","U_CJK_RADICALS_SUPPLEMENT","U_KANGXI_RADICALS",
+ "U_IDEOGRAPHIC_DESCRIPTION_CHARACTERS","U_CJK_SYMBOLS_AND_PUNCTUATION",
+ "U_HIRAGANA","U_KATAKANA","U_BOPOMOFO","U_HANGUL_COMPATIBILITY_JAMO","U_KANBUN",
+ "U_BOPOMOFO_EXTENDED","U_ENCLOSED_CJK_LETTERS_AND_MONTHS","U_CJK_COMPATIBILITY",
+ "U_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A","U_CJK_UNIFIED_IDEOGRAPHS","U_YI_SYLLABLES",
+ "U_YI_RADICALS","U_HANGUL_SYLLABLES","U_HIGH_SURROGATES","U_HIGH_PRIVATE_USE_SURROGATES",
+ "U_LOW_SURROGATES","U_PRIVATE_USE_AREA","U_CJK_COMPATIBILITY_IDEOGRAPHS",
+ "U_ALPHABETIC_PRESENTATION_FORMS","U_ARABIC_PRESENTATION_FORMS_A","U_COMBINING_HALF_MARKS",
+ "U_CJK_COMPATIBILITY_FORMS","U_SMALL_FORM_VARIANTS","U_ARABIC_PRESENTATION_FORMS_B",
+ "U_SPECIALS","U_HALFWIDTH_AND_FULLWIDTH_FORMS","U_CHAR_SCRIPT_COUNT","U_NO_SCRIPT"};
+
+ /**
+ * Test calls the method for different locales. Then each result is compared
+ * with a string, converted to a upper case using
+ * <code>java.lang.String</code> method <code>toUpperCase()</code>.<p>
+ * Has <b> OK </b> status if string, returned by the method is equal to
+ * a string that is returned by String.toUpperCase() for all locales.
+ */
+ public void _toUpper() {
+ boolean res = true;
+ String toCheck = "abcD\\@~)??";
+ String get = "";
+ String exp = "";
+
+ for (int i=0;i<7;i++) {
+ get = oObj.toUpper(toCheck, 0, toCheck.length(), getLocale(i));
+ exp = toCheck.toUpperCase(
+ new java.util.Locale(languages[i], countries[i]));
+ res &= get.equals(exp);
+ if (!res) {
+ log.println("FAILED for: language=" + languages[i] +
+ " ; country=" + countries[i]);
+ log.println("Expected: " + exp);
+ log.println("Gained : " + get);
+ }
+ }
+ tRes.tested("toUpper()", res);
+ }
+
+ /**
+ * Test calls the method for different locales. Then each result is compared
+ * with a string, converted to a lower case using
+ * <code>java.lang.String</code> method <code>toLowerCase()</code>.<p>
+ * Has <b> OK </b> status if string, returned by the method is equal to
+ * a string that is returned by String.toLowerCase() for all locales.
+ */
+ public void _toLower() {
+ boolean res = true;
+ String toCheck = "QWER\\@~)??TZ";
+ String get = "";
+ String exp = "";
+
+ for (int i=0;i<7;i++) {
+ get = oObj.toLower(toCheck,0,toCheck.length(),getLocale(i));
+ exp = toCheck.toLowerCase(
+ new java.util.Locale(languages[i],countries[i]));
+ res &= get.equals(exp);
+ if (!res) {
+ log.println("FAILED for: language=" + languages[i]
+ + " ; country=" + countries[i]);
+ log.println("Expected: " + exp);
+ log.println("Gained : " + get);
+ }
+ }
+ tRes.tested("toLower()", res);
+ }
+
+ /**
+ * Test calls the method for different locales. Then each result is compared
+ * with a string, converted to a title case using
+ * <code>java.lang.Character</code> method <code>toTitleCase()</code>.<p>
+ * Has <b> OK </b> status if string, returned by the method is equal to
+ * a string that was converted using Character.toTitleCase() for all locales.
+ */
+ public void _toTitle() {
+ boolean res = true;
+ String toCheck = new String(new char[]{8112});
+ String get = "";
+ String exp = "";
+
+ for (int i=0;i<7;i++) {
+ get = oObj.toTitle(toCheck, 0, 1, getLocale(i));
+ exp = new String(
+ new char[]{Character.toTitleCase(toCheck.toCharArray()[0])});
+ res &= get.equals(exp);
+ if (!res) {
+ log.println("FAILED for: language=" + languages[i]
+ + " ; country=" + countries[i]);
+ log.println("Expected: " + exp);
+ log.println("Gained : " + get);
+ }
+ }
+ tRes.tested("toTitle()", res);
+ }
+
+ /**
+ * At first we define <code>int[]</code> and <code>char[]</code> arrays of
+ * unicode symbol numbers, arranged as sequences, where symbols are sorted
+ * by type, so the character of <code>i<sup><small>th</small></sup></code>
+ * type is located on <code>i<sup><small>th</small></sup></code> position.<p>
+ * Has <b> OK </b> status if for all 30 types the method returns value, that
+ * is equal to an element number.<p>
+ * @see com.sun.star.i18n.CharType
+ */
+ public void _getType() {
+ boolean res = true;
+ char[] characters = new char[]{586,65,97,498,721,4588,772,8413,3404,
+ 48,8544,179,32,8232,8233,144,8204,57344,56320,173,40,41,95,3852,247,
+ 3647,901,3896,171,187};
+ int[] charsInt = new int[]{586,65,97,498,721,4588,772,8413,3404,48,
+ 8544,179,32,8232,8233,144,8204,57344,56320,173,40,41,95,3852,247,
+ 3647,901,3896,171,187};
+ String toCheck = new String(characters);
+
+ for (int i=0;i<characters.length;i++) {
+ int get = oObj.getType(toCheck, i);
+ res &= (get == i);
+ if (!res) {
+ log.println("Code :" + Integer.toHexString(charsInt[i]));
+ log.println("Gained: " + charstyles_office[get]);
+ log.println("Expected : " + charstyles_office[i]);
+ }
+ }
+ tRes.tested("getType()", res);
+ }
+
+ /**
+ * After defining string to be checked and array of expected types, test
+ * calls the method for each character of a string and for all locales.<p>
+ * Has <b> OK </b> status if the method returns type, expected for a given
+ * character and locale.
+ */
+ public void _getCharacterType() {
+ boolean res = true;
+ String toCheck = "Ab0)";
+ int[] expected = new int[]{226,228,97,32};
+
+ for (int i=0;i<toCheck.length();i++) {
+ for (int j=1;j<7;j++) {
+ int get = oObj.getCharacterType(toCheck, i, getLocale(j));
+ res &= (get == expected[i]);
+ if (!res) {
+ log.println("FAILED for: language=" + languages[j] +
+ " ; country=" + countries[j]);
+ log.println("Sysmbol :" + toCheck.toCharArray()[i]);
+ log.println("Gained: " + get);
+ log.println("Expected : " + expected[i]);
+ }
+ }
+ }
+ tRes.tested("getCharacterType()", res);
+ }
+
+ /**
+ * After defining array of strings to be checked and array of expected types,
+ * test calls the method for each string of an array and for all locales.<p>
+ * Has <b> OK </b> status if the method returns type, expected for a given
+ * string and locale.
+ */
+ public void _getStringType() {
+ boolean res = true;
+ String[] toCheck = new String[]{"01234","AAAAA","bbbbb","AA()bb"};
+ int[] exp = new int[]{97,226,228,230};
+
+ for (int j=0;j<toCheck.length;j++) {
+ for (int i=0;i<7;i++) {
+ int get = oObj.getStringType(toCheck[j], 0,
+ toCheck[j].length(), getLocale(i));
+ res &= (get == exp[j]);
+ if (!res) {
+ log.println("FAILED for: language=" + languages[i] +
+ " ; country=" + countries[i]);
+ log.println("Expected: " + exp[j]);
+ log.println("Gained : " + get);
+ }
+ }
+ }
+ tRes.tested("getStringType()", res);
+ }
+
+ /**
+ * After string to be checked is initialized (all symbols are sorted
+ * by direction, so the character of <code>i<sup><small>th</small></sup></code>
+ * direction is located on <code>i<sup><small>th</small></sup></code>
+ * position), test calls the method for every character of that string. <p>
+ * Has <b> OK </b> status if the method returns direction, that's equal to
+ * a symbol position in the string.
+ */
+ public void _getCharacterDirection() {
+ boolean res = true;
+ String toCheck = new String(new char[]{65,1470,48,47,35,1632,44,10,
+ 9,12,33,8234,8237,1563,8235,8238,8236,768,1});
+ for (short i=0;i<19;i++) {
+ short get = oObj.getCharacterDirection(toCheck, i);
+ res &= (get == i);
+ if (!res) {
+ log.println("Code :" + toCheck.toCharArray()[i]);
+ log.println("Gained: " + get);
+ log.println("Expected: " + i);
+ }
+ }
+ tRes.tested("getCharacterDirection()", res);
+ }
+
+ /**
+ * At first we define <code>int[]</code> and <code>char[]</code> arrays of
+ * unicode symbol numbers, arranged as sequences, where symbols are sorted
+ * by type, so the character of <code>i<sup><small>th</small></sup></code>
+ * type is located on <code>i<sup><small>th</small></sup></code> position.<p>
+ * Has <b> OK </b> status if for each character method returns value, that
+ * is equal to a number where element is located in array. Also method has
+ * <b> OK </b> status for symbol with code 55296, because it doesn't work
+ * since it hasn't the right neighborhood.<p>
+ * @see http://ppewww.ph.gla.ac.uk/~flavell/unicode/unidata.html
+ */
+ public void _getScript() {
+ boolean res = true;
+ char[] characters = new char[]{65,128,256,384,592,750,773,924,1030,1331,1448,
+ 1569,1792,1936,2313,2465,2570,2707,2822,2972,3079,3240,3337,3464,3590,
+ 3745,3906,4097,4274,4357,4621,5040,5200,5776,5806,6030,6155,7683,7943,
+ 8202,8319,8352,8413,8452,8545,8616,8715,8965,9217,9281,9336,9474,9608,9719,
+ 9734,9999,10247,11911,12034,12274,12294,12358,12456,12552,12605,12688,12727,
+ 12806,13065,13312,19968,40964,42152,44032,55296,56192,56320,57344,63744,
+ 64257,64370,65056,65073,65131,65146,65532,65288};
+ int[] charsInt = new int[]{65,128,256,384,592,750,773,924,1030,1331,1448,
+ 1569,1792,1936,2313,2465,2570,2707,2822,2972,3079,3240,3337,3464,3590,
+ 3745,3906,4097,4274,4357,4621,5040,5200,5776,5806,6030,6155,7683,7943,
+ 8202,8319,8352,8413,8452,8545,8616,8715,8965,9217,9281,9336,9474,9608,9719,
+ 9734,9999,10247,11911,12034,12274,12294,12358,12456,12552,12605,12688,12727,
+ 12806,13065,13312,19968,40964,42152,44032,55296,56192,56320,57344,63744,
+ 64257,64370,65056,65073,65131,65146,65532,65288};
+ String toCheck = new String(characters);
+
+ for (int i=0;i<characters.length;i++) {
+ int get = oObj.getScript(toCheck, i);
+ res &= (get == i);
+ //The HIGH_SURROGATE 55296 doesn't work since it hasn't the right
+ //neighborhood
+ if (toCheck.substring(i, i + 1).hashCode() == 55296) res = true;
+ if (!res) {
+ log.println("-- " + toCheck.substring(i, i + 1).hashCode());
+ log.println("Code: " + Integer.toHexString(charsInt[i]));
+ log.println("Gained: " + unicode_script[get]);
+ log.println("Expected: " + unicode_script[i]);
+ }
+ }
+ tRes.tested("getScript()", res);
+ }
+
+ /**
+ * After defining a string to be parsed and parse conditions (flags), test
+ * calls the method for different locales three times with different parameters,
+ * checking result after every call. <p>
+ * Has <b> OK </b> status if the method returns right results all three
+ * times.
+ */
+ public void _parseAnyToken() {
+ int nStartFlags = KParseTokens.ANY_ALPHA | KParseTokens.ASC_UNDERSCORE;
+ int nContFlags = KParseTokens.ANY_ALNUM | KParseTokens.ASC_UNDERSCORE
+ | KParseTokens.ASC_DOT;
+ String toCheck = " 18 i18n ^";
+ ParseResult pRes = null;
+ boolean res = true;
+
+ for (int i=0;i<7;i++) {
+ pRes = oObj.parseAnyToken(toCheck, 1, getLocale(i),
+ nStartFlags, "", nContFlags, "");
+ res = ( (pRes.CharLen==2)
+ && (pRes.TokenType==32)
+ && (pRes.Value==18.0) );
+ pRes = oObj.parseAnyToken(toCheck, 4, getLocale(i),
+ nStartFlags, "", nContFlags, "");
+ res &= ( (pRes.CharLen==4)
+ && (pRes.TokenType==4)
+ && (pRes.Value==0.0) );
+ pRes = oObj.parseAnyToken(toCheck, 9, getLocale(i),
+ nStartFlags, "", nContFlags, "");
+ res &= ( (pRes.CharLen==1)
+ && (pRes.TokenType==1)
+ && (pRes.Value==0.0) );
+ }
+ tRes.tested("parseAnyToken()", res);
+ }
+
+ /**
+ * After defining a string to be parsed and parse conditions (flags), test
+ * calls the method for different locales two times with different parameters,
+ * checking result after every call. <p>
+ * Has <b> OK </b> status if the method returns right results.
+ */
+ public void _parsePredefinedToken() {
+ int nStartFlags = KParseTokens.ANY_ALPHA | KParseTokens.ASC_UNDERSCORE;
+ int nContFlags = nStartFlags;
+ String toCheck = " 18 int";
+ ParseResult pRes = null;
+ boolean res = true;
+
+ for (int i=0;i<7;i++) {
+ pRes = oObj.parsePredefinedToken(KParseType.IDENTNAME, toCheck,
+ 1, getLocale(i), nStartFlags, "", nContFlags, "");
+ res = (pRes.CharLen==0);
+ pRes = oObj.parsePredefinedToken(KParseType.IDENTNAME, toCheck,
+ 4, getLocale(i), nStartFlags, "", nContFlags, "");
+ res &= ( (pRes.CharLen==3)
+ && (pRes.TokenType==4)
+ && (pRes.Value==0.0) );
+ }
+ tRes.tested("parsePredefinedToken()", res);
+ }
+
+
+ /**
+ * Method returns locale for a given language and country.
+ * @param localeIndex index of needed locale.
+ */
+ public Locale getLocale(int k) {
+ return new Locale(languages[k],countries[k],"");
+ }
+
+
+} // end XCharacterClassification
+
diff --git a/qadevOOo/tests/java/ifc/i18n/_XCollator.java b/qadevOOo/tests/java/ifc/i18n/_XCollator.java
new file mode 100644
index 000000000000..65bff1756bae
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/i18n/_XCollator.java
@@ -0,0 +1,462 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCollator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.i18n;
+
+import com.sun.star.i18n.CollatorOptions;
+import com.sun.star.i18n.XCollator;
+import com.sun.star.lang.Locale;
+import java.text.Collator;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.i18n.XCollator</code>
+* interface methods :
+* <ul>
+* <li><code> compareSubstring()</code></li>
+* <li><code> compareString()</code></li>
+* <li><code> loadDefaultCollator()</code></li>
+* <li><code> loadCollatorAlgorithm()</code></li>
+* <li><code> listCollatorAlgorithms()</code></li>
+* <li><code> loadCollatorAlgorithmWithEndUserOption()</code></li>
+* <li><code> listCollatorOptions()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.i18n.XCollator
+*/
+public class _XCollator extends MultiMethodTest {
+ public XCollator oObj = null;
+ private String[] alg = null ;
+ private int[] opt = null ;
+ Locale loc = new Locale("en", "EN", "");
+
+ /**
+ * Just retrieves a list of algorithms. <p>
+ * Has <b>OK</b> status if non-zero length array returned.
+ */
+ public void _listCollatorAlgorithms() {
+ alg = oObj.listCollatorAlgorithms(loc) ;
+ log.println("Collator algorithms :");
+ if (alg != null) {
+ for (int i = 0; i < alg.length; i++) {
+ log.println(" '" + alg[i] + "'") ;
+ }
+ tRes.tested("listCollatorAlgorithms()", alg.length > 0) ;
+ } else {
+ tRes.tested("listCollatorAlgorithms()", false) ;
+ }
+ }
+
+ /**
+ * Just gets a list of options for some collator. <p>
+ * Has <b>OK</b> status if not null value returned.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> listCollatorAlgorithms </code> : to have some
+ * algorithm name. </li>
+ * </ul>
+ */
+ public void _listCollatorOptions() {
+ requiredMethod("listCollatorAlgorithms()") ;
+ opt = oObj.listCollatorOptions(alg[0]) ;
+ log.println("Collator '" + alg[0] + "' options :");
+ if (opt != null) {
+ for (int i = 0; i < opt.length; i++) {
+ log.println(" " + opt[i]) ;
+ }
+ tRes.tested("listCollatorOptions()", true) ;
+ } else {
+ tRes.tested("listCollatorOptions()", false) ;
+ }
+ }
+
+ /**
+ * Calls the method with no options and with options(IGNORE_CASE),
+ * compares strings.<p>
+ * Has <b>OK</b> status if compareString() returned correct values.
+ */
+ public void _loadDefaultCollator() {
+ oObj.loadDefaultCollator(loc, 0);
+ boolean res = oObj.compareString("A", "a") != 0;
+ oObj.loadDefaultCollator(loc,
+ CollatorOptions.CollatorOptions_IGNORE_CASE);
+ res &= oObj.compareString("a", "A") == 0;
+ tRes.tested("loadDefaultCollator()", res) ;
+ }
+
+ /**
+ * Calls the method with no options and with options(IGNORE_CASE),
+ * compares strings.<p>
+ * Has <b>OK</b> status if compareString() returned correct values.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> listCollatorAlgorithms </code> : to have some
+ * algorithm name. </li>
+ * </ul>
+ */
+ public void _loadCollatorAlgorithm() {
+ requiredMethod("listCollatorAlgorithms()");
+ oObj.loadCollatorAlgorithm(alg[0], loc,
+ CollatorOptions.CollatorOptions_IGNORE_CASE);
+ boolean res = oObj.compareString("A", "a") == 0;
+ oObj.loadCollatorAlgorithm(alg[0], loc, 0);
+ res &= oObj.compareString("a", "A") != 0;
+ tRes.tested("loadCollatorAlgorithm()", res);
+ }
+
+ /**
+ * Calls the method with no options and with options(IGNORE_CASE),
+ * compares strings.<p>
+ * Has <b>OK</b> status if compareString() returned correct values.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> listCollatorAlgorithms </code> : to have some
+ * algorithm name. </li>
+ * </ul>
+ */
+ public void _loadCollatorAlgorithmWithEndUserOption() {
+ requiredMethod("listCollatorAlgorithms()");
+ oObj.loadCollatorAlgorithmWithEndUserOption(alg[0], loc,
+ new int[] {0});
+ boolean res = oObj.compareString("A", "a") != 0;
+ oObj.loadCollatorAlgorithmWithEndUserOption(alg[0], loc,
+ new int[] {CollatorOptions.CollatorOptions_IGNORE_CASE});
+ res = oObj.compareString("A", "a") == 0;
+ tRes.tested("loadCollatorAlgorithmWithEndUserOption()", res);
+ }
+
+ /**
+ * Test is performed for locales : en, ru, ja, zh, ko.
+ * Default collator is loaded for each locale. Then collation
+ * is performed for different combination of symbols from range of
+ * this locale.<p>
+ * Has <b>OK</b> status if comparing of different strings
+ * returns not 0 value, then comparing in the opposite
+ * order returns value with opposite sign, and comparing
+ * of two equal strings returns 0. The such comparing is performed
+ * for one character strings.
+ */
+ public void _compareSubstring() {
+ boolean result = true ;
+ char[] chars = new char[2] ;
+ Collator col = null ;
+
+ log.println(" #### Testing English locale ####") ;
+ oObj.loadDefaultCollator(loc, 0) ;
+ col = Collator.getInstance(new java.util.Locale("en", "EN")) ;
+ for (char ch = 0x0020; ch < 0x007F; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareSubstring(chars, col) ;
+ }
+
+ log.println(" #### Testing Russian locale ####") ;
+ oObj.loadDefaultCollator(
+ new com.sun.star.lang.Locale("ru", "RU", ""), 0) ;
+ col = Collator.getInstance(new java.util.Locale("ru", "RU")) ;
+ for (char ch = 0x0410; ch < 0x0450; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareSubstring(chars, col) ;
+ }
+
+ log.println(" #### Testing Japan locale ####") ;
+ oObj.loadDefaultCollator(
+ new com.sun.star.lang.Locale("ja", "JP", ""), 0) ;
+ col = Collator.getInstance(new java.util.Locale("ja", "JP")) ;
+ for (char ch = 0x4E00; ch < 0x4EFD; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareSubstring(chars, col) ;
+ }
+
+ log.println(" #### Testing China locale ####") ;
+ oObj.loadDefaultCollator(new Locale("zh", "CN", ""), 0) ;
+ col = Collator.getInstance(new java.util.Locale("zh", "CN")) ;
+ for (char ch = 0x4E00; ch < 0x4EFD; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareSubstring(chars, col) ;
+ }
+
+ log.println(" #### Testing Korean locale ####") ;
+ oObj.loadDefaultCollator(new Locale("ko", "KR", ""), 0) ;
+ col = Collator.getInstance(new java.util.Locale("ko", "KR")) ;
+ for (char ch = 0x4E00; ch < 0x4EFD; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareSubstring(chars, col) ;
+ }
+
+ tRes.tested("compareSubstring()", result) ;
+ }
+
+ /**
+ * Test is performed for locales : en, ru, ja, zh, ko.
+ * Default collator is loaded for each locale. Then collation
+ * is performed for different combination of symbols from range of
+ * this locale.<p>
+ * Has <b>OK</b> status if comparing of different strings
+ * returns not 0 value, then comparing in the opposite
+ * order returns value with opposite sign, and comparing
+ * of two equal strings returns 0. The such comparing is performed
+ * for one character strings.
+ */
+ public void _compareString() {
+ boolean result = true ;
+ char[] chars = new char[2] ;
+ Collator col = null ;
+ log.println(" #### Testing English locale ####") ;
+ oObj.loadDefaultCollator(
+ new com.sun.star.lang.Locale("en", "EN", ""), 0) ;
+ col = Collator.getInstance(new java.util.Locale("en", "EN")) ;
+ for (char ch = 0x0020; ch < 0x007F; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareString(chars, col) ;
+ }
+
+ log.println(" #### Testing Russian locale ####") ;
+ oObj.loadDefaultCollator(
+ new com.sun.star.lang.Locale("ru", "RU", ""), 0) ;
+ col = Collator.getInstance(new java.util.Locale("ru", "RU")) ;
+ for (char ch = 0x0410; ch < 0x0450; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareString(chars, col) ;
+ }
+
+ log.println(" #### Testing Japan locale ####") ;
+ oObj.loadDefaultCollator(
+ new com.sun.star.lang.Locale("ja", "JP", ""), 0) ;
+ col = Collator.getInstance(new java.util.Locale("ja", "JP")) ;
+ for (char ch = 0x4E00; ch < 0x4EFD; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareString(chars, col) ;
+ }
+
+ log.println(" #### Testing China locale ####") ;
+ oObj.loadDefaultCollator(new Locale("zh", "CN", ""), 0) ;
+ col = Collator.getInstance(new java.util.Locale("zh", "CN")) ;
+ for (char ch = 0x4E00; ch < 0x4EFD; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareString(chars, col) ;
+ }
+
+ log.println(" #### Testing Korean locale ####") ;
+ oObj.loadDefaultCollator(new Locale("ko", "KR", ""), 0) ;
+ col = Collator.getInstance(new java.util.Locale("ko", "KR")) ;
+ for (char ch = 0x4E00; ch < 0x4EFD; ch ++) {
+ chars[0] = ch ; chars[1] = (char) (ch + 1) ;
+ result &= testCompareString(chars, col) ;
+ }
+
+ tRes.tested("compareString()", result) ;
+ }
+
+
+ /**
+ * Testing compareString() method. At first method is testing single chars
+ * comparing, then strings comparing.
+ * @param locChar sequence of at list two characters of a given locale
+ * to be used in comparing.
+ * @param col Collator for a given locale
+ * @return true if:
+ * <ol>
+ * <li> if comparing of two identical characters returns zero</li>
+ * <li> if comparing of two different characters returns non zero</li>
+ * <li> if comparing of two identical strings, composed of given chars
+ * returns zero</li>
+ * <li> if comparing of two different strings, composed of given chars
+ * returns non zero</li>
+ * </ol>
+ */
+ public boolean testCompareString(char[] locChar, Collator col) {
+ boolean result = true;
+ int res;
+ String msg = "";
+
+ String char0 = "_"+new String(new char[] {locChar[0]});
+ String char1 = "_"+new String(new char[] {locChar[1]});
+ res = oObj.compareString(char0 , char0) ;
+ if (res != 0) {
+ msg += " Testing collation of single equal characters ("
+ + toUnicode(char0) + ") ... FAILED\n" ;
+ }
+ result &= res == 0 ;
+ res = oObj.compareString(char0, char1) ;
+ if (res == 0) {
+ msg += " Testing collation of single different" +
+ " characters (" + toUnicode(char0+char1) +
+ ") ... FAILED (0 returned)\n" ;
+ msg += " Java collator returned " +
+ col.compare(char0, char1) + "\n" ;
+ result = false ;
+ } else { // opposite order - sum of results must be 0
+ res += oObj.compareString(char1, char0) ;
+ if (res != 0) {
+ msg += " Testing collation of single different" +
+ " characters (" + toUnicode(char0+char1) +
+ ") ... FAILED\n" ;
+ }
+ result &= res == 0 ;
+ }
+
+ String str1 = new String(new char[] {locChar[0], locChar[0],
+ locChar[1], locChar[1], locChar[1]}) ;
+ String str2 = new String(new char[] {locChar[0], locChar[0],
+ locChar[0], locChar[1], locChar[1]}) ;
+
+ res = oObj.compareString(str1 , str1) ;
+ if (res != 0) {
+ msg += " Testing collation of equal strings (" +
+ toUnicode(str1) + ") ... FAILED\n" ;
+ }
+ result &= res == 0 ;
+ res = oObj.compareString(str1, str2) ;
+ if (res == 0) {
+ msg += " Testing collation of different strings ((" +
+ toUnicode(str1) + "),(" + toUnicode(str2) +
+ ")) ... FAILED (0 returned)\n" ;
+ msg += " Java collator returned " +
+ col.compare(str1, str2) + "\n" ;
+ result = false ;
+ } else { // opposite order - sum of results must be
+ res += oObj.compareString(str2, str1) ;
+ if (res != 0) {
+ msg += " Testing collation of different strings ((" +
+ toUnicode(str1) + "),(" + toUnicode(str2) +
+ ")) ... FAILED\n" ;
+ }
+ result &= res == 0 ;
+ }
+
+ if (!result) {
+ log.println(msg) ;
+ }
+ return result ;
+ }
+
+
+ /**
+ * Testing compareSubstring() method. Method is testing substrings comparing.
+ * @param locChar sequence of at list two characters of a given locale
+ * to be used in comparing.
+ * @param col Collator for a given locale
+ * @return true if:
+ * <ol>
+ * <li> if comparing of two identical substrings of strings, composed
+ * of given chars returns zero</li>
+ * <li> if comparing of two different substrings of strings, composed
+ * of given chars returns non zero</li>
+ * </ol>
+ */
+ public boolean testCompareSubstring(char[] locChar, Collator col) {
+ boolean result = true ;
+ int res ;
+ String msg = "" ;
+
+ String str1 = new String(new char[] {locChar[0], locChar[0],
+ locChar[1], locChar[1], locChar[1]}) ;
+ String str2 = new String(new char[] {locChar[0], locChar[0],
+ locChar[0], locChar[1], locChar[1]}) ;
+
+ res = oObj.compareSubstring(str1, 1, 2 , str2, 2, 2) ;
+ if (res != 0) {
+ msg += " Testing collation of equal substrings (" +
+ toUnicode(str1) + ") ... FAILED\n" ;
+ }
+ result &= res == 0 ;
+ res = oObj.compareSubstring(str1, 1, 2, str2, 1, 2) ;
+ if (res == 0) {
+ msg += " Testing collation of different strings ((" +
+ toUnicode(str1.substring(1, 3)) + "),(" +
+ toUnicode(str2.substring(1, 3))
+ + ")) ... FAILED (0 returned)\n" ;
+ msg += " Java collator returned " + col.compare
+ (str1.substring(1, 3), str2.substring(1, 3)) + "\n" ;
+ result = false ;
+ } else { // opposite order - sum of results must be
+ res += oObj.compareSubstring(str2, 1, 2, str1, 1, 2) ;
+ if (res != 0) {
+ msg += " Testing collation of different strings ((" +
+ toUnicode(str1) + "),(" + toUnicode(str2) +
+ ")) ... FAILED\n" ;
+ }
+ result &= res == 0 ;
+ }
+
+ if (!result) {
+ log.println(msg) ;
+ }
+ return result ;
+ }
+
+
+ /**
+ * Transforms string to unicode hex codes.
+ * @param str String to be transformed
+ */
+ public String toUnicode(String str) {
+ char[] chars = str.toCharArray() ;
+ String res = "" ;
+ for (int i = 0; i < chars.length; i++) {
+ if (i != 0) res += "," ;
+ res += Integer.toHexString(chars[i]) ;
+ }
+ return res ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/i18n/_XIndexEntrySupplier.java b/qadevOOo/tests/java/ifc/i18n/_XIndexEntrySupplier.java
new file mode 100644
index 000000000000..fad641f99109
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/i18n/_XIndexEntrySupplier.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XIndexEntrySupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.i18n;
+
+import com.sun.star.i18n.XIndexEntrySupplier;
+import com.sun.star.lang.Locale;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.i18n.XIndexEntrySupplier</code>
+* interface methods:
+* <ul>
+* <li><code> getIndexCharacter() </code></li>
+* <li><code> getIndexFollowPageWord() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.i18n.XIndexEntrySupplier
+*/
+public class _XIndexEntrySupplier extends MultiMethodTest {
+ public XIndexEntrySupplier oObj = null;
+ public String[] languages = new String[]{"de","en","es","fr","ja","ko","zh"};
+ public String[] countries = new String[]{"DE","US","ES","FR","JP","KR","CN"};
+ public String[] onePage = new String[]{"f.","p."," s."," sv","p.","",""};
+ public String[] morePages = new String[]{"ff.","pp."," ss."," sv","pp.","",""};
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if the method returns right index for several
+ * locales and word.
+ */
+ public void _getIndexCharacter() {
+ boolean res = true;
+
+ for (int i=0; i<7; i++) {
+ String get = oObj.getIndexCharacter("chapter", getLocale(i), "");
+ res &= get.equals("C");
+ }
+ tRes.tested("getIndexCharacter()", res);
+ }
+
+ /**
+ * Test calls the method with two different parameters: for one page and
+ * for several pages, after every call result is checked. <p>
+ * Has <b> OK </b> status if method returns right index for several locales.
+ */
+ public void _getIndexFollowPageWord() {
+ boolean res = true;
+
+ for (int i=0; i<7; i++) {
+ String get = oObj.getIndexFollowPageWord(true, getLocale(i));
+ if (! get.equals(morePages[i]) ) {
+ log.println("Language: " + languages[i]);
+ log.println("Getting: #" + get + "#");
+ log.println("Expected: #" + morePages[i] + "#");
+ }
+ res &= get.equals(morePages[i]);
+ get = oObj.getIndexFollowPageWord(false,getLocale(i));
+ if (! get.equals(onePage[i]) ) {
+ log.println("Language: " + languages[i]);
+ log.println("Getting: #" + get + "#");
+ log.println("Expected: #" + onePage[i] + "#");
+ }
+ res &= get.equals(onePage[i]);
+ }
+ tRes.tested("getIndexFollowPageWord()", res);
+ }
+
+ /**
+ * Method returns locale for a given language and country.
+ * @param localeIndex index of needed locale.
+ * @return Locale by the index from arrays defined above
+ */
+ public Locale getLocale(int k) {
+ return new Locale(languages[k], countries[k], "");
+ }
+
+
+} // end XIndexEntrySupplier
+
diff --git a/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java b/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java
new file mode 100644
index 000000000000..659b1d8b0ca3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java
@@ -0,0 +1,531 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLocaleData.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.i18n;
+
+import com.sun.star.i18n.Calendar;
+import com.sun.star.i18n.Currency;
+import com.sun.star.i18n.ForbiddenCharacters;
+import com.sun.star.i18n.FormatElement;
+import com.sun.star.i18n.Implementation;
+import com.sun.star.i18n.LanguageCountryInfo;
+import com.sun.star.i18n.LocaleDataItem;
+import com.sun.star.i18n.XLocaleData;
+import com.sun.star.lang.Locale;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.i18n.XLocaleData</code>
+* interface methods:
+* <ul>
+* <li><code> getLanguageCountryInfo() </code></li>
+* <li><code> getLocaleItem() </code></li>
+* <li><code> getAllCalendars() </code></li>
+* <li><code> getAllCurrencies() </code></li>
+* <li><code> getAllFormats() </code></li>
+* <li><code> getCollatorImplementations() </code></li>
+* <li><code> getSearchOptions() </code></li>
+* <li><code> getCollationOptions() </code></li>
+* <li><code> getTransliterations() </code></li>
+* <li><code> getForbiddenCharacters() </code></li>
+* <li><code> getReservedWord() </code></li>
+* <li><code> getAllInstalledLocaleNames() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.i18n.XLocaleData
+*/
+public class _XLocaleData extends MultiMethodTest {
+ public XLocaleData oObj = null;
+ public String[] languages = new String[]{"de","en","es","fr","ja","ko","ko"};
+ public String[] countries = new String[]{"DE","US","ES","FR","JP","KR","KR"};
+
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if structure, returned by the method includes
+ * correct values of fields 'Language' and 'Country' for all given locales.
+ */
+ public void _getLanguageCountryInfo() {
+ boolean res = true;
+ LanguageCountryInfo lci = null;
+
+ for (int i=0;i<7;i++) {
+ lci = oObj.getLanguageCountryInfo(getLocale(i));
+ /* For debug purposes
+ log.println("Using: language="+languages[i]+" ; country="+countries[i]);
+ log.println("Getting: ");
+ log.println("\t Language="+lci.Language);
+ log.println("\t LanguageDefaultName="+lci.LanguageDefaultName);
+ log.println("\t Country="+lci.Country);
+ log.println("\t CountryDefaultName="+lci.CountryDefaultName);
+ boolean lang = ( lci.Language.equals(languages[i]) );
+ if (!lang) log.println("getting false for language: "+lci.LanguageDefaultName);
+ lang = ( lci.Country.equals(countries[i]) );
+ if (!lang) log.println("getting false for country: "+lci.CountryDefaultName);
+ */
+ res &= ( ( lci.Language.equals(languages[i]) ) && ( lci.Country.equals(countries[i]) ) );
+ }
+ tRes.tested("getLanguageCountryInfo()",res);
+ }
+
+ /**
+ * Test calls the method, then result is checked. <p>
+ * Has <b> OK </b> status if structure, returned by the method consists of
+ * non empty strings for all given locales.
+ */
+ public void _getLocaleItem() {
+ boolean res = true;
+ LocaleDataItem ldi = null;
+
+ for (int i=0;i<7;i++) {
+ ldi = oObj.getLocaleItem(getLocale(i));
+
+ boolean locRes = true ;
+
+ locRes &= (! ldi.dateSeparator.equals(""));
+ locRes &= (! ldi.decimalSeparator.equals(""));
+ locRes &= (! ldi.doubleQuotationEnd.equals(""));
+ locRes &= (! ldi.doubleQuotationStart.equals(""));
+ locRes &= (! ldi.listSeparator.equals(""));
+ locRes &= (! ldi.LongDateDayOfWeekSeparator.equals(""));
+ locRes &= (! ldi.LongDateDaySeparator.equals(""));
+ locRes &= (! ldi.LongDateMonthSeparator.equals(""));
+ locRes &= (! ldi.LongDateYearSeparator.equals(""));
+ locRes &= (! ldi.measurementSystem.equals(""));
+ locRes &= (! ldi.quotationEnd.equals(""));
+ locRes &= (! ldi.quotationStart.equals(""));
+ locRes &= (! ldi.thousandSeparator.equals(""));
+ locRes &= (! ldi.time100SecSeparator.equals(""));
+ locRes &= (! ldi.timeAM.equals(""));
+ locRes &= (! ldi.timePM.equals(""));
+ locRes &= (! ldi.timeSeparator.equals(""));
+ locRes &= (! ldi.unoID.equals(""));
+
+ if (!locRes) {
+ /* for debugging puposes
+ log.println("FAILED for: language="+languages[i]+" ; country="+countries[i]);
+ log.println("Getting: ");
+ log.println("\t DateSeparator="+ldi.dateSeparator);
+ log.println("\t decimalSeparator="+ldi.decimalSeparator);
+ log.println("\t doubleQuotationEnd="+ldi.doubleQuotationEnd);
+ log.println("\t doubleQuotationStart="+ldi.doubleQuotationStart);
+ log.println("\t listSeparator="+ldi.listSeparator);
+ log.println("\t LongDateDayOfWeekSeparator="+ldi.LongDateDayOfWeekSeparator+"end");
+ log.println("\t LongDateDaySeparator="+ldi.LongDateDaySeparator+"end");
+ log.println("\t LongDateMonthSeparator="+ldi.LongDateMonthSeparator+"end");
+ log.println("\t LongDateYearSeparator="+ldi.LongDateYearSeparator+"end");
+ log.println("\t measurementSystem="+ldi.measurementSystem);
+ log.println("\t quotationEnd="+ldi.quotationEnd);
+ log.println("\t quotationStart="+ldi.quotationStart);
+ log.println("\t thousandSeparator="+ldi.thousandSeparator);
+ log.println("\t time100SecSeparator="+ldi.time100SecSeparator);
+ log.println("\t timeAM="+ldi.timeAM);
+ log.println("\t timePM="+ldi.timePM);
+ log.println("\t timeSeparator="+ldi.timeSeparator);
+ log.println("\t unoID="+ldi.unoID);
+ */
+ }
+ }
+ tRes.tested("getLocaleItem()",res);
+ }
+
+ /**
+ * Test calls the method for several locales; result is checked
+ * after each call. <p>
+ * Has <b> OK </b> status if all elements of the returned sequence are
+ * correct for all given locales. (boolean method goodCalendar() with a
+ * calendar as an argument returns true)
+ */
+ public void _getAllCalendars() {
+ boolean res = true;
+ boolean printit = false;
+ Calendar[] calendar = new Calendar[1];
+
+ for (int i=0;i<7;i++) {
+ calendar = oObj.getAllCalendars(getLocale(i));
+ for (int j=0;j<calendar.length;j++) {
+ if (! goodCalendar(calendar[j]) ) {
+ printit = true;
+ }
+ res &= goodCalendar(calendar[j]);
+ }
+ if (printit) log.println("FAILED for: language="+languages[i]+" ; country="+countries[i]);
+ printit = false;
+ }
+ tRes.tested("getAllCalendars()", res);
+ }
+
+ /**
+ * Test calls the method for several locales; result is checked
+ * after each call. <p>
+ * Has <b> OK </b> status if all elements of the returned sequence are
+ * correct for all given locales. (boolean method goodCurrency() with a
+ * currency as an argument returns true)
+ */
+ public void _getAllCurrencies() {
+ boolean res = true;
+ boolean printit = false;
+ Currency[] currency = new Currency[1];
+
+ for (int i=0;i<7;i++) {
+ currency = oObj.getAllCurrencies(getLocale(i));
+ for (int j=0;j<currency.length;j++) {
+ if (! goodCurrency(currency[j]) ) {
+ printit=true;
+ }
+ res &= goodCurrency(currency[j]);
+ }
+ if (printit) log.println("FAILED for: language="+languages[i]+" ; country="+countries[i]);
+ printit =false;
+ }
+ tRes.tested("getAllCurrencies()",res);
+ }
+
+ /**
+ * Test calls the method for several locales; result is checked
+ * after each call. <p>
+ * Has <b> OK </b> status if all elements of the returned sequence are
+ * correct for all given locales. (boolean method goodFormat() with a
+ * format as an argument returns true)
+ */
+ public void _getAllFormats() {
+ boolean res = true;
+ boolean printit = false;
+ FormatElement[] format = new FormatElement[1];
+
+ for (int i=0;i<7;i++) {
+ format = oObj.getAllFormats(getLocale(i));
+ for (int j=0;j<format.length;j++) {
+ if (! goodFormat(format[j]) ) {
+ printit = true;
+ }
+ res &= goodFormat(format[j]);
+ }
+ if (printit) log.println("FAILED for: language="+languages[i]+" ; country="+countries[i]);
+ printit =false;
+ }
+ tRes.tested("getAllFormats()",res);
+ }
+
+ /**
+ * Test calls the method for several locales; result is checked
+ * after each call. <p>
+ * Has <b> OK </b> status if all structs, returned by the method have non
+ * empty field 'UnoID' for all given locales.
+ */
+ public void _getCollatorImplementations() {
+ boolean res = true;
+ boolean printit = false;
+ Implementation[] impl = new Implementation[1];
+
+ for (int i=0;i<7;i++) {
+ impl = oObj.getCollatorImplementations(getLocale(i));
+ for (int j=0;j<impl.length;j++) {
+ if ((impl[j].unoID.equals(""))) {
+ printit = true;
+ }
+ res &= (!impl[j].unoID.equals(""));
+ }
+ if (printit) log.println("FAILED for: language=" + languages[i]
+ + " ; country=" + countries[i]);
+ printit = false;
+ }
+ tRes.tested("getCollatorImplementations()", res);
+ }
+
+ /**
+ * Test calls the method for several locales; result is checked
+ * after each call. <p>
+ * Has <b> OK </b> status if all strings, returned by the method are not
+ * empty for all given locales.
+ */
+ public void _getSearchOptions() {
+ boolean res = true;
+ boolean printit = false;
+ String[] str = new String[1];
+
+ for (int i=0;i<7;i++) {
+ str = oObj.getSearchOptions(getLocale(i));
+ for (int j=0;j<str.length;j++) {
+ if ((str[j].equals(""))) {
+ printit = true;
+ }
+ res &= (!str.equals(""));
+ }
+ if (printit) log.println("FAILED for: language=" + languages[i]
+ + " ; country=" + countries[i]);
+ printit = false;
+ }
+ tRes.tested("getSearchOptions()",res);
+ }
+
+ /**
+ * Test calls the method for several locales; result is checked
+ * after each call. <p>
+ * Has <b> OK </b> status if all strings, returned by the method are not
+ * empty for all given locales.
+ */
+ public void _getCollationOptions() {
+ boolean res = true;
+ boolean printit = false;
+ String[] str = new String[1];
+
+ for (int i=0;i<7;i++) {
+ str = oObj.getCollationOptions(getLocale(i));
+ for (int j=0;j<str.length;j++) {
+ if ((str[j].equals(""))) {
+ printit = true;
+ }
+ res &= (!str.equals(""));
+ }
+ if (printit) log.println("FAILED for: language=" + languages[i]
+ + " ; country=" + countries[i]);
+ printit = false;
+ }
+ tRes.tested("getCollationOptions()", res);
+ }
+
+ /**
+ * Test calls the method for several locales; result is checked
+ * after each call. <p>
+ * Has <b> OK </b> status if all strings, returned by the method are not
+ * empty for all given locales.
+ */
+ public void _getTransliterations() {
+ boolean res = true;
+ boolean printit = false;
+ String[] str = new String[1];
+
+ for (int i=0;i<7;i++) {
+ str = oObj.getTransliterations(getLocale(i));
+ for (int j=0;j<str.length;j++) {
+ if ((str[j].equals(""))) {
+ printit = true;
+ }
+ res &= (!str.equals(""));
+ }
+ if (printit) log.println("FAILED for: language=" + languages[i]
+ + " ; country=" + countries[i]);
+ printit = false;
+ }
+ tRes.tested("getTransliterations()", res);
+ }
+
+ /**
+ * Test calls the method for several locales; result is checked
+ * after each call. <p>
+ * Has <b> OK </b> status if the method returns structure with non-empty
+ * fields for all given locales.
+ */
+ public void _getForbiddenCharacters() {
+ boolean res = true;
+ boolean printit = false;
+ ForbiddenCharacters fc = null;
+
+ //the forbidden characters are only available for the asian languages
+ for (int i=4;i<7;i++) {
+ fc = oObj.getForbiddenCharacters(getLocale(i));
+ res &= !( fc.beginLine.equals("") || fc.endLine.equals("") );
+ if ( !res ) {
+ log.println("FAILED for: language="+languages[i]+" ; country="+countries[i]);
+ }
+ }
+ tRes.tested("getForbiddenCharacters()", res);
+ }
+
+
+ /**
+ * Test calls the method for several locales; result is checked
+ * after each call. <p>
+ * Has <b> OK </b> status if all strings, returned by the method are not
+ * empty for all given locales.
+ */
+ public void _getReservedWord() {
+ boolean res = true;
+ boolean printit = false;
+ String[] str = new String[1];
+
+ for (int i=0;i<7;i++) {
+ str = oObj.getReservedWord(getLocale(i));
+ for (int j=0;j<str.length;j++) {
+ if ((str[j].equals(""))) {
+ printit = true;
+ }
+ res &= (!str.equals(""));
+ }
+ if (printit) log.println("FAILED for: language=" + languages[i]
+ + " ; country=" + countries[i]);
+ printit = false;
+ }
+ tRes.tested("getReservedWord()", res);
+ }
+
+
+ /**
+ * Test calls the method. Then result is checked for all given locales.<p>
+ * Has <b> OK </b> status if locale sequence, returned by the method contains
+ * given locales.
+ */
+ public void _getAllInstalledLocaleNames() {
+ boolean res = true;
+ Locale[] locs = oObj.getAllInstalledLocaleNames();
+
+ //check if the languages used here are part of this array
+ for (int i=0;i<7;i++) {
+ res &= contains(locs, getLocale(i));
+ }
+ tRes.tested("getAllInstalledLocaleNames()",res);
+ }
+
+
+ /**
+ * Method returns locale for a given language and country.
+ * @param localeIndex index of needed locale.
+ * @return Locale by the index from arrays defined above
+ */
+ public Locale getLocale(int k) {
+ return new Locale(languages[k],countries[k],"");
+ }
+
+ /**
+ * Method checks given calendar for non empty fields.
+ * @param calendar Calendar to be checked
+ */
+ public boolean goodCalendar(Calendar calendar) {
+ boolean good = true;
+ for (int i=0;i<calendar.Days.length;i++) {
+ //log.println("Day "+i+"(AbbrevName): "+calendar.Days[i].AbbrevName);
+ good &= (! calendar.Days[i].AbbrevName.equals("") );
+ //log.println("Day "+i+"(FullName): "+calendar.Days[i].FullName);
+ good &= (! calendar.Days[i].FullName.equals("") );
+ //log.println("Day "+i+"(ID): "+calendar.Days[i].ID);
+ good &= (! calendar.Days[i].ID.equals("") );
+ }
+ for (int i=0;i<calendar.Months.length;i++) {
+ //log.println("Day "+i+"(AbbrevName): "+calendar.Months[i].AbbrevName);
+ good &= (! calendar.Months[i].AbbrevName.equals("") );
+ //log.println("Day "+i+"(FullName): "+calendar.Months[i].FullName);
+ good &= (! calendar.Months[i].FullName.equals("") );
+ //log.println("Day "+i+"(ID): "+calendar.Months[i].ID);
+ good &= (! calendar.Months[i].ID.equals("") );
+ }
+ for (int i=0;i<calendar.Eras.length;i++) {
+ //log.println("Era "+i+"(AbbrevName): "+calendar.Eras[i].AbbrevName);
+ good &= (! calendar.Eras[i].AbbrevName.equals("") );
+ //log.println("Era "+i+"(FullName): "+calendar.Eras[i].FullName);
+ good &= (! calendar.Eras[i].FullName.equals("") );
+ //log.println("Era "+i+"(ID): "+calendar.Eras[i].ID);
+ good &= (! calendar.Eras[i].ID.equals("") );
+ }
+ //log.println("Start of Week: "+calendar.StartOfWeek);
+ good &= (! calendar.StartOfWeek.equals("") );
+ //log.println("MinimumNumberOfDaysForFirstWeek: "+calendar.MinimumNumberOfDaysForFirstWeek);
+ //log.println("Default: "+calendar.Default);
+ //log.println("Name: "+calendar.Name);
+ good &= (! calendar.Name.equals("") );
+ return good;
+ }
+
+ /**
+ * Method checks given currency for non empty fields.
+ * @param currency Currency to be checked
+ */
+ public boolean goodCurrency(Currency currency) {
+ boolean good = true;
+ good &= (!currency.BankSymbol.equals(""));
+ good &= (!currency.Name.equals(""));
+ good &= (!currency.Symbol.equals(""));
+ return good;
+ }
+
+ /**
+ * Method checks given format for non empty fields.
+ * @param format Format to be checked
+ */
+ public boolean goodFormat(FormatElement format) {
+ boolean good = true;
+ good &= (!format.formatCode.equals(""));
+ good &= (!format.formatKey.equals(""));
+ good &= (!format.formatType.equals(""));
+ good &= (!format.formatUsage.equals(""));
+ return good;
+ }
+
+ /**
+ * Method checks that locale sequence contains given locale.
+ * @param locs Locale sequence
+ * @param oneLoc given locale
+ */
+ public boolean contains(Locale[] locs, Locale oneLoc) {
+ boolean cont = false;
+ for (int j=0;j<locs.length;j++) {
+ if ( (locs[j].Country.equals(oneLoc.Country)) &&
+ (locs[j].Language.equals(oneLoc.Language)) ) {
+ cont=true;
+ break;
+ }
+ }
+ if (!cont) log.println("Not contained: " + oneLoc.Language);
+ return cont;
+ }
+
+} // end XLocaleData
+
diff --git a/qadevOOo/tests/java/ifc/i18n/_XNumberFormatCode.java b/qadevOOo/tests/java/ifc/i18n/_XNumberFormatCode.java
new file mode 100644
index 000000000000..b45a367aa24c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/i18n/_XNumberFormatCode.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNumberFormatCode.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.i18n;
+
+import com.sun.star.i18n.KNumberFormatType;
+import com.sun.star.i18n.KNumberFormatUsage;
+import com.sun.star.i18n.NumberFormatCode;
+import com.sun.star.i18n.NumberFormatIndex;
+import com.sun.star.i18n.XNumberFormatCode;
+import com.sun.star.lang.Locale;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.i18n.XNumberFormatCode</code>
+* interface methods:
+* <ul>
+* <li><code> getDefault() </code></li>
+* <li><code> getFormatCode() </code></li>
+* <li><code> getAllFormatCode() </code></li>
+* <li><code> getAllFormatCodes() </code></li>
+* </ul><p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.i18n.XNumberFormatCode
+*/
+public class _XNumberFormatCode extends MultiMethodTest {
+ public XNumberFormatCode oObj = null;
+ public String[] languages = new String[]
+ {"de","en","es","fr","ko","ko","zh"};
+ public String[] countries = new String[]
+ {"DE","US","ES","FR","KR","KR","CN"};
+
+ /**
+ * Test calls the method twice with two different format types as
+ * parameters for each locale. Result is checked after every call.<p>
+ * Has <b> OK </b> status if both times returned structure's field 'Code'
+ * does not equal to empty string.
+ */
+ public void _getDefault() {
+ boolean res = true;
+ NumberFormatCode nfc = null;
+
+ for (int i=0;i<7;i++) {
+ nfc = oObj.getDefault(KNumberFormatType.SHORT,
+ KNumberFormatUsage.DATE, getLocale(i));
+ String str = nfc.Code;
+ if (str.equals("")) {
+ log.println("'NumberFormat.code.equals(\"\") = true' for"
+ + " language: " + languages[i]);
+ log.println("Usage: oObj.getDefault(KNumberFormatType.SHORT,"
+ + " KNumberFormatUsage.DATE,new Locale(" + languages[i]
+ + "," + countries[i] + ",\"\");");
+ }
+ res &= !str.equals("");
+
+ nfc = oObj.getDefault(KNumberFormatType.LONG,
+ KNumberFormatUsage.DATE,getLocale(i));
+ str = nfc.Code;
+ if (str.equals("")) {
+ log.println("'NumberFormat.code.equals(\"\") = true' for "
+ + "language: " + languages[i]);
+ log.println("Usage: oObj.getDefault(KNumberFormatType.LONG,"
+ + " KNumberFormatUsage.DATE,new Locale(" + languages[i]
+ + "," + countries[i] + ",\"\");");
+ }
+ res &= ( ! str.equals("") );
+ }
+ tRes.tested("getDefault()", res);
+ }
+
+ /**
+ * Test calls the method twice for each locale with two different arguments.
+ * After every call result is checked.<p>
+ * Has <b> OK </b> status if both times returned structure's field 'Code'
+ * does not equal to a empty string.
+ */
+ public void _getFormatCode() {
+ boolean res = true;
+ NumberFormatCode nfc = null;
+
+ for (int i=0;i<7;i++) {
+ nfc = oObj.getFormatCode
+ (NumberFormatIndex.DATE_SYSTEM_SHORT,getLocale(i));
+ res &= ( ! nfc.Code.equals("") );
+ nfc = oObj.getFormatCode
+ (NumberFormatIndex.DATE_SYSTEM_LONG,getLocale(i));
+ res &= ( ! nfc.Code.equals("") );
+ }
+ tRes.tested("getFormatCode()", res);
+ }
+
+ /**
+ * Test calls the method twice with two different arguments for each locale.
+ * After every call result is checked.<p>
+ * Has <b> OK </b> status if both times returned array's length does not
+ * equal to zero.
+ */
+ public void _getAllFormatCode() {
+ boolean res = true;
+ NumberFormatCode[] nfc = null;
+
+ for (int i=0;i<7;i++) {
+ nfc = oObj.getAllFormatCode(KNumberFormatUsage.DATE, getLocale(i));
+ res &= ( nfc.length != 0 );
+ nfc = oObj.getAllFormatCode(KNumberFormatUsage.TIME, getLocale(i));
+ res &= ( nfc.length != 0 );
+ }
+ tRes.tested("getAllFormatCode()", res);
+ }
+
+ /**
+ * Test calls the method for each locale. <p>
+ * Has <b> OK </b> status if returned array's length does not equal to zero.
+ */
+ public void _getAllFormatCodes() {
+ boolean res = true;
+ NumberFormatCode[] nfc = null;
+
+ for (int i=0;i<7;i++) {
+ nfc = oObj.getAllFormatCodes(getLocale(i));
+ res &= ( nfc.length != 0 );
+ }
+ tRes.tested("getAllFormatCodes()", res);
+ }
+
+ /**
+ * Method returns locale for a given language and country.
+ * @param localeIndex index of needed locale.
+ * @return Locale by the index from arrays defined above
+ */
+ public Locale getLocale(int k) {
+ return new Locale(languages[k], countries[k], "");
+ }
+
+
+
+} // end XNumberFormatCode
+
diff --git a/qadevOOo/tests/java/ifc/i18n/_XTransliteration.java b/qadevOOo/tests/java/ifc/i18n/_XTransliteration.java
new file mode 100644
index 000000000000..b4d2921a4a3f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/i18n/_XTransliteration.java
@@ -0,0 +1,523 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTransliteration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.i18n;
+
+import com.sun.star.i18n.TransliterationModules;
+import com.sun.star.i18n.TransliterationModulesNew;
+import com.sun.star.i18n.TransliterationType;
+import com.sun.star.i18n.XTransliteration;
+import com.sun.star.lang.Locale;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.i18n.XTransliteration</code>
+* interface methods :
+* <ul>
+* <li><code> getName()</code></li>
+* <li><code> getType()</code></li>
+* <li><code> loadModule()</code></li>
+* <li><code> loadModuleNew()</code></li>
+* <li><code> loadModuleByImplName()</code></li>
+* <li><code> loadModulesByImplNames()</code></li>
+* <li><code> getAvailableModules()</code></li>
+* <li><code> transliterate()</code></li>
+* <li><code> folding()</code></li>
+* <li><code> equals()</code></li>
+* <li><code> transliterateRange()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.i18n.XTransliteration
+*/
+public class _XTransliteration extends MultiMethodTest {
+
+ public XTransliteration oObj = null;
+ private String[] mod = null ;
+ private Locale loc = new Locale("en", "EN", "") ;
+
+ /**
+ * Gets all available transliteration modules. <p>
+ * Has <b>OK</b> status if array returned has at least
+ * one module name.
+ */
+ public void _getAvailableModules() {
+ mod = oObj.getAvailableModules(loc, TransliterationType.ONE_TO_ONE);
+
+ if (mod != null) {
+ log.println("Available modules :") ;
+ for (int i = 0; i < mod.length; i++) {
+ log.println(" '" + mod[i] + "'") ;
+ }
+ } else {
+ log.println("!!! NULL returned !!!") ;
+ }
+
+ tRes.tested("getAvailableModules()", mod != null && mod.length > 0) ;
+ }
+
+ /**
+ * Calls the method for load IGNORE_CASE module and checks the name returned
+ * by the method <code>getName</code>. <p>
+ * Has <b>OK</b> status if the method <code>getName</code> returns the
+ * string "case ignore (generic)".
+ */
+ public void _loadModule() {
+ log.println("Load module IGNORE_CASE");
+ oObj.loadModule(TransliterationModules.IGNORE_CASE, loc);
+
+ String name = oObj.getName();
+ boolean res = name.equals("case ignore (generic)");
+ log.println("getName return: " + name);
+
+ tRes.tested("loadModule()", res );
+ }
+
+ /**
+ * Loads <code>LOWERCASE_UPPERCASE</code> module and checks the current
+ * name of object. <p>
+ *
+ * Has <b>OK</b> status if the name of the object is equals to
+ * 'lower_to_upper(generic)'
+ */
+ public void _loadModuleNew() {
+ boolean result = true ;
+
+ oObj.loadModuleNew(
+ new TransliterationModulesNew[]
+ {TransliterationModulesNew.LOWERCASE_UPPERCASE}, loc);
+
+ String name = oObj.getName();
+ boolean res = name.equals("lower_to_upper(generic)");
+ log.println("getName return: " + name);
+
+ tRes.tested("loadModuleNew()", result);
+ }
+
+ /**
+ * Calls the method for load LOWERCASE_UPPERCASE module and
+ * checks the name returned by the method <code>getName</code>. <p>
+ * Has <b>OK</b> status if the method <code>getName</code> returns the
+ * string "lower_to_upper(generic)".
+ */
+ public void _loadModuleByImplName() {
+ log.println("Load module LOWERCASE_UPPERCASE");
+ oObj.loadModuleByImplName("LOWERCASE_UPPERCASE", loc);
+
+ String name = oObj.getName();
+ boolean res = name.equals("lower_to_upper(generic)");
+ log.println("getName return: " + name);
+
+ tRes.tested("loadModuleByImplName()", res);
+ }
+
+ /**
+ * Calls the method for load UPPERCASE_LOWERCASE module and
+ * checks the name returned by the method <code>getName</code>. <p>
+ * Has <b>OK</b> status if the method <code>getName</code> returns the
+ * string "upper_to_lower(generic)".
+ */
+ public void _loadModulesByImplNames() {
+ log.println("Load module UPPERCASE_LOWERCASE");
+ oObj.loadModulesByImplNames(new String[]{"UPPERCASE_LOWERCASE"}, loc);
+
+ String name = oObj.getName();
+ boolean res = name.equals("upper_to_lower(generic)");
+ log.println("getName return: " + name);
+
+ tRes.tested("loadModulesByImplNames()", res);
+ }
+
+ /**
+ * Loads <code>LOWERCASE_UPPERCASE</code> module and checks current type.
+ * <p>Has <b>OK</b> status if the type is <code>ONE_TO_ONE</code>
+ */
+ public void _getType() {
+ oObj.loadModule(TransliterationModules.LOWERCASE_UPPERCASE, loc);
+ boolean result = oObj.getType() == TransliterationType.ONE_TO_ONE;
+ tRes.tested("getType()", result);
+ }
+
+ /**
+ * Loads UPPERCASE_LOWERCASE module and
+ * checks the name returned by the method <code>getName</code>. <p>
+ *
+ * Has <b>OK</b> status if the method <code>getName</code> returns the
+ * string "upper_to_lower(generic)".
+ */
+ public void _getName() {
+ oObj.loadModule(TransliterationModules.LOWERCASE_UPPERCASE, loc);
+
+ String name = oObj.getName();
+ boolean res = name.equals("lower_to_upper(generic)");
+ log.println("getName return: " + name);
+
+ tRes.tested("getName()", res);
+ }
+
+ /**
+ * First loads <code>LOWERCASE_UPPERCASE</code> module.
+ * Then tries to transliterate (make uppercase) a substring. <p>
+ * Has <b>OK</b> status if all chars were made uppercase,
+ * and array returned has size as substring length, and its
+ * elements are positions of substring characters in the source
+ * string.
+ */
+ public void _transliterate() {
+ oObj.loadModule(TransliterationModules.LOWERCASE_UPPERCASE, loc);
+
+ int[][] offs = new int[1][] ;
+
+ String out = oObj.transliterate("AaBbCc", 1, 4, offs) ;
+
+ boolean result = "ABBC".equals(out) && offs[0].length == 4 &&
+ offs[0][0] == 1 &&
+ offs[0][1] == 2 &&
+ offs[0][2] == 3 &&
+ offs[0][3] == 4 ;
+
+ tRes.tested("transliterate()", result) ;
+ }
+
+
+ /**
+ * First loads <code>LOWERCASE_UPPERCASE</code> module.
+ * Tries to transliterate a range of two characters. <p>
+ * Has <b>OK</b> status if the appropriate String array
+ * returned (not null, length = 4, with two ranges
+ * (a, i), (A, I) in any order).
+ */
+ public void _transliterateRange() {
+ oObj.loadModule(TransliterationModules.IGNORE_CASE, loc);
+
+ String[] out = oObj.transliterateRange("a", "i") ;
+
+ log.println("transliterateRange return:");
+ for(int i = 0; i < out.length; i++) {
+ log.println(out[i]);
+ }
+
+ boolean bOK = out != null &&
+ out.length == 4 &&
+ ("A".equals(out[0]) && "I".equals(out[1]) &&
+ "a".equals(out[2]) && "i".equals(out[3])) ||
+ ("a".equals(out[0]) && "i".equals(out[1]) &&
+ "A".equals(out[2]) && "I".equals(out[3])) ;
+
+ if (!bOK) {
+ log.println("Unexpected range returned :");
+ for (int i = 0; i < out.length; i++) {
+ log.print("'" + out[i] +"', ");
+ }
+ log.println();
+ }
+
+ tRes.tested("transliterateRange()", bOK);
+ }
+
+ /**
+ * This method is used internally by <code>equals</code>
+ * method so it indirectly tested in this method. <p>
+ * Always has <b>OK</b> status.
+ */
+ public void _folding() {
+ oObj.loadModule(TransliterationModules.LOWERCASE_UPPERCASE, loc);
+
+ int[][] offs = new int[1][] ;
+
+ String out = oObj.folding("AaBbCc", 1, 4, offs) ;
+
+ boolean result = "ABBC".equals(out) && offs[0].length == 4 &&
+ offs[0][0] == 1 &&
+ offs[0][1] == 2 &&
+ offs[0][2] == 3 &&
+ offs[0][3] == 4 ;
+
+
+ tRes.tested("folding()", result) ;
+ }
+
+
+ /**
+ * First loads <code>LOWERCASE_UPPERCASE</code> module.
+ * Tries to compare two equal substrings. <p>
+ * Has <b>OK</b> status if the method returned <code>true</code>.
+ */
+ public void _equals() {
+ oObj.loadModule(TransliterationModules.LOWERCASE_UPPERCASE, loc);
+
+ int[] match1 = new int[1],
+ match2 = new int[1] ;
+
+ boolean res = oObj.equals("aAbBcC", 1, 3, match1, "aAbBcC", 1,
+ 3, match2) ;
+
+ log.println("Returned : " + res + " Match1 = " + match1[0] +
+ " Match2 = " + match2[0]) ;
+
+ tRes.tested("equals()", res) ;
+ }
+
+ /**
+ * Test performed for sets of equal substrings, not equal
+ * substrings, and with out of bounds offset and length
+ * parameters.<p>
+ *
+ * Has <b>OK</b> status if comparings of equal substrings
+ * always return 0, if comparisons of none equal returns
+ * proper value according to lexicographical order and if
+ * comparisons with invalid parameters return none 0 value.
+ */
+ public void _compareSubstring() {
+ oObj.loadModule(TransliterationModules.LOWERCASE_UPPERCASE, loc);
+ boolean result = true ;
+
+ // substrings below must be equal
+ result &= testSubstring("", 0, 0, "", 0, 0, 0) ;
+ result &= testSubstring("aa", 1, 0, "", 0, 0, 0) ;
+ result &= testSubstring("aa", 1, 0, "aa", 2, 0, 0) ;
+ result &= testSubstring("a", 0, 1, "a", 0, 1, 0) ;
+ result &= testSubstring("ab", 0, 2, "ab", 0, 2, 0) ;
+ result &= testSubstring("abc", 1, 2, "abc", 1, 2, 0) ;
+ result &= testSubstring("abcdef", 0, 3, "123abc", 3, 3, 0) ;
+ result &= testSubstring("abcdef", 1, 1, "123abc", 4, 1, 0) ;
+
+ // substrings below must NOT be equal
+ result &= testSubstring("a", 0, 1, "a", 0, 0, 1) ;
+ result &= testSubstring("aaa", 1, 1, "", 0, 0, 1) ;
+ result &= testSubstring("bbb", 2, 1, "aaa", 2, 1, 1) ;
+ result &= testSubstring("abc", 0, 3, "abc", 0, 2, 1) ;
+ result &= testSubstring("bbc", 1, 2, "bbc", 0, 2, 1) ;
+
+ // testing with wrong offsets and lengths
+
+ tRes.tested("compareSubstring()", result) ;
+ }
+
+ /**
+ * Performs tesing of two substrings. Also testing of opposite
+ * substrings order performed.
+ * @return <code>true</code> if substrings are equal and retruned
+ * value is 0 for both orders,
+ * if substrings are different and expected value
+ * returned for direct order and opposite value returned for
+ * opposite order.
+ */
+ private boolean testSubstring(String str1, int p1, int len1,
+ String str2, int p2, int len2, int expRes) {
+
+ boolean ret = true ;
+
+ int res = -666 ;
+ try {
+ res = oObj.compareSubstring(str1, p1, len1, str2, p2, len2);
+ } catch (java.lang.NullPointerException e) {
+ log.println("Exception while method calling occurs :" + e);
+ }
+
+ if (res != expRes) {
+ log.print("Comparing FAILED; return: " + res + ", expected: " +
+ expRes + " ");
+ ret = false ;
+ } else {
+ log.print("Comparing OK : ");
+ }
+ log.println("('" + str1 + "', " + p1 + ", " + len1 + ", '" +
+ str2 + "', " + p2 + ", " + len2 + ")");
+
+ res = -666 ;
+ try {
+ res = oObj.compareSubstring(str2, p2, len2, str1, p1, len1);
+ } catch (java.lang.NullPointerException e) {
+ log.println("Exception while method calling occurs :" + e);
+ }
+
+ if (res != -expRes) {
+ log.print("Comparing FAILED; return: " + res + ", expected: " +
+ -expRes + " ");
+ ret = false ;
+ } else {
+ log.print("Comparing OK :");
+ }
+ log.println("('" + str2 + "', " + p2 + ", " + len2 + ", '" +
+ str1 + "', " + p1 + ", " + len1 + ")");
+
+ return ret ;
+ }
+
+ /**
+ * Performs tesing of two substrings, where parameters are wrong
+ * (pos and length of substring are out of bounds). Also testing
+ * of opposite agruments order performed.
+ * @return <code>true</code> if none 0 value returned for both
+ * orders.
+ */
+ private boolean testErrSubstring(String str1, int p1, int len1,
+ String str2, int p2, int len2) {
+
+ boolean bOK = true ;
+ int res ;
+ res = oObj.compareSubstring(str1, p1, len1, str2, p2, len2) ;
+ bOK &= res != 0 ;
+
+ if (res == 0) {
+ log.println("Comparing with wrong arguments return 0 :");
+ log.println("('" + str1 + "', " + p1 + ", " + len1 + ", '" +
+ str2 + "', " + p2 + ", " + len2 + ")");
+ }
+
+ res = oObj.compareSubstring(str2, p2, len2, str1, p1, len1) ;
+ bOK &= res != 0 ;
+
+ if (res == 0) {
+ log.println("Comparing with wrong arguments return 0 :");
+ log.println("('" + str2 + "', " + p2 + ", " + len2 + ", '" +
+ str1 + "', " + p1 + ", " + len1 + ")");
+ }
+
+ return bOK ;
+ }
+
+ /**
+ * Test performed for sets of equal strings and not equal
+ * strings.<p>
+ *
+ * Has <b>OK</b> status if comparings of equal strings
+ * always return 0 and if comparisons of none equal returns
+ * proper value according to lexicographical order .
+ */
+ public void _compareString() {
+ oObj.loadModule(TransliterationModules.LOWERCASE_UPPERCASE, loc);
+ boolean result = true ;
+
+ result &= testString("", "", 0) ;
+ result &= testString("a", "", 1) ;
+ result &= testString("a", "a", 0) ;
+ result &= testString("A", "a", 1) ;
+ result &= testString("b", "a", 1) ;
+ result &= testString("\n", "\n", 0) ;
+ result &= testString("\n", "\t", 1) ;
+ result &= testString("aaa", "aaa", 0) ;
+ result &= testString("aaA", "aaa", 1) ;
+ result &= testString("aaa", "aa", 1) ;
+ result &= testString("ab", "aaa", 1) ;
+ result &= testString("aba", "aa", 1) ;
+ result &= testString("aaa\t\na", "aaa\t\na", 0) ;
+ result &= testString("aaa\t\nb", "aaa\t\na", 1) ;
+
+ tRes.tested("compareString()", result) ;
+ }
+
+ /**
+ * Performs tesing of two strings. If the expected value is not 0
+ * (i.e. strings are not equal), then also testing of opposite
+ * strings order performed.
+ * @return <code>true</code> if strings are equal and retruned
+ * value is 0, if strings are different and expected value
+ * returned for direct order and opposite value returned for
+ * opposite order.
+ */
+ protected boolean testString(String str1, String str2, int expRes) {
+ if (expRes == 0) return testString(str1, str2, expRes, false) ;
+ return testString(str1, str2, expRes, true) ;
+ }
+
+ private boolean testString(String str1, String str2, int expRes,
+ boolean testReverse) {
+
+ boolean ret = true ;
+
+ int res = -666 ;
+ try {
+ res = oObj.compareString(str1, str2);
+ } catch (java.lang.NullPointerException e) {
+ log.println("Exception while method calling occurs :" + e);
+ }
+
+ if (res == expRes) {
+ log.println("Comparing of '" + str1 + "' and '" + str2 + "' OK" );
+ } else {
+ log.println("Comparing of '" + str1 + "' and '" + str2 +
+ "' FAILED; return: " + res + ", expected: " + expRes);
+ ret = false ;
+ }
+
+ if (!testReverse) return ret ;
+
+ res = -666 ;
+ try {
+ res = oObj.compareString(str2, str1);
+ } catch (java.lang.NullPointerException e) {
+ log.println("Exception while method calling occurs :" + e);
+ }
+
+ if (res == -expRes) {
+ log.println("Comparing of '" + str2 + "' and '" + str1 + "' OK" );
+ } else {
+ log.println("Comparing of '" + str2 + "' and '" + str1 +
+ "' FAILED; return: " + res + ", expected: " + -expRes);
+ ret = false ;
+ }
+
+ return ret ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java
new file mode 100644
index 000000000000..44f122a5b254
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java
@@ -0,0 +1,282 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XActiveDataControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.io.XActiveDataControl;
+import com.sun.star.io.XStreamListener;
+import com.sun.star.lang.EventObject;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.io.XActiveDataControl</code>
+ * interface methods :
+ * <ul>
+ * <li><code> addListener()</code></li>
+ * <li><code> removeListener()</code></li>
+ * <li><code> start()</code></li>
+ * <li><code> terminate()</code></li>
+ * </ul> <p>
+ *
+ * Tests <code>XActiveDataControl</code> interface. First, it registers a listener
+ * and performs <code>start()</code> and <code>terminate()</code> calls. The
+ * events received in the listener are analyzed to verify the result.<p>
+ *
+ * @see com.sun.star.io.XActiveDataControl
+ */
+public class _XActiveDataControl extends MultiMethodTest {
+
+ /**
+ * Contains the object under test.
+ */
+ public XActiveDataControl oObj = null;
+
+ /**
+ * Indicates that the <code>XStreamListener.started()</code> method has
+ * been called.
+ */
+ private boolean startCalled = false;
+
+ /**
+ * Indicates that the <code>XStreamListener.terminated()</code> method has
+ * been called.
+ */
+ private boolean terminateCalled = false;
+
+ /**
+ * Indicates that the <code>XEventListener.closed()</code> method has
+ * been called.
+ */
+ private boolean closeCalled = false;
+
+ /**
+ * Indicates that the <code>XStreamListener.error()</code> method has
+ * been called.
+ */
+ private boolean errorCalled = false;
+
+ /**
+ * Contains the error, if <code>XStreamListener.error(Object error)</code>
+ * method was called.
+ */
+ private Object error;
+
+ /**
+ * Indicates that the <code>XEventListener.disposing()</code> method has
+ * been called.
+ */
+ private boolean smthngElseCalled = false;
+
+ /**
+ * The listener is used to verify results of the methods.
+ */
+ private TestStreamListener listener = new TestStreamListener();
+
+ /**
+ * XStreamListener implementation. Sets variables
+ * (<cod>estartedCalled</code>, <code>terminatedCalled</code>, etc.) to
+ * <tt>true</tt> if the appropriate method was called (for example, if
+ * <code>started()</code> was called, the <code>startedCalled</code>
+ * field is set).
+ */
+ private class TestStreamListener implements XStreamListener {
+ public void started() {
+ startCalled = true ;
+ }
+ public void terminated() {
+ terminateCalled = true ;
+ }
+ public void error(Object e) {
+ error = e;
+ errorCalled = true ;
+ }
+ public void closed() {
+ closeCalled = true ;
+ }
+ public void disposing(EventObject e) {
+ smthngElseCalled = true ;
+ }
+
+ }
+
+ /**
+ * Tests <code>addListener()</code>. The verification is performed later, in
+ * <code>_terminate()</code> method.
+ */
+ public void _addListener() {
+ oObj.addListener(listener);
+ }
+
+ /**
+ * Starts the data activity (e.g. data pump). Verifictation is performed
+ * later, in <code>_terminate()</code> method.
+ */
+ public void _start() {
+ executeMethod("addListener()");
+
+ oObj.start();
+
+ // waiting a little bit for data transfered
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(Status.failed(e.getMessage()));
+ }
+ }
+
+ /**
+ * Tests <code>removeListener()</code>. Before, it ensures that other
+ * tests are perforemed and that <code>addListener()</code> is okay. Then,
+ * calls <code>XActiveDataControl.start()</code> and checks that no method
+ * of the listener was called.
+ */
+ public void _removeListener() {
+ // performing other tests before, so, that don't break them
+ try {
+ executeMethod("terminate()");
+ } catch (StatusException e) {
+ // the result doesn't matter
+ }
+
+ // check that addListener() is okay
+ requiredMethod("addListener()");
+
+ // clearing previous records
+ startCalled = false;
+ terminateCalled = false;
+ errorCalled = false;
+ error = null;
+ smthngElseCalled = false;
+
+ // removing the listener
+ oObj.removeListener(listener);
+
+ // starting the activity
+ oObj.start();
+
+ // wait a little bit to allow for listeners to be called
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(Status.failed(e.getMessage()));
+ }
+
+ // check that no removed listener's method was called
+ tRes.tested("removeListener()",!startCalled &&
+ !terminateCalled && !errorCalled && !smthngElseCalled) ;
+ }
+
+ /**
+ * Tests <code>terminate()</code>. First, ensures that <code>start()</code>
+ * has been called. Then, verifies <code>start()</code>,
+ * <code>addListener()</code> and <code>terminate()</code> results, by
+ * checking that the appropriate listener's methods have been called.
+ */
+ public void _terminate() {
+ // ensuring that the activity has been started
+ executeMethod("start()");
+
+ // terminating the activity
+ oObj.terminate();
+
+ // waiting a little bit for listeners to be called
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ e.printStackTrace(log) ;
+ throw new StatusException(Status.failed(e.getMessage()));
+ }
+
+ // check, if any error occured
+ if (errorCalled) {
+ Status.failed("Unexpected error");
+ log.println("Unexpected error " + error);
+ ((Exception)error).printStackTrace(log);
+ }
+
+ // verification of start() method - startedCalled method should be
+ // called
+ if (!tRes.tested("start()", startCalled)) {
+ log.println("XStreamListener.started() was not called()");
+ }
+
+ // check that any listener method is called
+ tRes.tested("addListener()", startCalled ||
+ terminateCalled || errorCalled || smthngElseCalled);
+
+ // checking that terminated() has been called or streams were closed
+ // before terminate() call, in this case termination has no sense.
+ tRes.tested("terminate()", terminateCalled || closeCalled);
+ }
+
+ /**
+ * Disposes the test environment, since it is used.
+ */
+ public void after() {
+ tEnv.dispose();
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/io/_XActiveDataSink.java b/qadevOOo/tests/java/ifc/io/_XActiveDataSink.java
new file mode 100644
index 000000000000..c2f16e6039d5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XActiveDataSink.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XActiveDataSink.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.io.XActiveDataSink;
+import com.sun.star.io.XInputStream;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.io.XActiveDataSink</code>
+* interface methods :
+* <ul>
+* <li><code> setInputStream()</code></li>
+* <li><code> getInputStream()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'InputStream'</code>
+* (of type <code>com.sun.star.io.XInputStream</code>):
+* acceptable input stream which can be set by <code>setInputStream</code> </li>
+* <ul> <p>
+*
+* After test completion object environment has to be recreated.
+* @see com.sun.star.io.XActiveDataSink
+*/
+public class _XActiveDataSink extends MultiMethodTest {
+
+ public XActiveDataSink oObj = null;
+
+ private XInputStream iStream = null;
+
+ /**
+ * Take the XInputStream from the environment for setting and getting
+ */
+ public void before() {
+ XInterface x = (XInterface)tEnv.getObjRelation("InputStream");
+ iStream = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, x) ;
+ }
+
+ /**
+ * Just sets new input stream. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _setInputStream() {
+ oObj.setInputStream(iStream) ;
+
+ tRes.tested("setInputStream()", true) ;
+ }
+
+ /**
+ * First retrieves current input stream, then sets to new
+ * input stream (if old was <code>null</code>) or to null.
+ * Then input stream retrieved again and checked to be not
+ * equal to the old one. <p>
+ * Has <b>OK</b> status if old and new streams retrieved are
+ * not equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setInputStream() </code> : to be sure the method
+ * works without exceptions. </li>
+ * </ul>
+ */
+ public void _getInputStream() {
+ requiredMethod("setInputStream()") ;
+
+ Object oldStream = oObj.getInputStream() ;
+ XInputStream newStream = oldStream == null ? iStream : null ;
+
+ oObj.setInputStream(newStream) ;
+ Object getStream = oObj.getInputStream() ;
+
+ tRes.tested("getInputStream()", getStream != oldStream) ;
+ }
+
+ public void after() {
+ tEnv.dispose() ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/io/_XActiveDataSource.java b/qadevOOo/tests/java/ifc/io/_XActiveDataSource.java
new file mode 100644
index 000000000000..e541a2412d5f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XActiveDataSource.java
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XActiveDataSource.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.io.XActiveDataSource;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.io.XActiveDataSource</code>
+* interface methods:
+* <ul>
+* <li><code>setOutputStream()</code></li>
+* <li><code>getOutputStream()</code></li>
+* </ul> <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'OutputStream'</code>
+* (of type <code>com.sun.star.io.OutputStream</code>):
+* acceptable output stream which can be set by <code>setOutputStream</code> </li>
+* <ul> <p>
+*
+* After test completion object environment has to be recreated.
+* @see com.sun.star.io.XActiveDataSource
+* @see com.sun.star.io.XOutputStream
+*/
+public class _XActiveDataSource extends MultiMethodTest {
+
+ public XActiveDataSource oObj = null;
+
+ private XOutputStream oStream = null;
+
+ /**
+ * Take the XOutputStream from the environment for setting and getting.
+ */
+ public void before() {
+ XInterface x = (XInterface)tEnv.getObjRelation("OutputStream");
+ oStream = (XOutputStream) UnoRuntime.queryInterface
+ (XOutputStream.class, x) ;
+ }
+
+ /**
+ * Test calls the method using interface <code>XOutputStream</code>
+ * received in method <code>before()</code> as parameter. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setOutputStream() {
+ oObj.setOutputStream(oStream);
+ tRes.tested("setOutputStream()", true);
+ }
+
+ /**
+ * Test calls the method and compares returned value with value that was
+ * set in the method <code>setOutputStream()</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setOutputStream() </code></li>
+ * </ul>
+ */
+ public void _getOutputStream() {
+ requiredMethod("setOutputStream()");
+
+ tRes.tested("getOutputStream()",
+ oStream.equals(oObj.getOutputStream()));
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ public void after() {
+ tEnv.dispose() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XConnectable.java b/qadevOOo/tests/java/ifc/io/_XConnectable.java
new file mode 100644
index 000000000000..e9a2884dc543
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XConnectable.java
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XConnectable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.io.XConnectable;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.io.XConnectable</code>
+* interface methods:
+* <ul>
+* <li><code>setPredecessor()</code></li>
+* <li><code>getPredecessor()</code></li>
+* <li><code>setSuccessor()</code></li>
+* <li><code>getSuccessor()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Connectable'</code> (supports the <code>XConnectable</code>
+* interface):
+* another 0bject to connect </li>
+* </ul>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.io.XConnectable
+*/
+public class _XConnectable extends MultiMethodTest {
+
+ public XConnectable oObj = null;
+
+ private XConnectable xConnect = null ;
+
+ /**
+ * Get another connectable object from object relations.
+ */
+ public void before() {
+ XInterface x = (XInterface)tEnv.getObjRelation("Connectable");
+ xConnect = (XConnectable)UnoRuntime.queryInterface(
+ XConnectable.class, x) ;
+ }
+
+ /**
+ * Test calls the method using interface <code>XConnectable</code>
+ * received in method <code>before()</code> as parameter. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setPredecessor() {
+ oObj.setPredecessor(xConnect) ;
+
+ tRes.tested("setPredecessor()", true) ;
+ }
+
+ /**
+ * Test calls the method and compares returned value with value that was
+ * set in the method <code>setPredecessor()</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setPredecessor() </code></li>
+ * </ul>
+ */
+ public void _getPredecessor() {
+ requiredMethod("setPredecessor()") ;
+
+ XConnectable gConnect = oObj.getPredecessor() ;
+
+ tRes.tested("getPredecessor()", xConnect.equals(gConnect)) ;
+ }
+
+ /**
+ * Test calls the method using interface <code>XConnectable</code>
+ * received in method <code>before()</code> as parameter. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setSuccessor() {
+ oObj.setSuccessor(xConnect) ;
+
+ tRes.tested("setSuccessor()", true) ;
+ }
+
+ /**
+ * Test calls the method and compares returned value with value that was
+ * set in the method <code>setSuccessor()</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setSuccessor() </code></li>
+ * </ul>
+ */
+ public void _getSuccessor() {
+ requiredMethod("setSuccessor()") ;
+
+ XConnectable gConnect = oObj.getSuccessor() ;
+
+ tRes.tested("getSuccessor()", xConnect.equals(gConnect)) ;
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ public void after() {
+ tEnv.dispose() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XDataInputStream.java b/qadevOOo/tests/java/ifc/io/_XDataInputStream.java
new file mode 100644
index 000000000000..b81c0611f966
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XDataInputStream.java
@@ -0,0 +1,453 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataInputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.io.XDataInputStream;
+import com.sun.star.io.XDataOutputStream;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.util.Vector;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.io.XDataInputStream</code>
+* interface methods:
+* <ul>
+* <li><code>readBoolean()</code></li>
+* <li><code>readByte()</code></li>
+* <li><code>readChar()</code></li>
+* <li><code>readShort()</code></li>
+* <li><code>readLong()</code></li>
+* <li><code>readHyper()</code></li>
+* <li><code>readFloat()</code></li>
+* <li><code>readDouble()</code></li>
+* <li><code>readUTF()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'StreamData'</code> (of type <code>Vector</code>):
+* vector of data for comparing with data that obtained from stream </li>
+* <li> <code>'StreamWriter'</code> (of type <code>XDataOutputStream</code>):
+* a possiblitiy to write values to the stream. </li>
+* <ul> <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.io.XDataInputStream
+* @see java.util.Vector
+*/
+public class _XDataInputStream extends MultiMethodTest {
+
+ public XDataInputStream oObj = null;
+ public XDataOutputStream oStream = null;
+
+ // values that are written
+ private boolean writeBoolean;
+ private byte writeByte;
+ private char writeChar;
+ private double writeDouble;
+ private float writeFloat;
+ private long writeHyper;
+ private int writeLong;
+ private short writeShort;
+ private String writeUTF;
+
+
+ /**
+ * Retrieves relations. From relation 'StreamData' extracts
+ * data of different types and fills the appropriate variables.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before(){
+
+ XInterface x = (XInterface)tEnv.getObjRelation("StreamWriter") ;
+ oStream = (XDataOutputStream)UnoRuntime.queryInterface(
+ XDataOutputStream.class, x);
+ Vector data = (Vector) tEnv.getObjRelation("StreamData") ;
+ if (data == null || oStream == null) {
+ throw new StatusException(Status.failed("Object relation not found."));
+ }
+
+ // extract data from vector
+ Object dataElem = null ;
+ for (int i = 0; i < data.size(); i++) {
+ dataElem = data.get(i) ;
+
+ if (dataElem instanceof Boolean) {
+ writeBoolean = ((Boolean)dataElem).booleanValue();
+ } else
+ if (dataElem instanceof Byte) {
+ writeByte = ((Byte)dataElem).byteValue();
+ } else
+ if (dataElem instanceof Character) {
+ writeChar = ((Character)dataElem).charValue();
+ } else
+ if (dataElem instanceof Short) {
+ writeShort = ((Short)dataElem).shortValue();
+ } else
+ if (dataElem instanceof Integer) {
+ writeLong = ((Integer)dataElem).intValue();
+ } else
+ if (dataElem instanceof Long) {
+ writeHyper = ((Long)dataElem).longValue();
+ } else
+ if (dataElem instanceof Float) {
+ writeFloat = ((Float)dataElem).floatValue();
+ } else
+ if (dataElem instanceof Double) {
+ writeDouble = ((Double)dataElem).doubleValue();
+ } else
+ if (dataElem instanceof String) {
+ writeUTF = (String)dataElem;
+ }
+ }
+ }
+
+ /**
+ * First writes a value to outStream then reads it from input. <p>
+ *
+ * Has <b> OK </b> status if read and written values are equal. <p>
+ */
+ public void _readBoolean() {
+ boolean res = true ;
+ try {
+ oStream.writeBoolean(writeBoolean);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write data to the stream", e);
+ }
+ byte readElem;
+ try {
+ readElem = oObj.readBoolean();
+ res = ((readElem != 0) == writeBoolean);
+
+ if (!res)
+ log.println("Must be read " +
+ writeBoolean +
+ " but was read " + (readElem != 0)) ;
+ } catch (com.sun.star.io.IOException e) {
+ log.println("Couldn't read Boolean from stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("readBoolean()", res) ;
+ }
+
+ /**
+ * First writes a value to outStream then reads it from input. <p>
+ *
+ * Has <b> OK </b> status if read and written values are equal. <p>
+ */
+ public void _readByte() {
+ boolean res = true ;
+ try {
+ oStream.writeByte(writeByte);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write data to the stream", e);
+ }
+ byte readElem;
+ try {
+ readElem = oObj.readByte() ;
+ res = (readElem == writeByte);
+
+ if (!res)
+ log.println("Must be read " +
+ writeByte +
+ " but was read " + readElem);
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't read Byte from stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("readByte()", res) ;
+ }
+
+ /**
+ * First writes a value to outStream then reads it from input. <p>
+ *
+ * Has <b> OK </b> status if read and written values are equal. <p>
+ */
+ public void _readChar() {
+ boolean res = true ;
+ try {
+ oStream.writeChar(writeChar);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write data to the stream", e);
+ }
+ char readElem;
+ try {
+ readElem = oObj.readChar() ;
+ res = (readElem == writeChar);
+
+ if (!res)
+ log.println("Must be read " +
+ writeChar +
+ " but was read " + readElem) ;
+ } catch( com.sun.star.io.IOException e ) {
+ log.println("Couldn't read Char from stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("readChar()", res);
+ }
+
+ /**
+ * First writes a value to outStream then reads it from input. <p>
+ *
+ * Has <b> OK </b> status if read and written values are equal. <p>
+ */
+ public void _readShort() {
+ boolean res = true ;
+ try {
+ oStream.writeShort(writeShort);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write data to the stream", e);
+ }
+ short readElem;
+ try {
+ readElem = oObj.readShort() ;
+ res = (readElem == writeShort);
+
+ if (!res)
+ log.println("Must be read " +
+ writeShort +
+ " but was read " + readElem) ;
+ } catch( com.sun.star.io.IOException e ) {
+ log.println("Couldn't read Short from stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("readShort()", res);
+ }
+
+ /**
+ * First writes a value to outStream then reads it from input. <p>
+ *
+ * Has <b> OK </b> status if read and written values are equal. <p>
+ */
+ public void _readLong() {
+ try {
+ oStream.writeLong(writeLong);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write data to the stream", e);
+ }
+ boolean res = true ;
+ int readElem;
+ try {
+ readElem = oObj.readLong() ;
+ res = (readElem == writeLong);
+
+ if (!res)
+ log.println("Must be read " +
+ writeLong +
+ " but was read " + readElem) ;
+ } catch( com.sun.star.io.IOException e ) {
+ log.println("Couldn't read Long from stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("readLong()", res);
+ }
+
+ /**
+ * First writes a value to outStream then reads it from input. <p>
+ *
+ * Has <b> OK </b> status if read and written values are equal. <p>
+ */
+ public void _readHyper() {
+ boolean res = true ;
+ try {
+ oStream.writeHyper(writeHyper);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write data to the stream", e);
+ }
+ long readElem;
+ try {
+ readElem = oObj.readHyper() ;
+ res = (readElem == writeHyper);
+
+ if (!res)
+ log.println("Must be read " +
+ writeHyper +
+ " but was read " + readElem) ;
+ } catch( com.sun.star.io.IOException e ) {
+ log.println("Couldn't read Hyper from stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("readHyper()", res);
+ }
+
+ /**
+ * First writes a value to outStream then reads it from input. <p>
+ *
+ * Has <b> OK </b> status if read and written values are equal. <p>
+ */
+ public void _readFloat() {
+ boolean res = true ;
+ try {
+ oStream.writeFloat(writeFloat);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write data to the stream", e);
+ }
+ float readElem;
+ try {
+ readElem = oObj.readFloat() ;
+ res = (readElem == writeFloat);
+
+ if (!res)
+ log.println("Must be read " +
+ writeFloat +
+ " but was read " + readElem) ;
+ } catch( com.sun.star.io.IOException e ) {
+ log.println("Couldn't read Float from stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("readFloat()", res);
+ }
+
+ /**
+ * First writes a value to outStream then reads it from input. <p>
+ *
+ * Has <b> OK </b> status if read and written values are equal. <p>
+ */
+ public void _readDouble() {
+ boolean res = true ;
+ try {
+ oStream.writeDouble(writeDouble);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write data to the stream", e);
+ }
+ double readElem;
+ try {
+ readElem = oObj.readDouble() ;
+ res = (readElem == writeDouble);
+
+ if (!res)
+ log.println("Must be read " +
+ writeDouble +
+ " but was read " + readElem) ;
+ } catch( com.sun.star.io.IOException e ) {
+ log.println("Couldn't read Double from stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("readDouble()", res);
+ }
+
+ /**
+ * First writes a value to outStream then reads it from input. <p>
+ *
+ * Has <b> OK </b> status if read and written values are equal. <p>
+ */
+ public void _readUTF() {
+ boolean res = true ;
+ try {
+ oStream.writeUTF(writeUTF);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Can't write data to the stream", e);
+ }
+ String readElem;
+ try {
+ readElem = oObj.readUTF() ;
+ res = writeUTF.equals(readElem) ;
+
+ if (!res)
+ log.println("Must be read '" +
+ writeUTF +
+ "' but was read '" + readElem + "'") ;
+ } catch( com.sun.star.io.IOException e ) {
+ log.println("Couldn't read String from stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("readUTF()", res);
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ public void after() {
+ try {
+ oStream.flush();
+ } catch (com.sun.star.io.NotConnectedException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.io.BufferSizeExceededException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ }
+ tEnv.dispose() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java b/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java
new file mode 100644
index 000000000000..79dddd1efa13
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java
@@ -0,0 +1,314 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataOutputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.io.XDataOutputStream;
+import java.util.Vector;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.io.XDataOutputStream</code>
+* interface methods:
+* <ul>
+* <li><code>writeBoolean()</code></li>
+* <li><code>writeByte()</code></li>
+* <li><code>writeChar()</code></li>
+* <li><code>writeShort()</code></li>
+* <li><code>writeLong()</code></li>
+* <li><code>writeHyper()</code></li>
+* <li><code>writeFloat()</code></li>
+* <li><code>writeDouble()</code></li>
+* <li><code>writeUTF()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'StreamData'</code> (of type <code>Vector</code>):
+* vector of data for writing to the stream </li>
+* <ul> <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.io.XDataOutputStream
+*/
+public class _XDataOutputStream extends MultiMethodTest {
+
+ public XDataOutputStream oObj = null;
+
+ // values that are written
+ private boolean writeBoolean;
+ private byte writeByte;
+ private char writeChar;
+ private double writeDouble;
+ private float writeFloat;
+ private long writeHyper;
+ private int writeLong;
+ private short writeShort;
+ private String writeUTF;
+
+
+ /**
+ * Retrieves object relation <code>'StreamData'</code>
+ * and executes methods of interface depending of data in stream.
+ * If relation or data of some type in stream not found then
+ * tests of corresponding methods are skipped.
+ */
+ public void before() throws RuntimeException {
+
+ Vector data = (Vector) tEnv.getObjRelation("StreamData") ;
+ if (data == null) {
+ throw new RuntimeException("Object relation 'StreamData' not found.");
+ }
+
+ // extract data from vector
+ Object dataElem = null ;
+ for (int i = 0; i < data.size(); i++) {
+ dataElem = data.get(i) ;
+
+ if (dataElem instanceof Boolean) {
+ writeBoolean = ((Boolean)dataElem).booleanValue();
+ } else
+ if (dataElem instanceof Byte) {
+ writeByte = ((Byte)dataElem).byteValue();
+ } else
+ if (dataElem instanceof Character) {
+ writeChar = ((Character)dataElem).charValue();
+ } else
+ if (dataElem instanceof Short) {
+ writeShort = ((Short)dataElem).shortValue();
+ } else
+ if (dataElem instanceof Integer) {
+ writeLong = ((Integer)dataElem).intValue();
+ } else
+ if (dataElem instanceof Long) {
+ writeHyper = ((Long)dataElem).longValue();
+ } else
+ if (dataElem instanceof Float) {
+ writeFloat = ((Float)dataElem).floatValue();
+ } else
+ if (dataElem instanceof Double) {
+ writeDouble = ((Double)dataElem).doubleValue();
+ } else
+ if (dataElem instanceof String) {
+ writeUTF = (String)dataElem;
+ }
+ }
+ }
+
+ /**
+ * Test writes some data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeBoolean() {
+ boolean res = true;
+ try {
+ oObj.writeBoolean(true) ;
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write Boolean to stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("writeBoolean()", res) ;
+ }
+
+ /**
+ * Test writes some data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeByte() {
+ boolean res = true;
+ try {
+ oObj.writeByte((byte) 123);
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write Byte to stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("writeByte()", res);
+ }
+
+ /**
+ * Test writes some data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeChar() {
+ boolean res = true;
+ try {
+ oObj.writeChar((char)12345);
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write Char to stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("writeChar()", res);
+ }
+
+ /**
+ * Test writes some data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeShort() {
+ boolean res = true;
+ try {
+ oObj.writeShort((short)12345) ;
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write Short to stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("writeShort()", res);
+ }
+
+ /**
+ * Test writes some data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeLong() {
+ boolean res = true;
+ try {
+ oObj.writeLong(123456);
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write Long to stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("writeLong()", res);
+ }
+
+ /**
+ * Test writes some data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeHyper() {
+ boolean res = true;
+ try {
+ oObj.writeHyper(123456789);
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write Hyper to stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("writeHyper()", res);
+ }
+
+ /**
+ * Test writes some data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeFloat() {
+ boolean res = true;
+ try {
+ oObj.writeFloat((float)1.2345);
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write Float to stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("writeFloat()", res);
+ }
+
+ /**
+ * Test writes some data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeDouble() {
+ boolean res = true;
+ try {
+ oObj.writeDouble(1.2345);
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write Double to stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("writeDouble()", res);
+ }
+
+ /**
+ * Test writes some data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeUTF() {
+ boolean res = true;
+ try {
+ oObj.writeUTF("XDataOutputStream") ;
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write String to stream");
+ e.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("writeUTF()", res);
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ public void after() {
+ tEnv.dispose() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XInputStream.java b/qadevOOo/tests/java/ifc/io/_XInputStream.java
new file mode 100644
index 000000000000..be9275aca76c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XInputStream.java
@@ -0,0 +1,280 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XInputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.io.XInputStream</code>
+* interface methods:
+* <ul>
+* <li><code>readBytes()</code></li>
+* <li><code>readSomeBytes()</code></li>
+* <li><code>skipBytes()</code></li>
+* <li><code>available()</code></li>
+* <li><code>closeInput()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'StreamWriter'</code>:
+* object that supports interface <code>XOutputStream</code>;
+* a stream to write data to</li>
+* <li> <code>'ByteData'</code> (of type <code>byte []</code>):
+* data to write to the stream</li>
+* <ul> <p>
+
+* @see com.sun.star.io.XInputStream
+*/
+public class _XInputStream extends MultiMethodTest {
+
+ public XInputStream oObj = null;
+ public XOutputStream oStream = null;
+
+ byte[] bytes = null;
+
+ int bytesReady = 0 ;
+
+ /**
+ * Before the test, the stream writer and the data are ecxtracted from
+ * the object relations and the data is written to the stream.
+ */
+ public void before() {
+ XInterface x = (XInterface)tEnv.getObjRelation("StreamWriter");
+ oStream = (XOutputStream)UnoRuntime.queryInterface(
+ XOutputStream.class, x) ;
+ bytes = (byte[])tEnv.getObjRelation("ByteData");
+ try {
+ oStream.writeBytes(bytes);
+ }
+ catch(com.sun.star.io.NotConnectedException e) {}
+ catch(com.sun.star.io.BufferSizeExceededException e) {}
+ catch(com.sun.star.io.IOException e) {}
+ }
+
+ /**
+ * After the test, the stream writer is closed and the
+ * environment is disposed.
+ */
+ public void after() {
+ try {
+ oStream.flush();
+ oStream.closeOutput();
+ }
+ catch(com.sun.star.io.NotConnectedException e) {}
+ catch(com.sun.star.io.BufferSizeExceededException e) {}
+ catch(com.sun.star.io.IOException e) {}
+ tEnv.dispose();
+ }
+ /**
+ * Test calls the method and stores number of available bytes. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _available() {
+ boolean result = true ;
+ try {
+ bytesReady = oObj.available() ;
+ log.println("Bytes available :" + bytesReady) ;
+ } catch (com.sun.star.io.IOException e){
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("available()", result) ;
+ }
+
+ /**
+ * Test reads one byte from stream. If no bytes available
+ * then test of method is skipped. <p>
+ * Has <b> OK </b> status if returned value equal to number of read bytes,
+ * no exceptions were thrown and read data is not null. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> available() </code> : to have available number
+ * of bytes in stream </li>
+ * </ul>
+ */
+ public void _readBytes() {
+ requiredMethod("available()") ;
+ boolean result ;
+
+ if (bytesReady-- > 0) {
+ try {
+ byte[][] data = new byte[1][1] ;
+ int read = oObj.readBytes(data, 1) ;
+
+ result = read == 1 &&
+ data != null &&
+ data.length == 1 ;
+ } catch (com.sun.star.io.IOException e){
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("readBytes()", result) ;
+ } else {
+ log.println("No more bytes available in the stream");
+ tRes.tested("readBytes()", Status.skipped(false));
+ }
+ }
+
+ /**
+ * Test reads one byte from stream. If no bytes available
+ * then test of method is skipped. <p>
+ * Has <b> OK </b> status if returned value equal to number of read bytes,
+ * no exceptions were thrown and read data is not null. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> available() </code> : to have available number
+ * of bytes in stream </li>
+ * </ul>
+ */
+ public void _readSomeBytes() {
+ requiredMethod("available()") ;
+ boolean result ;
+
+ if (bytesReady-- > 0) {
+ try {
+ byte[][] data = new byte [1][1] ;
+ int read = oObj.readSomeBytes(data, 1) ;
+
+ result = read == 1 &&
+ data != null &&
+ data.length == 1 ;
+ } catch (com.sun.star.io.IOException e){
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("readSomeBytes()", result) ;
+ } else {
+ log.println("No more bytes available in the stream") ;
+ tRes.tested("readBytes()", Status.skipped(false));
+ }
+ }
+
+ /**
+ * Test skips one byte from stream. If no bytes available
+ * then test of method is skipped. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> available() </code> : to have available number
+ * of bytes in stream </li>
+ * </ul>
+ */
+ public void _skipBytes() {
+ requiredMethod("available()") ;
+ boolean result ;
+
+ if (bytesReady-- > 0) {
+ try {
+ oObj.skipBytes(1) ;
+
+ result = true ;
+ } catch (com.sun.star.io.IOException e){
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("skipBytes()", result) ;
+ } else {
+ log.println("No more bytes available in the stream") ;
+ tRes.tested("readBytes()", Status.skipped(false));
+ }
+ }
+
+ /**
+ * Test calls the method and forces object environment recreation. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> available() </code> </li>
+ * <li> <code> readBytes() </code> </li>
+ * <li> <code> readSomeBytes() </code> </li>
+ * <li> <code> skipBytes() </code> </li>
+ * </ul>
+ */
+ public void _closeInput() {
+ executeMethod("available()") ;
+ executeMethod("readBytes()") ;
+ executeMethod("readSomeBytes()") ;
+ executeMethod("skipBytes()") ;
+
+ boolean result = true ;
+ try {
+ oObj.closeInput() ;
+ } catch (com.sun.star.io.IOException e){
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("closeInput()", result) ;
+ tEnv.dispose() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XMarkableStream.java b/qadevOOo/tests/java/ifc/io/_XMarkableStream.java
new file mode 100644
index 000000000000..afe9b9b56647
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XMarkableStream.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMarkableStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.io.XMarkableStream;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.io.XMarkableStream</code>
+* interface methods:
+* <ul>
+* <li><code>createMark()</code></li>
+* <li><code>deleteMark()</code></li>
+* <li><code>jumpToFurthest()</code></li>
+* <li><code>jumpToMark()</code></li>
+* <li><code>offsetToMark()</code></li>
+* </ul> <p>
+* @see com.sun.star.io.XMarkableStream
+*/
+public class _XMarkableStream extends MultiMethodTest {
+
+ public XMarkableStream oObj = null;
+ private int mark = -1 ;
+
+ /**
+ * Test creates mark and stores it. <p>
+ * Has <b> OK </b> status if no exceptions were thrown
+ * and returned isn't less than zero. <p>
+ */
+ public void _createMark() {
+ boolean res;
+ try {
+ mark = oObj.createMark() ;
+ res = mark >= 0;
+ } catch (com.sun.star.io.IOException e) {
+ log.println("Couldn't create mark");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("createMark()", res);
+ }
+
+ /**
+ * Test deletes the mark that was created by method <code>createMark()
+ * </code>.<p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createMark() </code> : to have mark </li>
+ * </ul>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> jumpToFurthest() </code></li>
+ * <li> <code> jumpToMark() </code></li>
+ * <li> <code> offsetToMark() </code></li>
+ * </ul>
+ */
+ public void _deleteMark() {
+ requiredMethod("createMark()") ;
+
+ executeMethod("jumpToFurthest()") ;
+ executeMethod("jumpToMark()") ;
+ executeMethod("offsetToMark()") ;
+
+ boolean res;
+ try {
+ oObj.deleteMark(mark);
+ res = true;
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't delete mark");
+ e.printStackTrace(log);
+ res = false;
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't delete mark");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("deleteMark()", res) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createMark() </code></li>
+ * </ul>
+ */
+ public void _jumpToFurthest() {
+ requiredMethod("createMark()") ;
+
+ boolean res;
+ try {
+ oObj.jumpToFurthest() ;
+ res = true;
+ } catch (com.sun.star.io.IOException e) {
+ log.println("Couldn't jump to furthest");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("jumpToFurthest()", res) ;
+ }
+
+ /**
+ * Test jumps to mark that was created by method <code>createMark()</code>.
+ * <p>Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> jumpToFurthest() </code> : for the right order of tests
+ * excecution </li>
+ * </ul>
+ */
+ public void _jumpToMark() {
+ requiredMethod("jumpToFurthest()") ;
+ boolean res;
+
+ try {
+ oObj.jumpToMark(mark) ;
+ res = true;
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't jump to mark");
+ e.printStackTrace(log);
+ res = false;
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't jump to mark");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("jumpToMark()", res) ;
+ }
+
+ /**
+ * Test obtains offset to mark that was created by
+ * method <code>createMark()</code> and checks returned value.<p>
+ * Has <b> OK </b> status if returned value is equal to zero
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> jumpToMark() </code> : to have current position at
+ * the mark position </li>
+ * </ul>
+ */
+ public void _offsetToMark() {
+
+ requiredMethod("jumpToMark()") ;
+
+ boolean res;
+ try {
+ int offset = oObj.offsetToMark(mark);
+ res = offset == 0;
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't get offser to mark");
+ e.printStackTrace(log);
+ res = false;
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't get offser to mark");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("offsetToMark()", res);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XObjectInputStream.java b/qadevOOo/tests/java/ifc/io/_XObjectInputStream.java
new file mode 100644
index 000000000000..e6395b0937f7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XObjectInputStream.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XObjectInputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.io.XObjectInputStream;
+import com.sun.star.io.XObjectOutputStream;
+import com.sun.star.io.XPersistObject;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.io.XObjectInputStream</code>
+* interface methods:
+* <ul>
+* <li><code>readObject()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'PersistObject'</code> (of type <code>Object</code>):
+* object that supports interface <code>XPersistObject</code> </li>
+* <ul> <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.io.XObjectInputStream
+* @see com.sun.star.io.XPersistObject
+*/
+public class _XObjectInputStream extends MultiMethodTest {
+
+ public XObjectInputStream oObj = null;
+ private Object objRead = null ;
+ private Object objWrite = null ;
+
+ /**
+ * Test reads perisist object from stream and compares properties
+ * of the object with properties of persist object obtained
+ * from relation <code>'PersistObject'</code> <p>
+ * Has <b> OK </b> status if returned value isn't null and values
+ * of objects properties are equal. <p>
+ */
+ public void _readObject() {
+ objWrite = tEnv.getObjRelation("PersistObject") ;
+ if (objWrite == null) {
+ log.println("PersistObject not found in relations") ;
+ tRes.tested("readObject()", false) ;
+ return ;
+ }
+ XPersistObject xPO;
+ // write the object
+ try {
+ XObjectOutputStream oStream = (XObjectOutputStream)
+ tEnv.getObjRelation("StreamWriter");
+ oStream.writeObject((XPersistObject)objWrite);
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't write object to stream");
+ e.printStackTrace(log);
+ tRes.tested("readObject()", Status.skipped(false));
+ return;
+ }
+
+ try {
+ objRead = oObj.readObject() ;
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't read object from stream");
+ e.printStackTrace(log);
+ tRes.tested("readObject()", false) ;
+ return ;
+ }
+
+ if (objRead == null) {
+ log.println("No object was read.") ;
+ tRes.tested("readObject()", false) ;
+ return ;
+ }
+
+ XPropertySet props1 = null ;
+ XPropertySet props2 = null ;
+
+ props1 = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, objRead) ;
+
+ props2 = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, objWrite) ;
+
+ if (props1 == null) {
+ log.println("Object read doesn't implement XPropertySet") ;
+ tRes.tested("readObject()", false) ;
+ return ;
+ }
+ if (props2 == null) {
+ log.println("Object written doesn't implement XPropertySet") ;
+ tRes.tested("readObject()", false) ;
+ return ;
+ }
+
+ tRes.tested("readObject()",
+ compareProperties(props1, props2)) ;
+ }
+
+ protected boolean compareProperties(XPropertySet props1,
+ XPropertySet props2) {
+
+ Property[] p1 = props1.getPropertySetInfo().getProperties() ;
+ Property[] p2 = props2.getPropertySetInfo().getProperties() ;
+
+ if (p1.length != p2.length) {
+ log.println("Number of properties differs") ;
+ return false ;
+ }
+
+ boolean result = true ;
+
+ for (int i = 0; i < p1.length; i++) {
+ String propName = p1[i].Name ;
+
+ log.print("Comparing property '" + propName + "' ...") ;
+ boolean res = false ;
+ try {
+ res = ValueComparer.equalValue
+ (props1.getPropertyValue(propName),
+ props2.getPropertyValue(propName)) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Not found !") ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(e) ;
+ }
+
+ if (res)
+ log.println("OK.") ;
+ else
+ log.println("Different !") ;
+
+ result &= res ;
+ }
+
+ return result ;
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ public void after() {
+ tEnv.dispose() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XObjectOutputStream.java b/qadevOOo/tests/java/ifc/io/_XObjectOutputStream.java
new file mode 100644
index 000000000000..580a43c8c592
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XObjectOutputStream.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XObjectOutputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.io.XObjectInputStream;
+import com.sun.star.io.XObjectOutputStream;
+import com.sun.star.io.XPersistObject;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.io.XObjectOutputStream</code>
+* interface methods:
+* <ul>
+* <li><code>writeObject()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'InputStream'</code> (of type <code>XObjectInputStream</code>)</li>
+* persist object for testing of write to stream</ul>
+* @see com.sun.star.io.XObjectInputStream
+* @see com.sun.star.io.XObjectOutputStream
+* @see com.sun.star.io.XPersistObject
+*/
+public class _XObjectOutputStream extends MultiMethodTest {
+
+ public XObjectOutputStream oObj = null;
+
+ /**
+ * Test creates persist object, sets label of object,
+ * calls the method for created persist object
+ * and checks label of object that was read from input stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and labels are equals. <p>
+ */
+ public void _writeObject() throws Exception {
+ XObjectInputStream oInStream = (XObjectInputStream)
+ tEnv.getObjRelation("InputStream");
+ if (oInStream == null) throw
+ new StatusException(Status.failed("Relation 'InputStream' failed"));
+
+ // use own implementation of XPersistObject, so test runs
+ // without an office
+ XPersistObject objWrite = (XPersistObject)
+ tEnv.getObjRelation("PersistObject");
+ if (objWrite == null) throw
+ new StatusException(Status.failed("Relation 'PersistObject' failed"));
+
+ XPropertySet propObjWrite = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, objWrite);
+
+ // This XPersistObject has a property called 'String'
+ propObjWrite.setPropertyValue("String", "XObjectOutputStream");
+
+ log.println("Writing object with label 'XObjectOutputStream'");
+ oObj.writeObject(objWrite);
+ XPersistObject readObj = oInStream.readObject();
+ XPropertySet propSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, readObj);
+ String label = (String)propSet.getPropertyValue("String");
+ log.println("Object with label '" + label + "' was read");
+
+ tRes.tested("writeObject()", label.equals("XObjectOutputStream")) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XOutputStream.java b/qadevOOo/tests/java/ifc/io/_XOutputStream.java
new file mode 100644
index 000000000000..6631b23f665f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XOutputStream.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XOutputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.io.XOutputStream</code>
+* interface methods:
+* <ul>
+* <li><code>writeBytes()</code></li>
+* <li><code>flush()</code></li>
+* <li><code>closeOutput()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'ByteData'</code> : Data that is written on the stream.
+* </li>
+* <li> <code>'XOutputStream.StreamChecker'</code> : <code>
+* _XOutputStream.StreamChecker</code> interface implementation
+* which can reset streams and return input stream for check if the
+* data was successfully written.</li>
+* <ul> <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.io.XOutputStream
+*/
+public class _XOutputStream extends MultiMethodTest {
+
+ public XOutputStream oObj = null;
+ StreamChecker checker = null;
+ byte[] data = null;
+
+ public static interface StreamChecker {
+ public XInputStream getInStream();
+ public void resetStreams();
+ }
+
+ protected void before() {
+ checker = (StreamChecker)
+ tEnv.getObjRelation("XOutputStream.StreamChecker");
+ if (checker == null) throw
+ new StatusException(Status.failed(
+ "Couldn't get relation 'XOutputStream.StreamChecker'"));
+
+ data = (byte[])tEnv.getObjRelation("ByteData");
+ if (data == null) throw
+ new StatusException(Status.failed(
+ "Couldn't get relation 'ByteData'"));
+ }
+ /**
+ * Test writes data to stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _writeBytes() {
+ boolean res = true;
+ try {
+ oObj.writeBytes(data);
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log) ;
+ res = false;
+ }
+
+ XInputStream xInStream = checker.getInStream();
+ byte[][] readData = new byte[1][data.length];
+ int iReadBytes = 0;
+ try {
+ iReadBytes = xInStream.readBytes(readData, data.length);
+ } catch(com.sun.star.io.IOException e) {
+ log.println("Couldn't read data:" + e);
+ res = false;
+ }
+
+ for(int i = 0; i < readData[0].length; i++) {
+ log.println("Expected: "+data[i]+", actual is "+readData[0][i]);
+ res &= readData[0][i] == data[i];
+ }
+
+ tRes.tested("writeBytes()", res);
+ }
+
+ /**
+ * Test flushes out data from stream. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> writeBytes() </code></li>
+ * </ul>
+ */
+ public void _flush() {
+ requiredMethod("writeBytes()");
+
+ boolean res;
+ try {
+ oObj.flush();
+ res = true;
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log) ;
+ res = false;
+ }
+
+ tRes.tested("flush()", res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> writeBytes() </code></li>
+ * </ul>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li><code> flush() </code></li>
+ * </ul>
+ */
+ public void _closeOutput() {
+ requiredMethod("writeBytes()");
+ executeMethod("flush()");
+
+ boolean res;
+ try {
+ oObj.closeOutput();
+ res = true;
+ } catch (com.sun.star.io.IOException e) {
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ log.println("This method is called in main module");
+
+ tRes.tested("closeOutput()", res);
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ public void after() {
+ tEnv.dispose() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/io/_XPersistObject.java b/qadevOOo/tests/java/ifc/io/_XPersistObject.java
new file mode 100644
index 000000000000..a2ff34e2ef83
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/io/_XPersistObject.java
@@ -0,0 +1,305 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPersistObject.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.io;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+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.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+import util.dbg;
+import util.utils;
+
+
+/**
+* Testing <code>com.sun.star.io.XPersistObject</code>
+* interface methods :
+* <ul>
+* <li><code> getServiceName()</code></li>
+* <li><code> write()</code></li>
+* <li><code> read()</code></li>
+* </ul> <p>
+* This test need the following object relations :
+* <ul>
+* <li> <code>'OBJNAME'</code> : <code>String</code> value that
+* contains service name which object represents.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.io.XPersistObject
+* @see com.sun.star.io.XObjectInputStream
+* @see com.sun.star.io.XObjectOutputStream
+*/
+public class _XPersistObject extends MultiMethodTest {
+
+ public XPersistObject oObj = null;
+ XObjectInputStream iStream = null;
+ XObjectOutputStream oStream = null;
+ String sname = null;
+
+ boolean result = true;
+
+
+ /**
+ * Test calls the method and checks return value. <p>
+ * Has <b> OK </b> status if the method returns proper service names
+ * which is equal to <code>'OBJNAME'</code> relation value. <p>
+ */
+ public void _getServiceName() {
+ result = true;
+ sname = oObj.getServiceName();
+ log.println("Method returned '" + sname + "'") ;
+ String objName = (String)tEnv.getObjRelation("OBJNAME");
+ if (objName == null) {
+ log.println("No OBJNAME relation!");
+ result = false;
+ } else {
+ result &= sname.equals(objName);
+ if (!result)
+ log.println("Name of object must be '" + objName +
+ "' but returned name is '" + sname +"'");
+ }
+
+ tRes.tested("getServiceName()", result);
+ }
+
+ /**
+ * Creates service get by <code>getServiceName</code> method and tries
+ * to read object written to stream by <code>write</code> method test.
+ * Then properties of object written and object read are compared. <p>
+ * Has <b>OK</b> status if all properties of two objects are equal
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getServiceName() </code> : to have service name
+ * which has to be created </li>
+ * <li> <code> write() </code> : to write object tested into stream</li>
+ * </ul>
+ */
+ public void _read() {
+ requiredMethod("getServiceName()");
+ requiredMethod("write()") ;
+
+ boolean bResult = true;
+
+ try {
+ Object noPS = tEnv.getObjRelation("noPS");
+ if ( noPS == null) {
+ XPropertySet objps = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, oObj);
+ XPropertySetInfo objpsi = objps.getPropertySetInfo();
+ Property[] objprops = objpsi.getProperties();
+
+ Object oCopy = tParam.getMSF().createInstance(sname);
+
+ XPersistObject persCopy = (XPersistObject)
+ UnoRuntime.queryInterface(XPersistObject.class, oCopy);
+
+ persCopy.read(iStream);
+
+ XPropertySet copyps = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, oCopy);
+
+ XPropertySetInfo copypsi = copyps.getPropertySetInfo();
+ Property[] copyprops = copypsi.getProperties();
+
+ for (int i = 0; i < copyprops.length; i++) {
+ Object cps = copyps.getPropertyValue(copyprops[i].Name);
+ Object ops = objps.getPropertyValue(objprops[i].Name);
+ boolean locRes = ( (ValueComparer.equalValue(cps,ops)) ||
+ (utils.isVoid(cps) && utils.isVoid(ops)) );
+
+ //transient properties aran't stored
+ if (isTransient(objprops[i])) locRes = true;
+
+ Object pseudo = tEnv.getObjRelation("PSEUDOPERSISTENT");
+ if ( (pseudo != null) && !locRes) {
+ String str = copyprops[i].Name;
+ locRes = ( (str.equals("Time")) || (str.equals("Date"))
+ || (str.equals("FormatsSupplier"))
+ || (str.equals("Text"))
+ || (str.equals("Value"))
+ );
+ }
+ if (!locRes) {
+ log.println("Property '" + copyprops[i].Name
+ + "' failed");
+ dbg.printPropertyInfo(objps, objprops[i].Name, log);
+ dbg.printPropertyInfo(copyps, copyprops[i].Name, log);
+ }
+ bResult &= locRes;
+ }
+ } else {
+ Object oCopy = tParam.getMSF().createInstance(sname);
+ XPersistObject persCopy = (XPersistObject)
+ UnoRuntime.queryInterface(XPersistObject.class, oCopy);
+
+ XPropertySet copyps = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, oCopy);
+
+ persCopy.read(iStream);
+
+ bResult = ( persCopy.getServiceName().equals(sname) );
+
+ }
+
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception occured : ");
+ e.printStackTrace(log) ;
+ bResult = false;
+ }
+
+ tRes.tested("read()", bResult);
+ }
+
+ /**
+ * Test calls the method and checks that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _write() {
+ boolean bResult = true;
+ try {
+ initPipe();
+ oObj.write(oStream);
+ } catch (com.sun.star.io.IOException e) {
+ log.println("Exception occured while test. " + e);
+ bResult = false;
+ }
+ tRes.tested("write()", bResult);
+ }
+
+
+ /**
+ * Creates the following stream scheme <code>
+ * ObjectOutputStream -> Pipe -> ObjectInputStream </code> for writing/reading
+ * object.
+ */
+ protected void initPipe() {
+ try {
+ XPersistObject xpers = (XPersistObject)UnoRuntime.queryInterface
+ (XPersistObject.class,oObj);
+ Object aPipe = tParam.getMSF().createInstance
+ ("com.sun.star.io.Pipe");
+ Object istream = tParam.getMSF().createInstance
+ ("com.sun.star.io.ObjectInputStream");
+ Object ostream = tParam.getMSF().createInstance
+ ("com.sun.star.io.ObjectOutputStream");
+
+ // Now the objects that aren't described anywhere
+ Object mistream = tParam.getMSF().createInstance
+ ("com.sun.star.io.MarkableInputStream");
+ Object mostream = tParam.getMSF().createInstance
+ ("com.sun.star.io.MarkableOutputStream");
+
+ XActiveDataSink xdSi = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, istream);
+ XActiveDataSource xdSo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
+ XActiveDataSink xdSmi = (XActiveDataSink)
+ UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+ XActiveDataSource xdSmo = (XActiveDataSource)
+ UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+
+ XInputStream miStream = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, mistream);
+ XOutputStream moStream = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class, mostream);
+ XInputStream PipeIn = (XInputStream)
+ UnoRuntime.queryInterface(XInputStream.class, aPipe);
+ XOutputStream PipeOut = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.class,aPipe);
+
+ xdSi.setInputStream(miStream);
+ xdSo.setOutputStream(moStream);
+ xdSmi.setInputStream(PipeIn);
+ xdSmo.setOutputStream(PipeOut);
+
+ iStream = (XObjectInputStream)
+ UnoRuntime.queryInterface(XObjectInputStream.class, istream);
+ oStream = (XObjectOutputStream)
+ UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
+
+
+ } catch (com.sun.star.uno.Exception e) {
+ System.out.println("exc " + e);
+ }
+
+ }
+
+ public static boolean isTransient(Property prop) {
+ short attr = prop.Attributes;
+ return ((attr & com.sun.star.beans.PropertyAttribute.TRANSIENT) != 0);
+ }
+
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/java/_XJavaThreadRegister_11.java b/qadevOOo/tests/java/ifc/java/_XJavaThreadRegister_11.java
new file mode 100644
index 000000000000..c7ea863377c4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/java/_XJavaThreadRegister_11.java
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XJavaThreadRegister_11.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.java;
+
+import com.sun.star.java.XJavaThreadRegister_11;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.java.XJavaThreadRegister_11</code>
+* interface methods :
+* <ul>
+* <li><code> isThreadAttached()</code></li>
+* <li><code> registerThread()</code></li>
+* <li><code> revokeThread()</code></li>
+* </ul> <p>
+* <b> Nothing tested here. </b>
+* @see com.sun.star.java.XJavaThreadRegister_11
+*/
+public class _XJavaThreadRegister_11 extends MultiMethodTest {
+ public XJavaThreadRegister_11 oObj;
+
+ protected void after() {
+ log.println("Skipping all XJavaThreadRegister_11 methods, since they"
+ + " can't be tested in the context");
+ throw new StatusException(Status.skipped(true));
+ }
+
+ public void _isThreadAttached() {
+ // skipping the test
+ tRes.tested("isThreadAttached()", true);
+ }
+
+ public void _registerThread() {
+ // skipping the test
+ tRes.tested("registerThread()", true);
+ }
+
+ public void _revokeThread() {
+ // skipping the test
+ tRes.tested("revokeThread()", true);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/java/_XJavaVM.java b/qadevOOo/tests/java/ifc/java/_XJavaVM.java
new file mode 100644
index 000000000000..4470276476b1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/java/_XJavaVM.java
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XJavaVM.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.java;
+
+import com.sun.star.java.XJavaVM;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.java.XJavaVM</code>
+* interface methods :
+* <ul>
+* <li><code> getJavaVM()</code></li>
+* <li><code> isVMStarted()</code></li>
+* <li><code> isVMEnabled()</code></li>
+* </ul> <p>
+* <b> Nothing tested here. </b>
+* @see com.sun.star.java.XJavaVM
+*/
+public class _XJavaVM extends MultiMethodTest {
+ public XJavaVM oObj;
+
+ protected void after() {
+ log.println("Skipping all XJavaVM methods, since they"
+ + " can't be tested in the context");
+ throw new StatusException(Status.skipped(true));
+ }
+
+ public void _getJavaVM() {
+ // skipping the test
+ tRes.tested("getJavaVM()", true);
+ }
+
+ public void _isVMEnabled() {
+ // skipping the test
+ tRes.tested("isVMEnabled()", true);
+ }
+
+ public void _isVMStarted() {
+ // skipping the test
+ tRes.tested("isVMStarted()", true);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/lang/_ServiceManager.java b/qadevOOo/tests/java/ifc/lang/_ServiceManager.java
new file mode 100644
index 000000000000..f69f5b7a1eb9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_ServiceManager.java
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ServiceManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.uno.XComponentContext;
+import lib.MultiPropertyTest;
+
+public class _ServiceManager extends MultiPropertyTest {
+
+ public void _DefaultContext() {
+ XComponentContext get = null;
+ boolean res = false;
+ try {
+ get = (XComponentContext) oObj.getPropertyValue("DefaultContext");
+ res = get != null;
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ log.println("Property is optional and not supported");
+ res = true;
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ log.println("Unexpected Exception");
+ wte.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("DefaultContext", get != null);
+
+ }
+
+} // EOF _ServiceManager
+
diff --git a/qadevOOo/tests/java/ifc/lang/_XComponent.java b/qadevOOo/tests/java/ifc/lang/_XComponent.java
new file mode 100644
index 000000000000..b7184e4bea4e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_XComponent.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XComponent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XEventListener;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.lang.XComponent</code>
+* interface methods :
+* <ul>
+* <li><code> dispose()</code></li>
+* <li><code> addEventListener()</code></li>
+* <li><code> removeEventListener()</code></li>
+* </ul>
+* After this interface test object <b>must be recreated</b>. <p>
+* Multithreaded test ability <b>not implemented</b> yet.
+* @see com.sun.star.lang.XComponent
+*/
+public class _XComponent extends MultiMethodTest {
+
+ public static XComponent oObj = null;
+
+ boolean listenerDisposed[] = new boolean[2];
+ String[] Loutput = new String[2];
+
+ /**
+ * Listener which added but not removed, and its method must be called
+ * on <code>dispose</code> call.
+ */
+ public class MyEventListener implements XEventListener {
+ public void disposing ( EventObject oEvent ) {
+ Loutput[0] = Thread.currentThread() + " is DISPOSING EV1" + this;
+ listenerDisposed[0] = true;
+ }
+ };
+
+ /**
+ * Listener which added and then removed, and its method must <b>not</b>
+ * be called on <code>dispose</code> call.
+ */
+ public class MyEventListener2 implements XEventListener {
+ public void disposing ( EventObject oEvent ) {
+ Loutput[0] = Thread.currentThread() + " is DISPOSING EV2" + this;
+ listenerDisposed[1] = true;
+ }
+ };
+
+ XEventListener listener1 = new MyEventListener();
+ XEventListener listener2 = new MyEventListener2();
+
+ /**
+ * Adds two listeners. <p>
+ * Has OK status if then the first listener will receive an event
+ * on <code>dispose</code> method call.
+ */
+ public void _addEventListener() {
+
+ listenerDisposed[0] = false;
+ listenerDisposed[1] = false;
+
+ oObj.addEventListener( listener1 );
+ oObj.addEventListener( listener2 );
+
+ return;
+ } // finished _addEventListener()
+
+ /**
+ * Removes the second of two added listeners. <p>
+ * Method tests to be completed successfully :
+ * <ul>
+ * <li> <code>addEventListener</code> : method must add two listeners. </li>
+ * </ul> <p>
+ * Has OK status if no events will be sent to the second listener on
+ * <code>dispose</code> method call.
+ */
+ public void _removeEventListener() {
+ executeMethod("addEventListener()");
+ if (disposed) return;
+ // the second listener should not be called
+ oObj.removeEventListener( listener2 );
+ log.println(Thread.currentThread() + " is removing EL " + listener2);
+ } // finished _removeEventListener()
+
+ static boolean disposed = false;
+
+ /**
+ * Disposes the object and then check appropriate listeners were
+ * called or not. <p>
+ * Method tests to be completed successfully :
+ * <ul>
+ * <li> <code>removeEventListener</code> : method must remove one of two
+ * listeners. </li>
+ * </ul> <p>
+ * Has OK status if liseter removed wasn't called and other listener
+ * was.
+ */
+ public void _dispose() {
+ disposed = false;
+ executeMethod("removeEventListener()");
+
+ log.println( "begin dispose" + Thread.currentThread());
+ XDesktop oDesk = (XDesktop) tEnv.getObjRelation("Desktop");
+ if (oDesk !=null) oDesk.terminate(); else oObj.dispose();
+ try {
+ Thread.sleep(500) ;
+ } catch (InterruptedException e) {}
+ if (Loutput[0]!=null) log.println(Loutput[0]);
+ if (Loutput[1]!=null) log.println(Loutput[1]);
+ log.println( "end dispose" + Thread.currentThread());
+ disposed = true;
+
+ // check that dispose() works OK.
+ tRes.tested("addEventListener()", listenerDisposed[0]);
+ tRes.tested("removeEventListener()", !listenerDisposed[1]);
+ tRes.tested("dispose()", listenerDisposed[0] && !listenerDisposed[1]);
+
+ } // finished _dispose()
+
+ /**
+ * Forces object recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+} // finished class _XComponent
+
+
diff --git a/qadevOOo/tests/java/ifc/lang/_XEventListener.java b/qadevOOo/tests/java/ifc/lang/_XEventListener.java
new file mode 100644
index 000000000000..ab583672f862
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_XEventListener.java
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XEventListener.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.lang.XEventListener;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.lang.XEventListener</code>
+* interface methods :
+* <ul>
+* <li><code> disposing()</code></li>
+* </ul> <p>
+* Tests nothing, all methods has <b>OK</b> status.
+* @see com.sun.star.lang.XEventListener
+*/
+public class _XEventListener extends MultiMethodTest {
+
+ public XEventListener oObj = null;
+
+ /**
+ * Nothing to test. Always has <b>OK</b> status.
+ */
+ public void _disposing() {
+ log.println("The method 'disposing'");
+ log.println("gets called when the broadcaster is about to be"+
+ " disposed.") ;
+ log.println("All listeners and all other objects which reference "+
+ "the broadcaster should release the references.");
+ log.println("So there is nothing to test here");
+ tRes.tested("disposing()",true);
+
+ }
+
+} //EOF of XEventListener
+
diff --git a/qadevOOo/tests/java/ifc/lang/_XInitialization.java b/qadevOOo/tests/java/ifc/lang/_XInitialization.java
new file mode 100644
index 000000000000..10ed742e7873
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_XInitialization.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XInitialization.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.lang.XInitialization;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.lang.XInitialization</code>
+* interface methods. <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XInitialization.args'</code> (of type <code>Object[]</code>):
+* (<b>Optional</b>) : argument for <code>initialize</code>
+* method. If ommitet zero length array is used. </li>
+* <ul> <p>
+* Test is multithread compilant. <p>
+* Till the present time there was no need to recreate environment
+* after this test completion.
+*/
+public class _XInitialization extends MultiMethodTest {
+
+ public static XInitialization oObj = null;
+
+ /**
+ * Test calls the method with 0 length array and checks that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _initialize() {
+ boolean result = true ;
+
+ try {
+ Object[] args = (Object[]) tEnv.getObjRelation("XInitialization.args");
+ if (args==null) {
+ oObj.initialize(new Object[0]);
+ } else {
+ oObj.initialize(args);
+ }
+
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception occured while method calling.") ;
+ log.println(e) ;
+ result = false ;
+ }
+
+ tRes.tested("initialize()", result) ;
+ } // finished _initialize()
+
+ /**
+ * Disposes object environment.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+
+} // finished class _XInitialization
+
+
diff --git a/qadevOOo/tests/java/ifc/lang/_XMultiComponentFactory.java b/qadevOOo/tests/java/ifc/lang/_XMultiComponentFactory.java
new file mode 100644
index 000000000000..5818c66f5ede
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_XMultiComponentFactory.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMultiComponentFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.lang.XMultiComponentFactory;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.lang.XMultiComponentFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createInstanceWithContext()</code></li>
+* <li><code> createInstanceWithArgumentsAndContext()</code></li>
+* <li><code> getAvailableServiceNames()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.lang.XMultiComponentFactory
+*/
+public class _XMultiComponentFactory extends MultiMethodTest {
+ public XMultiComponentFactory oObj = null;
+
+ public XComponentContext xContext = null;
+
+ public void before(){
+ xContext = (XComponentContext)tEnv.getObjRelation("DC");
+ }
+
+ /**
+ * Calls the method with one of the available service names
+ * obtained by method getAvailableServiceNames. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is not null.
+ */
+ public void _createInstanceWithContext() {
+ requiredMethod("getAvailableServiceNames()");
+ boolean result = true;
+
+ try {
+ XInterface component = (XInterface)
+ oObj.createInstanceWithContext(
+ availableServiceNames[0], xContext);
+ result = (component != null);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't create instance " + availableServiceNames[0]);
+ result = false;
+ }
+
+ tRes.tested("createInstanceWithContext()", result);
+ }
+
+ /**
+ * Calls the method with one of the available service names
+ * obtained by method getAvailableServiceNames. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is not null.
+ */
+ public void _createInstanceWithArgumentsAndContext() {
+ requiredMethod("getAvailableServiceNames()");
+ boolean result = true;
+
+ try {
+ XInterface component = (XInterface)
+ oObj.createInstanceWithArgumentsAndContext(
+ availableServiceNames[0], new Object[0], xContext);
+ result = (component != null);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't create instance " + availableServiceNames[0]);
+ result = false;
+ }
+
+ tRes.tested("createInstanceWithArgumentsAndContext()", result);
+ }
+
+ String[] availableServiceNames;
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is not null.
+ */
+ public void _getAvailableServiceNames() {
+ availableServiceNames = oObj.getAvailableServiceNames();
+
+ log.println("Available service names:");
+ for(int i = 0; i < availableServiceNames.length; i++) {
+ log.println(" " + availableServiceNames[i]);
+ }
+
+ tRes.tested("getAvailableServiceNames()", availableServiceNames != null);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/lang/_XMultiServiceFactory.java b/qadevOOo/tests/java/ifc/lang/_XMultiServiceFactory.java
new file mode 100644
index 000000000000..f45cd3fc14bb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_XMultiServiceFactory.java
@@ -0,0 +1,199 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMultiServiceFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.lang.XMultiServiceFactory</code>
+* interface methods:
+* <ul>
+* <li><code>createInstance()</code></li>
+* <li><code>createInstanceWithArguments()</code></li>
+* <li><code>getAvailableServiceNames()</code></li>
+* </ul> <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XMSF.serviceNames'</code> (of type <code>String[]</code>)
+* <b>optional</b>:
+* the relation used when service names are obtained the way
+* other than calling <code>getAvailableServiceNames()</code>
+* method.
+* </li>
+* <li> <code>'XMSF.serviceNamesWithArgs'</code> (of type <code>String[]</code>)
+* <b>optional</b>:
+* the relation used when service names are obtained the way
+* other than calling <code>getAvailableServiceNames()</code>
+* method for testing <code>createInstanceWithArguments</code> method.
+* </li>
+* <li> <code>'XMSF.Args'</code> (of type <code>Object[][]</code>)
+* <b>optional</b>:
+* if this relation exists than the method
+* <code>createInstanceWithArguments</code> is tested. This relation
+* supplies arguments for creating instances. If the relation
+* <code>'XMSF.serviceNamesWithArgs'</code> is also specified
+* then for each service name from that relation appropriate arguments
+* are used from arguments array. If not than arguments with index
+* 0 are used for services creation obtained by
+* <code>getAvailableServiceNames</code> method.
+* </li>
+* </ul> <p>
+*
+* @see com.sun.star.lang.XMultiServiceFactory
+*/
+public class _XMultiServiceFactory extends MultiMethodTest {
+
+ public XMultiServiceFactory oObj = null;
+ public String[] services = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getAvailableServiceNames() {
+ services = oObj.getAvailableServiceNames();
+ tRes.tested("getAvailableServiceNames()",services != null);
+ }
+
+ /**
+ * Test creates instance of the first service from names array
+ * get by <code>getAvailableServiceNames()</code>. If the array
+ * is empty than test looks for names from relation. <p>
+ *
+ * Has <b> OK </b> status if created instance isn't null. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getAvailableServiceNames() </code> : to have list of
+ * supported services </li>
+ * </ul>
+ */
+ public void _createInstance() {
+ requiredMethod("getAvailableServiceNames()");
+
+ if (services.length == 0) {
+ services = (String[]) tEnv.getObjRelation("XMSF.serviceNames");
+ if (services == null) {
+ log.println("No service to create.") ;
+ tRes.tested("createInstance()", true);
+ return;
+ }
+ }
+
+ try {
+ log.println("Creating Instance: " + services[0]);
+ Object Inst = oObj.createInstance(services[0]);
+ tRes.tested("createInstance()",Inst != null);
+ } catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured during createInstance()");
+ ex.printStackTrace(log);
+ tRes.tested("createInstance()",false);
+ }
+ }
+
+ /**
+ * If the relation with arguments is not specified test does nothing.
+ * In other case it tries to create instance by its name from
+ * relation of from array <code>getAvailableServiceNames()</code>
+ * method supplied. <p>
+ *
+ * Has <b> OK </b> status if the created instance is not null. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getAvailableServiceNames() </code> : to have list of
+ * supported services </li>
+ * </ul>
+ */
+ public void _createInstanceWithArguments() {
+ requiredMethod("getAvailableServiceNames()");
+
+ Object[][] args = (Object[][])
+ tEnv.getObjRelation("XMSF.Args");
+ String[] sNames = (String[])
+ tEnv.getObjRelation("XMSF.serviceNamesWithArgs");
+
+ if (args == null) {
+ log.println("Relation 'XMSF.serviceNamesWithArgs' not found");
+ log.println("The component assumed not support " +
+ "createInstanceWithArguments()");
+ tRes.tested("createInstanceWithArguments()",true);
+ } else {
+ if (sNames == null) sNames = services;
+ log.println("Creating service '" + sNames[0] + "' with arguments");
+ try {
+ Object Inst = oObj.createInstanceWithArguments
+ (sNames[0], args[0]);
+ tRes.tested("createInstanceWithArguments()",Inst != null);
+ } catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured during createInstanceWithArguments()");
+ ex.printStackTrace(log);
+ tRes.tested("createInstanceWithArguments()",false);
+ }
+ }
+ }
+} // finish class _XMultiServiceFactory
+
+
diff --git a/qadevOOo/tests/java/ifc/lang/_XServiceDisplayName.java b/qadevOOo/tests/java/ifc/lang/_XServiceDisplayName.java
new file mode 100644
index 000000000000..bd63a1117f20
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_XServiceDisplayName.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XServiceDisplayName.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.lang.Locale;
+import com.sun.star.lang.XServiceDisplayName;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.lang.XServiceDisplayName</code>
+* interface methods:
+* <ul>
+* <li><code>getServiceDisplayName()</code></li>
+* </ul> <p>
+* @see com.sun.star.lang.XServiceDisplayName
+*/
+public class _XServiceDisplayName extends MultiMethodTest {
+
+ public XServiceDisplayName oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getServiceDisplayName() {
+ String dn = oObj.getServiceDisplayName(new Locale("de","DE",""));
+
+ tRes.tested("getServiceDisplayName()", dn != null);
+ }
+
+} // finish class MTest
+
+
diff --git a/qadevOOo/tests/java/ifc/lang/_XServiceInfo.java b/qadevOOo/tests/java/ifc/lang/_XServiceInfo.java
new file mode 100644
index 000000000000..a60e6095b4dc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_XServiceInfo.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XServiceInfo.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.lang.XServiceInfo;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.lang.XServiceInfo</code>
+* interface methods :
+* <ul>
+* <li><code> getImplementationName()</code></li>
+* <li><code> supportsService()</code></li>
+* <li><code> getSupportedServiceNames()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.lang.XServiceInfo
+*/
+public class _XServiceInfo extends MultiMethodTest {
+ public static XServiceInfo oObj = null;
+ public static String[] names = null;
+
+ /**
+ * Just calls the method.<p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getImplementationName() {
+ boolean result = true;
+ log.println("testing getImplementationName() ... ");
+
+ log.println("The ImplementationName ist "+oObj.getImplementationName());
+ result=true;
+
+ tRes.tested("getImplementationName()", result);
+
+ } // end getImplementationName()
+
+
+ /**
+ * Just calls the method.<p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getSupportedServiceNames() {
+ boolean result = true;
+ log.println("getting supported Services...");
+ names = oObj.getSupportedServiceNames();
+ for (int i=0;i<names.length;i++) {
+ int k = i+1;
+ log.println(k+". Supported Service is "+names[i]);
+ }
+ result=true;
+
+ tRes.tested("getSupportedServiceNames()", result);
+
+ } // end getSupportedServiceNames()
+
+ /**
+ * Gets one of the service names returned by
+ * <code>getSupportedServiceNames</code> method and
+ * calls the <code>supportsService</code> methos with this
+ * name. <p>
+ * Has <b>OK</b> status if <code>true</code> value is
+ * returned.
+ */
+ public void _supportsService() {
+ log.println("testing supportsService");
+ names = oObj.getSupportedServiceNames();
+ tRes.tested("supportsService()", oObj.supportsService(names[0]));
+ } // end supportsService()
+}
+
diff --git a/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java b/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java
new file mode 100644
index 000000000000..d9c6d3f48267
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_XSingleServiceFactory.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSingleServiceFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+
+/**
+/**
+* Testing <code>com.sun.star.</code>
+* interface methods :lang.XSingleServiceFactory
+* <ul>
+* <li><code> createInstance()</code></li>
+* <li><code> createInstanceWithArguments()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XSingleServiceFactory.createInstance.negative'</code> :
+* <code>String</code> relation; If its value 'true' then
+* <code>createInstance</code> method for the object isn't
+* supported. </li>
+* <li> <code>'XSingleServiceFactory.arguments'</code> <b>(optional)</b>:
+* 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. </li>
+* <li> <code>'XSingleServiceFactory.MustSupport'</code> <b>(optional)</b>:
+* of type <code>java.lang.Class[]</code>. This is an array of UNO
+* interface classes which must be supported by created instance.
+* </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.lang.XSingleServiceFactory
+*/
+public class _XSingleServiceFactory extends MultiMethodTest {
+
+ public XSingleServiceFactory oObj = null;
+ private Class[] mustSupport = null ;
+
+ public void before() {
+ mustSupport = (Class[]) tEnv.getObjRelation
+ ("XSingleServiceFactory.MustSupport") ;
+ }
+
+ /**
+ * Just calls the method and check the value returned. <p>
+ *
+ * Has <b>OK</b> status in case if this method is supported
+ * by object and non null value is returned, or if
+ * this method isn't supported then the method call must
+ * rise an exception or return <code>null</code> value.
+ * If the relation exists which specifies required interfaces
+ * supported by created instance then status is <b>OK</b>
+ * if all these interfaces are supported.
+ */
+ public void _createInstance() {
+ // for some objects the method should fail.
+ // If thi is required the property is set to true.
+ String negStr = (String)tEnv.getObjRelation(
+ "XSingleServiceFactory.createInstance.negative");
+ boolean negative = (negStr != null && negStr.equalsIgnoreCase("true"));
+
+ if (negative) {
+ log.println("Negative test: createInstance should fail");
+ }
+
+ try {
+ log.println("Creating Instance: ");
+ Object Inst = oObj.createInstance();
+ boolean bOK = Inst != null ;
+
+ if (mustSupport != null && bOK) {
+ for (int i = 0; i < mustSupport.length; i++) {
+ Object ifc = UnoRuntime.queryInterface(mustSupport[i], Inst) ;
+ if (ifc == null) {
+ log.println(" !!! Created instance doesn't support " +
+ mustSupport[i].toString()) ;
+ }
+ bOK &= ifc != null ;
+ }
+ }
+
+ tRes.tested("createInstance()",
+ (negative && Inst == null) || (!negative && bOK));
+ } catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured during createInstance()");
+ if (negative) {
+ ex.printStackTrace(log);
+ }
+ tRes.tested("createInstance()", negative);
+ }
+ }
+
+ /**
+ * Calls the method and checks the value returned. If relation
+ * with method argument doesn't exist new zerro length array
+ * is created. <p>
+ * Has <b>OK</b> status if non null value is returned.
+ * If the relation exists which specifies required interfaces
+ * supported by created instance then status is <b>OK</b>
+ * if all these interfaces are supported.
+ */
+ public void _createInstanceWithArguments() {
+ Object[] arg = (Object[])tEnv.getObjRelation(
+ "XSingleServiceFactory.arguments");
+
+ if (arg == null) {
+ arg = new Object[0];
+ }
+
+ try {
+ boolean bOK = true ;
+ log.println("Creating Instance with Argument");
+ Object Inst = oObj.createInstanceWithArguments(arg);
+ bOK &= Inst != null ;
+
+ if (mustSupport != null) {
+ for (int i = 0; i < mustSupport.length; i++) {
+ Object ifc = UnoRuntime.queryInterface(mustSupport[i], Inst) ;
+ if (ifc == null) {
+ log.println(" !!! Created instance doesn't support " +
+ mustSupport[i].toString()) ;
+ }
+ bOK &= ifc != null ;
+ }
+ }
+
+ tRes.tested("createInstanceWithArguments()", bOK);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured during createInstanceWithArguments()");
+ ex.printStackTrace(log);
+ tRes.tested("createInstanceWithArguments()",false);
+ }
+ }
+
+} // finish class _XSingleServiceFactory
+
+
diff --git a/qadevOOo/tests/java/ifc/lang/_XTypeProvider.java b/qadevOOo/tests/java/ifc/lang/_XTypeProvider.java
new file mode 100644
index 000000000000..ecf84277a25a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/lang/_XTypeProvider.java
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTypeProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:10:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.lang;
+
+import com.sun.star.lang.XTypeProvider;
+import com.sun.star.uno.Type;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.lang.XTypeProvider</code>
+* interface methods :
+* <ul>
+* <li><code> getTypes()</code></li>
+* <li><code> getImplementationId()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.lang.XTypeProvider
+*/
+public class _XTypeProvider extends MultiMethodTest {
+
+ public static XTypeProvider oObj = null;
+ public static Type[] types = null;
+
+ /**
+ * Just calls the method.<p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getImplementationId() {
+ boolean result = true;
+ log.println("testing getImplementationId() ... ");
+
+ log.println("The ImplementationId is "+oObj.getImplementationId());
+ result = true;
+
+ tRes.tested("getImplementationId()", result);
+
+ } // end getImplementationId()
+
+
+ /**
+ * alls the method and checks the return value.<p>
+ * Has <b>OK</b> status if one of the return value equals to the
+ * type <code>com.sun.star.lang.XTypeProvider</code>.
+ */
+ public void _getTypes() {
+ boolean result = false;
+ log.println("getting Types...");
+ types = oObj.getTypes();
+ for (int i=0;i<types.length;i++) {
+ int k = i+1;
+ log.println(k+". Type is "+types[i].toString());
+ if (types[i].toString().equals
+ ("Type<com.sun.star.lang.XTypeProvider>")) {
+ result = true;
+ }
+ }
+ if (!result) {
+ log.println("Component must provide Type "
+ +"<com.sun.star.lang.XTypeProvider>");
+ }
+
+ tRes.tested("getTypes()", result);
+
+ } // end getTypes()
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_LinguProperties.java b/qadevOOo/tests/java/ifc/linguistic2/_LinguProperties.java
new file mode 100644
index 000000000000..8cd0dee31a73
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/linguistic2/_LinguProperties.java
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * $RCSfile: _LinguProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.linguistic2;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.linguistic2.LinguProperties</code>
+* service properties:
+* <ul>
+* <li><code>'IsGermanPreReform'</code></li>
+* <li><code>'IsUseDictionaryList'</code></li>
+* <li><code>'IsIgnoreControlCharacters'</code></li>
+* <li><code>'IsSpellUpperCase'</code></li>
+* <li><code>'IsSpellWithDigits'</code></li>
+* <li><code>'IsSpellCapitalization'</code></li>
+* <li><code>'HyphMinLeading'</code></li>
+* <li><code>'HyphMinTrailing'</code></li>
+* <li><code>'HyphMinWordLength'</code></li>
+* <li><code>'DefaultLocale'</code></li>
+* <li><code>'IsHyphAuto'</code></li>
+* <li><code>'IsHyphSpecial'</code></li>
+* <li><code>'IsSpellAuto'</code></li>
+* <li><code>'IsSpellHide'</code></li>
+* <li><code>'IsSpellInAllLanguages'</code></li>
+* <li><code>'IsSpellSpecial'</code></li>
+* <li><code>'IsWrapReverse'</code></li>
+* <li><code>'DefaultLocale_CJK'</code></li>
+* <li><code>'DefaultLocale_CTL'</code></li>
+* </ul>
+* @see com.sun.star.linguistic2.LinguProperties
+*/
+public class _LinguProperties extends MultiPropertyTest {
+} // finish class _LinguProperties
+
+
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XDictionaryList.java b/qadevOOo/tests/java/ifc/linguistic2/_XDictionaryList.java
new file mode 100644
index 000000000000..d2af9c03067c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XDictionaryList.java
@@ -0,0 +1,328 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDictionaryList.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.linguistic2;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.Locale;
+import com.sun.star.linguistic2.DictionaryListEvent;
+import com.sun.star.linguistic2.XDictionary;
+import com.sun.star.linguistic2.XDictionaryList;
+import com.sun.star.linguistic2.XDictionaryListEventListener;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.linguistic2.XDictionaryList</code>
+* interface methods:
+* <ul>
+* <li><code>getCount()</code></li>
+* <li><code>getDictionaries()</code></li>
+* <li><code>getDictionaryByName()</code></li>
+* <li><code>addDictionary()</code></li>
+* <li><code>removeDictionary()</code></li>
+* <li><code>addDictionaryListEventListener()</code></li>
+* <li><code>removeDictionaryListEventListener()</code></li>
+* <li><code>beginCollectEvents()</code></li>
+* <li><code>endCollectEvents()</code></li>
+* <li><code>flushEvents()</code></li>
+* <li><code>createDictionary()</code></li>
+* </ul> <p>
+* @see com.sun.star.linguistic2.XDictionaryList
+*/
+public class _XDictionaryList extends MultiMethodTest {
+
+ public XDictionaryList oObj = null;
+ public XDictionary addedDic = null;
+
+ /**
+ * Flag for testing of listeners.
+ */
+ public boolean listenerCalled = false;
+
+ /**
+ * Class implements interface <code>XDictionaryListEventListener</code>
+ * for test method <code>addDictionaryListEventListener</code>.
+ * @see com.sun.star.linguistic2.XDictionaryListEventListener
+ */
+ public class MyDictionaryListEventListener implements
+ XDictionaryListEventListener {
+
+ public void disposing ( EventObject oEvent ) {
+ log.println("Listener has been disposed");
+ }
+ public void processDictionaryListEvent( DictionaryListEvent aDicEvent) {
+ listenerCalled = true;
+ }
+ };
+
+ XDictionaryListEventListener listener = new MyDictionaryListEventListener();
+
+ short count = 0;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is greater than zero. <p>
+ */
+ public void _getCount() {
+ count = oObj.getCount();
+ tRes.tested("getCount()",(count > 0) );
+ }
+
+ /**
+ * Test calls the method and checks number of obtained dictionaries
+ * with value that was returned by method <code>getCount</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getCount() </code> : to have number of dictionaries </li>
+ * </ul>
+ */
+ public void _getDictionaries() {
+ requiredMethod("getCount()");
+
+ XDictionary[] dics = oObj.getDictionaries();
+ boolean res = (dics.length == count);
+ if (!res) {
+ log.println("Expected: " + oObj.getCount());
+ log.println("Gained: " + dics.length);
+ }
+ tRes.tested("getDictionaries()", res);
+ }
+
+ /**
+ * Test calls the method, makes some actions that leads to event
+ * <code>processDictionaryListEvent</code>, removes listener, checks flag
+ * <code>listenerCalled</code> and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is true and value of flag
+ * <code>listenerCallled</code> is true. <p>
+ */
+ public void _addDictionaryListEventListener() {
+ listenerCalled = false;
+
+ XDictionary xDic = oObj.createDictionary("ListenDic",
+ new Locale("en","US","WIN"),
+ com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
+
+ boolean res = oObj.addDictionaryListEventListener(listener, false);
+
+ oObj.flushEvents();
+ oObj.addDictionary(xDic);
+ xDic.add("Positiv", false, "");
+ xDic.setActive(true);
+ oObj.flushEvents();
+ oObj.removeDictionary(xDic);
+
+ oObj.removeDictionaryListEventListener(listener);
+
+ tRes.tested("addDictionaryListEventListener()",listenerCalled && res);
+ }
+
+ /**
+ * Test calls the method, makes some actions that leads to event
+ * <code>processDictionaryListEvent</code>, checks flag
+ * <code>listenerCalled</code> and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is false and value of flag
+ * <code>listenerCallled</code> is false. <p>
+ */
+ public void _removeDictionaryListEventListener() {
+ listenerCalled = false;
+
+ XDictionary xDic = oObj.createDictionary("ListenDic",
+ new Locale("en","US","WIN"),
+ com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
+
+ oObj.addDictionaryListEventListener(listener,false);
+
+ oObj.flushEvents();
+ oObj.addDictionary(xDic);
+ xDic.add("Positiv", false,"");
+ xDic.setActive(true);
+
+ listenerCalled = false;
+ boolean res = oObj.removeDictionaryListEventListener(listener);
+
+ oObj.flushEvents();
+ oObj.removeDictionary(xDic);
+
+ tRes.tested(
+ "removeDictionaryListEventListener()",
+ listenerCalled == false && res == true );
+ }
+
+ /**
+ * Test creates new dictionary, adds the dictionary to list and compares
+ * number of dictionaries after adding with number of dictionaries before.<p>
+ * Has <b> OK </b> status if number of dictionaries after method call is
+ * greater than number of dictionaries before method call. <p>
+ */
+ public void _addDictionary() {
+ short previous = oObj.getCount();
+ addedDic = oObj.createDictionary("AddedDic",new Locale("en","US","WIN"),
+ com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
+ addedDic.add("Positiv",false,"");
+
+ oObj.addDictionary(addedDic);
+
+ short after = oObj.getCount();
+
+ tRes.tested( "addDictionary()", (after > previous) );
+ }
+
+ /**
+ * Test calls the method and compares number of dictionaries
+ * before method call and after. <p>
+ * Has <b> OK </b> status if number of dictionaries before method call is
+ * less than number of dictionaries after method call. <p>
+ */
+ public void _removeDictionary() {
+ short previous = oObj.getCount();
+ oObj.removeDictionary(addedDic);
+ short after = oObj.getCount();
+ tRes.tested("removeDictionary()",(after < previous) );
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getDictionaryByName() {
+ XDictionary getting = oObj.getDictionaryByName("NegativDic");
+ tRes.tested("getDictionaryByName()", getting != null );
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _createDictionary() {
+ XDictionary tmpDic = oObj.createDictionary("AddedDic",
+ new Locale("en","US","WIN"),
+ com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
+ tRes.tested("createDictionary()", tmpDic != null );
+ }
+
+ /**
+ * Test creates dictionary, adds dictionary list event listener,
+ * begins collect events, makes some actions that leads to event
+ * <code>processDictionaryListEvent</code>, ends collect events,
+ * removes the listener and checks the flag <code>listenerCalled</code> . <p>
+ * Has <b> OK </b> status if value of the flag is true. <p>
+ */
+ public void _beginCollectEvents() {
+ listenerCalled = false;
+
+ XDictionary xDic = oObj.createDictionary("ListenDic",
+ new Locale("en","US","WIN"),
+ com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
+
+ oObj.addDictionaryListEventListener(listener,false);
+ oObj.beginCollectEvents();
+
+ oObj.addDictionary(xDic);
+ xDic.add("Positiv",false,"");
+ xDic.setActive(true);
+
+ oObj.removeDictionary(xDic);
+ oObj.endCollectEvents();
+
+ oObj.removeDictionaryListEventListener(listener);
+
+ tRes.tested("beginCollectEvents()", listenerCalled );
+ }
+
+ /**
+ * Test does nothing. <p>
+ * Has <b> OK </b> status if method
+ * <code>addDictionaryListEventListener()</code> was completed
+ * successfully. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addDictionaryListEventListener() </code> :
+ * if listener adding worked, flushEvents was already used and worked </li>
+ * </ul>
+ */
+ public void _flushEvents() {
+ requiredMethod("addDictionaryListEventListener()");
+ // if listener adding worked, flushEvents was already used and worked
+ tRes.tested("flushEvents()",true);
+ }
+
+ /**
+ * Test does nothing. <p>
+ * Has <b> OK </b> status if method
+ * <code>beginCollectEvents()</code> was completed successfully. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> beginCollectEvents() </code> :
+ * if beginCollectEvents() worked then endCollectEvents was already
+ * used and worked </li>
+ * </ul>
+ */
+ public void _endCollectEvents() {
+ requiredMethod("beginCollectEvents()");
+ // if beginCollectEvents() worked, endCollectEvents
+ // was already used and worked
+ tRes.tested("endCollectEvents()",true);
+ }
+
+} // finish class _XDictionaryList
+
+
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XHyphenator.java b/qadevOOo/tests/java/ifc/linguistic2/_XHyphenator.java
new file mode 100644
index 000000000000..16997753eaac
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XHyphenator.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XHyphenator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.linguistic2;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.Locale;
+import com.sun.star.linguistic2.XHyphenatedWord;
+import com.sun.star.linguistic2.XHyphenator;
+import com.sun.star.linguistic2.XPossibleHyphens;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.linguistic2.XHyphenator</code>
+* interface methods:
+* <ul>
+* <li><code>hyphenate()</code></li>
+* <li><code>queryAlternativeSpelling()</code></li>
+* <li><code>createPossibleHyphens()</code></li>
+* </ul><p>
+* @see com.sun.star.linguistic2.XHyphenator
+*/
+public class _XHyphenator extends MultiMethodTest {
+
+ public XHyphenator oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _hyphenate() {
+ boolean res = true;
+ PropertyValue[] Props = null;
+ try {
+ XHyphenatedWord result = oObj.hyphenate(
+ "wacker",new Locale("de","DE",""),(short)3,Props);
+ res &= (result != null);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception while checking 'hyphenate'");
+ res = false;
+ ex.printStackTrace(log);
+ }
+ tRes.tested("hyphenate()",res);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _queryAlternativeSpelling() {
+ boolean res = true;
+ PropertyValue[] Props = null;
+ try {
+ XHyphenatedWord result = oObj.queryAlternativeSpelling(
+ "wacker",new Locale("de","DE",""),(short)2,Props);
+ res &= (result != null);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception while checking 'queryAlternativeSpelling'");
+ res = false;
+ ex.printStackTrace(log);
+ }
+ tRes.tested("queryAlternativeSpelling()",res);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _createPossibleHyphens() {
+ boolean res = true;
+ PropertyValue[] Props = null;
+ try {
+ XPossibleHyphens result = oObj.createPossibleHyphens(
+ "wacker",new Locale("de","DE",""),Props);
+ res &= (result != null);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception while checking 'createPossibleHyphens'");
+ res = false;
+ ex.printStackTrace(log);
+ }
+ tRes.tested("createPossibleHyphens()",res);
+ }
+
+} // \u0422\u044B finish class XHyphenator
+
+
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XLinguServiceEventBroadcaster.java b/qadevOOo/tests/java/ifc/linguistic2/_XLinguServiceEventBroadcaster.java
new file mode 100644
index 000000000000..6664295ee900
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XLinguServiceEventBroadcaster.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLinguServiceEventBroadcaster.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.linguistic2;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.linguistic2.LinguServiceEvent;
+import com.sun.star.linguistic2.XLinguServiceEventBroadcaster;
+import com.sun.star.linguistic2.XLinguServiceEventListener;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.linguistic2.XLinguServiceEventBroadcaster</code>
+* interface methods:
+* <ul>
+* <li><code>addLinguServiceEventListener()</code></li>
+* <li><code>removeLinguServiceEventListener()</code></li>
+* </ul><p>
+* @see com.sun.star.linguistic2.XLinguServiceEventBroadcaster
+*/
+public class _XLinguServiceEventBroadcaster extends MultiMethodTest {
+
+ public XLinguServiceEventBroadcaster oObj = null;
+
+ /**
+ * Class implements interface <code>XLinguServiceEventListener</code>
+ * for test method <code>addLinguServiceEventListener</code>.
+ * @see com.sun.star.linguistic2.XLinguServiceEventListener
+ */
+ public class MyLinguServiceEventListener implements
+ XLinguServiceEventListener {
+ public void disposing ( EventObject oEvent ) {
+ log.println("Listener has been disposed");
+ }
+ public void processLinguServiceEvent(LinguServiceEvent aServiceEvent) {
+ log.println("Listener called");
+ }
+
+ };
+
+ XLinguServiceEventListener listener = new MyLinguServiceEventListener();
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is true. <p>
+ */
+ public void _addLinguServiceEventListener() {
+ boolean res = true;
+
+ res = oObj.addLinguServiceEventListener(listener);
+
+ tRes.tested("addLinguServiceEventListener()",res);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is true. <p>
+ */
+ public void _removeLinguServiceEventListener() {
+ boolean res = true;
+
+ res = oObj.removeLinguServiceEventListener(listener);
+
+ tRes.tested("removeLinguServiceEventListener()",res);
+ }
+
+} // finish class XLinguServiceEventBroadcaster
+
+
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XLinguServiceManager.java b/qadevOOo/tests/java/ifc/linguistic2/_XLinguServiceManager.java
new file mode 100644
index 000000000000..7205b96f8cfd
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XLinguServiceManager.java
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLinguServiceManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.linguistic2;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.Locale;
+import com.sun.star.linguistic2.LinguServiceEvent;
+import com.sun.star.linguistic2.XHyphenator;
+import com.sun.star.linguistic2.XLinguServiceEventListener;
+import com.sun.star.linguistic2.XLinguServiceManager;
+import com.sun.star.linguistic2.XSpellChecker;
+import com.sun.star.linguistic2.XThesaurus;
+import lib.MultiMethodTest;
+
+/**
+*Testing <code>com.sun.star.linguistic2.XLinguServiceManager</code>
+* interface methods:
+* <ul>
+* <li><code>getSpellChecker()</code></li>
+* <li><code>getHyphenator()</code></li>
+* <li><code>getThesaurus()</code></li>
+* <li><code>addLinguServiceManagerListener()</code></li>
+* <li><code>removeLinguServiceManagerListener()</code></li>
+* <li><code>getAvailableServices()</code></li>
+* <li><code>setConfiguredServices()</code></li>
+* <li><code>getConfiguredServices()</code></li>
+* </ul> <p>
+*@see com.sun.star.linguistic2.XLinguServiceManager
+*/
+public class _XLinguServiceManager extends MultiMethodTest {
+
+ public XLinguServiceManager oObj = null;
+ boolean listenerCalled = false;
+
+ /**
+ * Class implements interface <code>XLinguServiceEventListener</code>
+ * for test method <code>addLinguServiceManagerListener</code>.
+ * @see com.sun.star.linguistic2.XLinguServiceEventListener
+ */
+ public class MyLinguServiceEventListener implements
+ XLinguServiceEventListener {
+ public void disposing ( EventObject oEvent ) {
+ log.println("Listener has been disposed");
+ }
+ public void processLinguServiceEvent(LinguServiceEvent aServiceEvent) {
+ listenerCalled = true;
+ log.println("Listener called");
+ }
+ };
+
+ XLinguServiceEventListener listener = new MyLinguServiceEventListener();
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getSpellChecker() {
+ XSpellChecker SC = oObj.getSpellChecker();
+ tRes.tested("getSpellChecker()", SC != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getHyphenator() {
+ XHyphenator HN = oObj.getHyphenator();
+ tRes.tested("getHyphenator()", HN != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getThesaurus() {
+ XThesaurus TS = oObj.getThesaurus();
+ tRes.tested("getThesaurus()", TS != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is equal to true. <p>
+ */
+ public void _addLinguServiceManagerListener() {
+ boolean res = oObj.addLinguServiceManagerListener(listener);
+ tRes.tested("addLinguServiceManagerListener()", res);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is equal to true. <p>
+ */
+ public void _removeLinguServiceManagerListener() {
+ boolean res = oObj.removeLinguServiceManagerListener(listener);
+ tRes.tested("removeLinguServiceManagerListener()",res);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if length of returned array is
+ * greater than zero.<p>
+ */
+ public void _getAvailableServices() {
+ String[] services = oObj.getAvailableServices(
+ "com.sun.star.linguistic2.Hyphenator",
+ new Locale("en", "US", "") );
+ tRes.tested("getAvailableServices()", services.length > 0);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if length of returned array is
+ * greater than zero.<p>
+ */
+ public void _getConfiguredServices() {
+ String[] services = oObj.getConfiguredServices(
+ "com.sun.star.linguistic2.Hyphenator",
+ new Locale("en", "US", "") );
+ tRes.tested("getConfiguredServices()", services.length > 0);
+ }
+
+ /**
+ * Test sets empty list of service, checks value returned
+ * by method <code>getConfiguredServices()</code> and all services
+ * restored finally. <p>
+ * Has <b> OK </b> status if length of obtained service list equal to zero.
+ * <p>The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getConfiguredServices() </code></li>
+ * </ul>
+ */
+ public void _setConfiguredServices() {
+ requiredMethod("getConfiguredServices()");
+
+ String[] services = oObj.getConfiguredServices(
+ "com.sun.star.linguistic2.Hyphenator",new Locale("en","US",""));
+
+ String[] empty = new String[0];
+ oObj.setConfiguredServices(
+ "com.sun.star.linguistic2.Hyphenator",
+ new Locale("en", "US", ""),
+ empty );
+
+ String[] get = oObj.getConfiguredServices(
+ "com.sun.star.linguistic2.Hyphenator", new Locale("en","US",""));
+
+ boolean res = (get.length == 0);
+
+ oObj.setConfiguredServices(
+ "com.sun.star.linguistic2.Hyphenator",
+ new Locale("en", "US", ""),
+ services );
+
+ tRes.tested("setConfiguredServices()", res);
+ }
+
+} // finish class _XLinguServiceManager
+
+
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XSearchableDictionaryList.java b/qadevOOo/tests/java/ifc/linguistic2/_XSearchableDictionaryList.java
new file mode 100644
index 000000000000..07588904adc0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XSearchableDictionaryList.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSearchableDictionaryList.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.linguistic2;
+
+import com.sun.star.lang.Locale;
+import com.sun.star.linguistic2.XDictionaryEntry;
+import com.sun.star.linguistic2.XSearchableDictionaryList;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.linguistic2.XSearchableDictionaryList</code>
+* interface methods:
+* <ul>
+* <li><code>queryDictionaryEntry()</code></li>
+* </ul> <p>
+* @see com.sun.star.linguistic2.XSearchableDictionaryList
+*/
+public class _XSearchableDictionaryList extends MultiMethodTest {
+
+ public XSearchableDictionaryList oObj = null;
+
+ /**
+ * Test calls the method for negative dictionary and for positive dictionary
+ * and checks returned values. <p>
+ * Has <b> OK </b> status if returned values are not null. <p>
+ */
+ public void _queryDictionaryEntry() {
+ XDictionaryEntry aNegativEntry = oObj.queryDictionaryEntry("Negativ",
+ new Locale("en","US","WIN"),false,false);
+ if (aNegativEntry == null) {
+ log.println("'queryDictionary' didn't work for negative dictionaries");
+ } else {
+ log.println("'queryDictionary' works for negative dictionaries");
+ }
+ XDictionaryEntry aPositivEntry = oObj.queryDictionaryEntry("Positiv",
+ new Locale("en","US","WIN"),true,true);
+ if (aPositivEntry == null) {
+ log.println("'queryDictionary' didn't work for positive dictionaries");
+ } else {
+ log.println("'queryDictionary' works for positive dictionaries");
+ }
+ tRes.tested("queryDictionaryEntry()",(aNegativEntry != null) &&
+ (aPositivEntry != null) );
+ }
+
+} // finish class _XSearchableDictionaryList
+
+
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XSpellChecker.java b/qadevOOo/tests/java/ifc/linguistic2/_XSpellChecker.java
new file mode 100644
index 000000000000..e57df90e2f0c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XSpellChecker.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSpellChecker.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.linguistic2;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.Locale;
+import com.sun.star.linguistic2.XSpellAlternatives;
+import com.sun.star.linguistic2.XSpellChecker;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.linguistic2.XSpellChecker</code>
+* interface methods:
+* <ul>
+* <li><code>isValid()</code></li>
+* <li><code>spell()</code></li>
+* </ul><p>
+* @see com.sun.star.linguistic2.XSpellChecker
+*/
+public class _XSpellChecker extends MultiMethodTest {
+
+ public XSpellChecker oObj = null;
+
+ /**
+ * Test calls the method for a correctly spelled word and
+ * for a uncorrectly spelled word and checks returned values. <p>
+ * Has <b> OK </b> status if returned value is equal to true in first case,
+ * if returned value is equal to false in second case and no exceptions
+ * were thrown. <p>
+ */
+ public void _isValid() {
+ boolean res = true;
+ try {
+ PropertyValue[] empty = new PropertyValue[0] ;
+ res &= oObj.isValid("Sun", new Locale("en","US",""), empty);
+ res &= !oObj.isValid("Summersun", new Locale("en","US","") ,empty);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception while checking 'isValid'");
+ res = false;
+ ex.printStackTrace(log);
+ }
+ tRes.tested("isValid()",res);
+ }
+
+ /**
+ * Test calls the method for a uncorrectly spelled word
+ * and checks returned values. <p>
+ * Has <b> OK </b> status if at least one spell alternative exists
+ * and no exceptions were thrown. <p>
+ */
+ public void _spell() {
+ boolean res = true;
+ try {
+ PropertyValue[] empty = new PropertyValue[0] ;
+ XSpellAlternatives alt = oObj.spell(
+ "Summersun",new Locale("en","US",""),empty);
+ String alternative = alt.getAlternatives()[0];
+ res = (alternative != null);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception while checking 'spell'");
+ res = false;
+ ex.printStackTrace(log);
+ }
+ tRes.tested("spell()",res);
+ }
+
+} // finish class MTest
+
+
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java b/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java
new file mode 100644
index 000000000000..272c9826db1a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSupportedLocales.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.linguistic2;
+
+import com.sun.star.lang.Locale;
+import com.sun.star.linguistic2.XSupportedLocales;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.linguistic2.XSupportedLocales</code>
+* interface methods:
+* <ul>
+* <li><code>getLocales()</code></li>
+* <li><code>hasLocale()</code></li>
+* </ul> <p>
+* @see com.sun.star.linguistic2.XSupportedLocales
+*/
+public class _XSupportedLocales extends MultiMethodTest {
+
+ public XSupportedLocales oObj = null;
+ public static Locale[] locales = new Locale[0];
+
+ /**
+ * Test calls the method, stores returned value and checks it. <p>
+ * Has <b> OK </b> status if length of returned array isn't zero. <p>
+ */
+ public void _getLocales() {
+ locales = oObj.getLocales();
+ tRes.tested("getLocales()", locales.length > 0);
+ }
+
+ /**
+ * Test calls the method for every language from list of supported languages,
+ * calls the method for one unsupported language and checks
+ * all returned values. <p>
+ * Has <b> OK </b> status if all returned values for supported languages
+ * are equal to true and if returned value for unsupported language is equal
+ * to false. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLocales() </code> : to have list of
+ * all supported languages </li>
+ * </ul>
+ */
+ public void _hasLocale() {
+ requiredMethod("getLocales()");
+ boolean res = true;
+
+ // first check all available locales
+ for (int i=0; i< locales.length; i++) {
+ res &= oObj.hasLocale(locales[i]);
+ }
+
+ // now create a invalid locale
+ Locale invalid = new Locale("myLanguage","myCountry","");
+ res &= !oObj.hasLocale(invalid);
+
+ tRes.tested("hasLocale()", res);
+ }
+
+} // finish class XSupportedLocales
+
+
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XThesaurus.java b/qadevOOo/tests/java/ifc/linguistic2/_XThesaurus.java
new file mode 100644
index 000000000000..9e36f3f55251
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XThesaurus.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XThesaurus.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.linguistic2;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.Locale;
+import com.sun.star.linguistic2.XMeaning;
+import com.sun.star.linguistic2.XThesaurus;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.linguistic2.XThesaurus</code>
+* interface methods:
+* <ul>
+* <li><code>queryMeanings()</code></li>
+* </ul> <p>
+* @see com.sun.star.linguistic2.XThesaurus
+*/
+public class _XThesaurus extends MultiMethodTest {
+
+ public XThesaurus oObj = null;
+
+ /**
+ * Test calls the method for one of supported language and checks
+ * returned value. <p>
+ * Has <b> OK </b> status if returned array is not empty
+ * and no exceptions were thrown. <p>
+ */
+ public void _queryMeanings() {
+ boolean res = true;
+ try {
+ XMeaning[] mean = oObj.queryMeanings(
+ "survive",new Locale("en","US",""), new PropertyValue[0]);
+ res = (mean.length > 0);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception while checking 'queryMeanings'");
+ res = false;
+ ex.printStackTrace(log);
+ }
+ tRes.tested("queryMeanings()",res);
+ }
+
+
+} // finish class
+
+
diff --git a/qadevOOo/tests/java/ifc/loader/_XImplementationLoader.java b/qadevOOo/tests/java/ifc/loader/_XImplementationLoader.java
new file mode 100644
index 000000000000..889854f50535
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/loader/_XImplementationLoader.java
@@ -0,0 +1,220 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XImplementationLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.loader;
+
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.loader.CannotActivateFactoryException;
+import com.sun.star.loader.XImplementationLoader;
+import com.sun.star.registry.CannotRegisterImplementationException;
+import com.sun.star.registry.XRegistryKey;
+import com.sun.star.registry.XSimpleRegistry;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.StatusException;
+import util.RegistryTools;
+
+/**
+ * Testing <code>com.sun.star.loader.XImplementationLoader</code>
+ * interface methods :
+ * <ul>
+ * <li><code> activate()</code></li>
+ * <li><code> writeRegistryInfo()</code></li>
+ * </ul> <p>
+ *
+ * The following object relations required :
+ * <ul>
+ * <li> <code>'ImplementationLoader'</code> : service which is
+ * responsible for loading implementations. </li>
+ * <li> <code>'ImplementationUrl'</code> : implementation file location. </li>
+ * <li> <code>'ImplementationName'</code> : Name of the implementation.</li>
+ * </ul> <p>
+ * Object has to be recreated after this test. <p>
+ * Test is <b> Not </b> multithread compilant.
+ */
+public class _XImplementationLoader extends MultiMethodTest {
+
+ public XImplementationLoader oObj = null;
+ private String implLoader = null ;
+ private String implUrl = null ;
+ private String implName = null ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ implLoader = (String) tEnv.getObjRelation("ImplementationLoader") ;
+ implUrl = (String) tEnv.getObjRelation("ImplementationUrl") ;
+ implName = (String) tEnv.getObjRelation("ImplementationName") ;
+
+ if (implLoader == null || implUrl == null || implName == null)
+ throw new StatusException("One of object relations not found",
+ new NullPointerException()) ;
+ }
+
+ /**
+ * First registry file created, and the root key retrieved.
+ * Then method <code>writeRegistryInfo</code> called and it must
+ * write some info into the registry root key. After all registry
+ * is destroyed.<p>
+ * Has OK status if some info was written into registry.
+ */
+ public void _writeRegistryInfo() {
+ XRegistryKey key ;
+ XSimpleRegistry xReg = null ;
+
+ String tmpDir = util.utils.getOfficeTempDir(tParam.getMSF());
+
+ try {
+ xReg = RegistryTools.createRegistryService
+ (tParam.getMSF()) ;
+
+ xReg.open(tmpDir + "XImpLoader_tmp.rdb", false, true) ;
+
+ key = xReg.getRootKey() ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can not create registry for writing") ;
+ e.printStackTrace(log) ;
+ tRes.tested("writeRegistryInfo()", false) ;
+ return ;
+ }
+
+ boolean rc ;
+ try {
+ rc = oObj.writeRegistryInfo(key, implLoader, implUrl) ;
+ } catch (CannotRegisterImplementationException e) {
+ throw new StatusException("Can not register implementation", e) ;
+ }
+
+ if (rc == false)
+ log.println("Method returned false value") ;
+
+ String[] keys ;
+ try {
+ keys = key.getKeyNames() ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error retrieving key names from registry") ;
+ tRes.tested("writeRegistryInfo()", false) ;
+ return ;
+ }
+
+ // destroying registry file
+ try {
+ xReg.close() ;
+ xReg.destroy() ;
+ } catch (com.sun.star.registry.InvalidRegistryException e) {
+ log.println("Can't destroy registry file.") ;
+ }
+
+ tRes.tested("writeRegistryInfo()", rc && keys.length > 0) ;
+ }
+
+ /**
+ * Tries to activate the implementation. <p>
+ *
+ * Has OK status if not <code>null</code> value returned by method,
+ * if its implementation name is the same as expected.
+ */
+ public void _activate() {
+ boolean ok = true ;
+ XInterface factory = null ;
+
+ try {
+ factory = (XInterface) oObj.activate
+ (implName, implLoader, implUrl, null) ;
+ } catch (CannotActivateFactoryException e) {
+ throw new StatusException("Can not activate factory", e) ;
+ }
+
+ XServiceInfo xServInf = (XServiceInfo) UnoRuntime.queryInterface
+ (XServiceInfo.class, factory) ;
+
+ if (xServInf == null) {
+ if (factory == null) {
+ log.println("activate() returns null - FAILED.");
+ } else {
+ log.println("Activated impementation doesn't support "+
+ "XServiceInfo - FAILED.");
+ }
+ ok = false ;
+ } else {
+ String gImpName = xServInf.getImplementationName() ;
+ log.println("Implementation name returned :" + gImpName);
+
+ if (!gImpName.equals(implName)) {
+ log.println("!!! But other name was expected :" + implName);
+ ok = false ;
+ }
+ }
+
+ tRes.tested("activate()", ok) ;
+ }
+
+ /**
+ * Forces object recreation.
+ */
+ public void after() {
+ tEnv.dispose() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/presentation/_OutlineView.java b/qadevOOo/tests/java/ifc/presentation/_OutlineView.java
new file mode 100644
index 000000000000..b0e1e57ace0e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/presentation/_OutlineView.java
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * $RCSfile: _OutlineView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.presentation;
+
+import lib.MultiPropertyTest;
+
+public class _OutlineView extends MultiPropertyTest {
+
+} // finish class _PresentationView
+
+
diff --git a/qadevOOo/tests/java/ifc/presentation/_Presentation.java b/qadevOOo/tests/java/ifc/presentation/_Presentation.java
new file mode 100644
index 000000000000..6285a453a184
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/presentation/_Presentation.java
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Presentation.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.presentation;
+
+import com.sun.star.presentation.XPresentation;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.presentation.Presentation</code>
+* service properties :
+* <ul>
+* <li><code> AllowAnimations</code></li>
+* <li><code> CustomShow</code></li>
+* <li><code> FirstPage</code></li>
+* <li><code> IsAlwaysOnTop</code></li>
+* <li><code> IsAutomatic</code></li>
+* <li><code> IsEndless</code></li>
+* <li><code> IsFullScreen</code></li>
+* <li><code> IsLivePresentation</code></li>
+* <li><code> IsMouseVisible</code></li>
+* <li><code> Pause</code></li>
+* <li><code> StartWithNavigator</code></li>
+* <li><code> UsePen</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Presentation'</code> (of type <code>XPresentation</code>):
+* for test of property <code>IsLivePresentation</code>
+* presentation start needed </li>
+* <ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.presentation.Presentation
+* @see com.sun.star.presentation.XPresentation
+*/
+public class _Presentation extends MultiPropertyTest {
+
+ public void _IsLivePresentation() {
+ XPresentation aPresentation = (XPresentation)
+ tEnv.getObjRelation("Presentation");
+ if (aPresentation == null) throw new StatusException(Status.failed
+ ("Relation 'Presentation' not found"));
+
+ aPresentation.start();
+ testProperty("IsLivePresentation");
+ }
+
+ protected PropertyTester CustomShowTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if ( ((String)oldValue).equals("SecondPresentation") ) {
+ return new String("FirstPresentation");
+ } else {
+ return new String("SecondPresentation");
+ }
+ }
+ };
+
+ public void _CustomShow() {
+ testProperty("CustomShow", CustomShowTester);
+ }
+} // finish class _Presentation
+
+
diff --git a/qadevOOo/tests/java/ifc/presentation/_PresentationView.java b/qadevOOo/tests/java/ifc/presentation/_PresentationView.java
new file mode 100644
index 000000000000..9ab15e266c94
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/presentation/_PresentationView.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * $RCSfile: _PresentationView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.presentation;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+public class _PresentationView extends MultiPropertyTest {
+
+ /**
+ * Property tester which changes DrawPage.
+ */
+ protected PropertyTester PageTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(tEnv.getObjRelation("FirstPage")))
+ return tEnv.getObjRelation("SecondPage"); else
+ return tEnv.getObjRelation("FirstPage");
+ }
+ } ;
+
+ /**
+ * This property must be an XDrawPage
+ */
+ public void _CurrentPage() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("CurrentPage", PageTester) ;
+ }
+
+} // finish class _PresentationView
+
+
diff --git a/qadevOOo/tests/java/ifc/presentation/_XCustomPresentationSupplier.java b/qadevOOo/tests/java/ifc/presentation/_XCustomPresentationSupplier.java
new file mode 100644
index 000000000000..9caf2f19f8ab
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/presentation/_XCustomPresentationSupplier.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCustomPresentationSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.presentation;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.presentation.XCustomPresentationSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.presentation.XCustomPresentationSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getCustomPresentations()</code></li>
+* </ul> <p>
+* @see com.sun.star.presentation.XCustomPresentationSupplier
+*/
+public class _XCustomPresentationSupplier extends MultiMethodTest {
+
+ public XCustomPresentationSupplier oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getCustomPresentations() {
+ XNameAccess NA = oObj.getCustomPresentations();
+ tRes.tested("getCustomPresentations()", NA != null);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/presentation/_XPresentation.java b/qadevOOo/tests/java/ifc/presentation/_XPresentation.java
new file mode 100644
index 000000000000..e1a408bc9bfa
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/presentation/_XPresentation.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPresentation.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.presentation;
+
+import com.sun.star.presentation.XPresentation;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.presentation.XPresentation</code>
+* interface methods :
+* <ul>
+* <li><code> start()</code></li>
+* <li><code> end()</code></li>
+* <li><code> rehearseTimings()</code></li>
+* </ul> <p>
+* @see com.sun.star.presentation.XPresentation
+*/
+public class _XPresentation extends MultiMethodTest {
+
+ public XPresentation oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _start() {
+ oObj.start();
+ tRes.tested("start()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> start() </code> : presentation must be started before</li>
+ * </ul>
+ */
+ public void _end() {
+ requiredMethod("start()");
+
+ oObj.end();
+ tRes.tested("end()", true);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _rehearseTimings() {
+ oObj.rehearseTimings();
+ tRes.tested("rehearseTimings()", true);
+ }
+
+} // finish class _XPresentation
+
+
diff --git a/qadevOOo/tests/java/ifc/presentation/_XPresentationSupplier.java b/qadevOOo/tests/java/ifc/presentation/_XPresentationSupplier.java
new file mode 100644
index 000000000000..f8ba810418de
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/presentation/_XPresentationSupplier.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPresentationSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.presentation;
+
+import com.sun.star.presentation.XPresentation;
+import com.sun.star.presentation.XPresentationSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.presentation.XPresentationSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getPresentation()</code></li>
+* </ul> <p>
+* @see com.sun.star.presentation.XPresentationSupplier
+*/
+public class _XPresentationSupplier extends MultiMethodTest {
+
+ public XPresentationSupplier oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getPresentation() {
+ XPresentation NA = oObj.getPresentation();
+ tRes.tested("getPresentation()", NA != null);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/reflection/_XIdlReflection.java b/qadevOOo/tests/java/ifc/reflection/_XIdlReflection.java
new file mode 100644
index 000000000000..f36753bc35c5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/reflection/_XIdlReflection.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XIdlReflection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.reflection;
+
+import com.sun.star.reflection.XIdlClass;
+import com.sun.star.reflection.XIdlReflection;
+import com.sun.star.uno.TypeClass;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.reflection.XIdlReflection</code>
+* interface methods :
+* <ul>
+* <li><code> forName()</code></li>
+* <li><code> getType()</code></li>
+* </ul> <p>
+* @see com.sun.star.reflection.XIdlReflection
+*/
+public class _XIdlReflection extends MultiMethodTest{
+ public XIdlReflection oObj = null;
+ protected final static String typeName = "com.sun.star.container.XNameAccess";
+
+ /**
+ * Test calls the method and checks returned interface
+ * <code>com.sun.star.container.XNameAccess</code>: gets the name and the
+ * type and checks it. <p>
+ * Has <b> OK </b> status if returned name is equal to the name of the
+ * interface that was passed as parameter in the method call and if returned
+ * type is equal to <code>com.sun.star.uno.TypeClass.INTERFACE</code>. <p>
+ */
+ public void _forName() {
+ boolean result = true;
+ XIdlClass cls = oObj.forName(typeName);
+
+ if (cls != null) {
+ log.println("Class name: " + cls.getName());
+ result &= cls.getTypeClass() == TypeClass.INTERFACE;
+ result &= typeName.equals(cls.getName());
+ } else {
+ log.println("Method returned null");
+ result = false;
+ }
+
+ tRes.tested("forName()", result);
+ }
+
+ /**
+ * Test creates the instance of <code>com.sun.star.io.Pipe</code>,
+ * calls the method using this instance as parameter and checks returned
+ * value. <p>
+ * Has <b> OK </b> status if the instance was created successfully, if
+ * returned value isn't null and no exceptions were thrown. <p>
+ */
+ public void _getType() {
+ boolean result = true;
+ Object obj = null;
+
+ try {
+ obj = tParam.getMSF().createInstance("com.sun.star.io.Pipe") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create object");
+ tRes.tested("getType()", false);
+ return;
+ }
+
+ if (obj == null) {
+ result = false;
+ log.println("Object wasn't created !");
+ tRes.tested("getType()", false);
+ }
+
+ XIdlClass cls = oObj.getType(obj);
+
+ log.println("The name is " + cls.getName());
+
+ tRes.tested("getType()", cls != null);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/reflection/_XProxyFactory.java b/qadevOOo/tests/java/ifc/reflection/_XProxyFactory.java
new file mode 100644
index 000000000000..5df6fccc34c8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/reflection/_XProxyFactory.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XProxyFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.reflection;
+
+import com.sun.star.lang.XInitialization;
+import com.sun.star.reflection.XProxyFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XAggregation;
+import lib.MultiMethodTest;
+
+/**
+/**
+* Testing <code>com.sun.star.reflection.XProxyFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createProxy()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.reflection.XProxyFactory
+*/
+public class _XProxyFactory extends MultiMethodTest {
+ /** Is initialized in super class(using reflection API)
+ * when instantiating the test.
+ */
+ public XProxyFactory oObj;
+
+ /**
+ * First an implementation of
+ * <code>com.sun.star.lang.XInitialization</code> interface
+ * is made which sets a flag when its <code>initialize()</code>
+ * method is called. Then an instance of this implementation
+ * is created and a proxy object is created for it. Proxy
+ * object is tried to query for <code>XInitialization</code>
+ * interface and it's <code>initialize</code> method is
+ * called. The goal is to check if the real object method
+ * was called throwgh it's proxy. <p>
+ * Has <b>OK</b> status if the real object method was
+ * called and paramters were passed correctly.
+ */
+ public void _createProxy() {
+ class MyObject implements XInitialization {
+ Object[] params;
+
+ public void initialize(Object args[]) {
+ params = args;
+ }
+ }
+
+ MyObject obj = new MyObject();
+
+ XAggregation xAggr = oObj.createProxy(obj);
+
+ XInitialization xInit = (XInitialization)UnoRuntime.queryInterface(
+ XInitialization.class, xAggr);
+
+ Object params[] = new Object[0];
+
+ try {
+ xInit.initialize(params);
+ } catch(com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception : " + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("createProxy()", false);
+ return;
+ }
+
+ tRes.tested("createProxy()",
+ util.ValueComparer.equalValue(params, obj.params));
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/reflection/_XTypeDescriptionEnumerationAccess.java b/qadevOOo/tests/java/ifc/reflection/_XTypeDescriptionEnumerationAccess.java
new file mode 100644
index 000000000000..1b29d2776953
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/reflection/_XTypeDescriptionEnumerationAccess.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTypeDescriptionEnumerationAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package ifc.reflection;
+
+import com.sun.star.reflection.XTypeDescriptionEnumerationAccess;
+import com.sun.star.reflection.XTypeDescriptionEnumeration;
+import com.sun.star.reflection.TypeDescriptionSearchDepth;
+import com.sun.star.reflection.XTypeDescription;
+import com.sun.star.uno.TypeClass;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.reflection.XTypeDescriptionEnumerationAccess
+ * </code><br>
+ * Needed object relation:
+ * <ul>
+ * <li><code>SearchString</code>
+ * A string to search for as a type description</li>
+ * </ul>
+ */
+public class _XTypeDescriptionEnumerationAccess extends MultiMethodTest {
+ public XTypeDescriptionEnumerationAccess oObj = null;
+
+ /**
+ * Search the type database for all information regarding the object
+ * relation 'SearchString'. Search depth is infinite and information
+ * about all types is gathered.
+ */
+ public void _createTypeDescriptionEnumeration() {
+ int i=0;
+ TypeClass[] tClass = new TypeClass[0];
+ String sString = (String)tEnv.getObjRelation("SearchString");
+ if (sString == null || sString.equals("")) {
+ System.out.println("Cannot get object relation 'SearchString'");
+ tRes.tested("createTypeDescriptionEnumeration()", false);
+ return;
+ }
+ try {
+ XTypeDescriptionEnumeration enum =
+ oObj.createTypeDescriptionEnumeration(sString, tClass,
+ TypeDescriptionSearchDepth.INFINITE);
+ try {
+ log.println("Got an enumeration.");
+ while (true) {
+ XTypeDescription desc = enum.nextTypeDescription();
+ i++;
+ log.println("\tdesc name: " + desc.getName());
+ }
+ }
+ catch(com.sun.star.container.NoSuchElementException e) {
+ log.println(
+ "Correct exception caught for exiting enumeration.");
+ log.println("Returned were " + i + " type descriptions.");
+ }
+ catch(Exception e) {
+ log.println("Exception while accessing the enumeration.");
+ log.println("Index is " + i);
+ log.println(e.getMessage());
+ tRes.tested("createTypeDescriptionEnumeration()", false);
+ return;
+ }
+ tRes.tested("createTypeDescriptionEnumeration()", i>0);
+ }
+ catch(Exception e) {
+ log.println("Cannot execute method.");
+ log.println(e.getMessage());
+ tRes.tested("createTypeDescriptionEnumeration()", false);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/registry/_XImplementationRegistration.java b/qadevOOo/tests/java/ifc/registry/_XImplementationRegistration.java
new file mode 100644
index 000000000000..3891b16f3748
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/registry/_XImplementationRegistration.java
@@ -0,0 +1,234 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XImplementationRegistration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.registry;
+
+import com.sun.star.registry.CannotRegisterImplementationException;
+import com.sun.star.registry.XImplementationRegistration;
+import com.sun.star.registry.XSimpleRegistry;
+import com.sun.star.uno.RuntimeException;
+import lib.MultiMethodTest;
+import util.RegistryTools;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.registry.XImplementationRegistration</code>
+* interface methods :
+* <ul>
+* <li><code> registerImplementation()</code></li>
+* <li><code> revokeImplementation()</code></li>
+* <li><code> getImplementations()</code></li>
+* <li><code> checkInstantiation()</code></li>
+* </ul> <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code>solibrary.jar</code> : jar file with implementation
+* classes. One of the required implementation must have name
+* <code>com.ivistaportal.solibrary.HistogramImpl</code> cause
+* it is checked in <code>getImplementations</code> method. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.###
+*/
+public class _XImplementationRegistration extends MultiMethodTest {
+
+ public XImplementationRegistration oObj = null;
+
+ private String url = null ;
+ private String loader = null ;
+ private XSimpleRegistry reg = null ;
+
+ /**
+ * First a registry created and opened in the temporary directory
+ * of StarOffice. Then some implementations situated in JAR file
+ * is registered in the registry opened. <p>
+ * Has <b>OK</b> status if some information is written into registry.
+ *
+ */
+ public void _registerImplementation()
+ throws CannotRegisterImplementationException, RuntimeException
+ {
+/* url = tParam.get("DOCPTH") +
+ System.getProperty("file.separator") + "XImpReg.dll" ;
+ loader = "com.sun.star.loader.SharedLibrary" ;*/
+ url = util.utils.getFullTestURL("solibrary.jar");
+ loader = "com.sun.star.loader.Java2";
+ boolean result = false ;
+ String name = null;
+
+ try {
+ name = utils.getOfficeTempDir(tParam.getMSF()) +
+ "XImplementationRegistration_tmp.rdb";
+ reg = RegistryTools.openRegistry
+ (name, tParam.getMSF()) ;
+
+ oObj.registerImplementation(loader, url, reg) ;
+
+ RegistryTools.printRegistryInfo(reg.getRootKey(), log) ;
+
+ String[] subKeys = reg.getRootKey().getKeyNames() ;
+
+ result = subKeys != null && subKeys.length > 0 ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't open registry file: " + name) ;
+ e.printStackTrace(log) ;
+ }
+ tRes.tested("registerImplementation()", result) ;
+ }
+
+ /**
+ * Retrieves an array of implementation names and check them. <p>
+ * Has <b>OK</b> status if among them an implementation name
+ * <code>com.ivistaportal.solibrary.HistogramImpl</code> exists.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerImplementation </code> </li>
+ * </ul>
+ */
+ public void _getImplementations() throws RuntimeException{
+ requiredMethod("registerImplementation()") ;
+
+ String[] impl = oObj.getImplementations(loader, url) ;
+
+ if (impl.length == 0) log.println("getImplementations() "+
+ "returns an empty array");
+ boolean result = false ;
+ log.println("Implementations found :") ;
+ for (int i = 0; i < impl.length; i++) {
+ log.println(" '" + impl[i] + "'") ;
+ if ("com.ivistaportal.solibrary.HistogramImpl".
+ equals(impl[i])) {
+
+ result = true ;
+ break ;
+ }
+ }
+
+
+
+ tRes.tested("getImplementations()", result) ;
+ }
+
+ /**
+ * Calls the method with
+ * <code>com.sun.star.comp.stoc.JavaComponentLoader</code>
+ * implementation name.<p>
+ * Has <b>OK</b> status if not null array returned. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerImplementation </code> </li>
+ * </ul>
+ */
+ public void _checkInstantiation() throws RuntimeException {
+ requiredMethod("registerImplementation()") ;
+
+ String[] inst = oObj.checkInstantiation(
+ "com.sun.star.comp.stoc.JavaComponentLoader") ;
+
+ tRes.tested("checkInstantiation()", inst != null) ;
+ }
+
+ /**
+ * Revokes implementations from registry, and checks if
+ * all implementations' information is deleted. <p>
+ * Has <b>OK</b> status if registry has no key entries. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerImplementation </code> : to have
+ * implementation registered in registry. </li>
+ * </ul>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getImplementations </code>
+ * <li> <code> checkInstantiation </code>
+ * </ul>
+ */
+ public void _revokeImplementation() throws RuntimeException{
+ boolean result = false ;
+
+ requiredMethod("registerImplementation()") ;
+
+ executeMethod("getImplementations()") ;
+ executeMethod("checkInstantiation()") ;
+
+ oObj.revokeImplementation(url, reg);
+ RegistryTools.printRegistryInfo(reg, log) ;
+
+ try {
+ String[] subKeys = reg.getRootKey().getKeyNames() ;
+
+ result = subKeys == null || subKeys.length == 0 ;
+ } catch (com.sun.star.registry.InvalidRegistryException e) {
+ log.println("!!! Exception retrieving keys from registry :") ;
+ e.printStackTrace(log);
+ }
+
+ tRes.tested("revokeImplementation()", true) ;
+ }
+
+ public void after() {
+ tEnv.dispose() ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/registry/_XSimpleRegistry.java b/qadevOOo/tests/java/ifc/registry/_XSimpleRegistry.java
new file mode 100644
index 000000000000..a818919ca3ec
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/registry/_XSimpleRegistry.java
@@ -0,0 +1,401 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSimpleRegistry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.registry;
+
+import com.sun.star.registry.InvalidRegistryException;
+import com.sun.star.registry.XRegistryKey;
+import com.sun.star.registry.XSimpleRegistry;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.RegistryTools;
+
+/**
+* Testing <code>com.sun.star.registry.XSimpleRegistry</code>
+* interface methods :
+* <ul>
+* <li><code> getURL()</code></li>
+* <li><code> open()</code></li>
+* <li><code> isValid()</code></li>
+* <li><code> close()</code></li>
+* <li><code> destroy()</code></li>
+* <li><code> getRootKey()</code></li>
+* <li><code> isReadOnly()</code></li>
+* <li><code> mergeKey()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'NR'</code> <b>optional</b> (of type <code>String</code>):
+* if this object relation isn't null than the testing component
+* doesn't support some methods of the interface
+* (<code>open(), close(), destroy()</code>)</li>
+* <li> <code>'XSimpleRegistry.open'</code> (of type <code>String</code>):
+* The full system path to the registry file which is opened and modified.
+* </li>
+* <li> <code>'XSimpleRegistry.destroy'</code> (of type <code>String</code>):
+* The full system path to the registry fiel which is destroyed.
+* </li>
+* <li> <code>'XSimpleRegistry.merge'</code> (of type <code>String</code>):
+* The full system path to the registry file which is merged with the
+* registry tested.
+* </li>
+* </ul> <p>
+* @see com.sun.star.registry.XSimpleRegistry
+*/
+public class _XSimpleRegistry extends MultiMethodTest {
+
+ public XSimpleRegistry oObj = null;
+ protected String nr = null;
+ protected String openF = null ;
+ protected String destroyF = null ;
+ protected String mergeF = null ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of required relations not found.
+ */
+ protected void before() {
+ nr = (String) tEnv.getObjRelation("NR");
+
+ openF = (String) tEnv.getObjRelation("XSimpleRegistry.open") ;
+ if (openF == null) throw new StatusException
+ (Status.failed("Relation 'XSimpleRegistry.open' not found")) ;
+
+ destroyF = (String) tEnv.getObjRelation("XSimpleRegistry.destroy") ;
+ if (destroyF == null) throw new StatusException
+ (Status.failed("Relation 'XSimpleRegistry.destroy' not found")) ;
+
+ mergeF = (String) tEnv.getObjRelation("XSimpleRegistry.merge") ;
+ if (mergeF == null) throw new StatusException
+ (Status.failed("Relation 'XSimpleRegistry.merge' not found")) ;
+ }
+
+ /**
+ * If the method is supported opens the registry key with the URL
+ * from <code>'XSimpleRegistry.open'</code> relation, then closes it. <p>
+ *
+ * Has <b> OK </b> status if the method isn't supported by the component
+ * (the object relation <code>'NR'</code> isn't null) or no exceptions were
+ * thrown during open/close operations. <p>
+ */
+ public void _open() {
+ if (nr != null) {
+ log.println("'open()' isn't supported by '" + nr + "'");
+ tRes.tested("open()", true);
+ return;
+ }
+
+ log.println("Trying to open registry :" + openF);
+ try {
+ oObj.open(openF, false, true);
+ oObj.close();
+ } catch (InvalidRegistryException e) {
+ e.printStackTrace(log);
+ tRes.tested("open()", false);
+ return;
+ }
+
+ tRes.tested("open()", true);
+ }
+
+ /**
+ * Test opens the registry key with the URL from
+ * <code>'XSimpleRegistry.open'</code> relation not only for read,
+ * calls the method, checks returned value and closes the registry. <p>
+ *
+ * Has <b> OK </b> status if returned value is false and no exceptions were
+ * thrown. <p>
+ */
+ public void _isReadOnly() {
+ boolean result = false;
+ try {
+ openReg(oObj, openF, false, true);
+ result = !oObj.isReadOnly();
+ closeReg(oObj);
+ } catch (InvalidRegistryException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("isReadOnly()", result);
+ }
+
+ /**
+ * Test opens the registry key with the URL from
+ * <code>'XSimpleRegistry.open'</code> relation, calls the method,
+ * checks returned value and closes the registry key. <p>
+ *
+ * Has <b>OK</b> status if returned value isn't null and no exceptions were
+ * thrown. <p>
+ */
+ public void _getRootKey() {
+ boolean result = false;
+ try {
+ openReg(oObj, openF, false, true);
+ XRegistryKey rootKey = oObj.getRootKey();
+ result = rootKey != null;
+ closeReg(oObj);
+ } catch (InvalidRegistryException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("getRootKey()", result);
+ }
+
+ /**
+ * Merges the current registry with the registry from URL got from
+ * <code>'XSimpleRegistry.merge'</code> relation under 'MergeKey' key.
+ * Then the keys of these two registries retrieved :
+ * <ul>
+ * <li> Root key from 'XSimpleRegistry.merge' registry </li>
+ * <li> 'MergeKey' key from the current registry </li>
+ * </ul>
+ * Then these two keys are recursively compared. <p>
+ *
+ * Has <b> OK </b> status if the method isn't supported by the component
+ * (the object relation <code>'NR'</code> isn't null)
+ * or
+ * if it's supported and after successfull merging the keys mentioned
+ * above are recursively equal. <p>
+ */
+ public void _mergeKey() {
+ if (nr != null) {
+ log.println("'mergeKey()' isn't supported by '" + nr + "'");
+ tRes.tested("mergeKey()", true);
+ return;
+ }
+
+ openReg(oObj, openF, false, true);
+
+ try {
+ RegistryTools.printRegistryInfo(oObj.getRootKey(), log);
+ oObj.mergeKey("MergeKey", mergeF);
+ RegistryTools.printRegistryInfo(oObj.getRootKey(), log);
+ } catch (com.sun.star.registry.MergeConflictException e) {
+ e.printStackTrace(log);
+ tRes.tested("mergeKey()", false);
+ return;
+ } catch (com.sun.star.registry.InvalidRegistryException e) {
+ e.printStackTrace(log);
+ tRes.tested("mergeKey()", false);
+ return;
+ }
+
+ boolean isEqual = false;
+ XSimpleRegistry reg = null;
+ try {
+ reg = RegistryTools.
+ createRegistryService(tParam.getMSF()) ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.print("Can't create registry service: ");
+ e.printStackTrace(log);
+ tRes.tested("mergeKey()", false);
+ return;
+ }
+ openReg(reg, mergeF, false, true);
+
+ try {
+ XRegistryKey key = oObj.getRootKey().openKey("MergeKey");
+ XRegistryKey mergeKey = reg.getRootKey();
+ isEqual = RegistryTools.compareKeyTrees(key, mergeKey);
+ } catch (com.sun.star.registry.InvalidRegistryException e) {
+ log.print("Can't get root key: ");
+ e.printStackTrace(log);
+ tRes.tested("mergeKey()", false);
+ return;
+ }
+
+ closeReg(reg);
+ closeReg(oObj);
+
+ tRes.tested("mergeKey()", isEqual) ;
+ }
+
+ /**
+ * Test opens the registry key with the URL from
+ * <code>'XSimpleRegistry.open'</code> relation, calls the method,
+ * checks returned value and closes the registry key. <p>
+ *
+ * Has <b> OK </b> status if returned value isn't null and if length of the
+ * returned string is greater than 0. <p>
+ */
+ public void _getURL() {
+ openReg(oObj, openF, false, true);
+ String url = oObj.getURL();
+ closeReg(oObj);
+ log.println("Getting URL: " + url);
+ tRes.tested("getURL()", url != null && url.length() > 0);
+ }
+
+ /**
+ * Test checks value returned by the object relation <code>'NR'</code>,
+ * opens the registry key with the URL from
+ * <code>XSimpleRegistry.open'</code> relation, calls the method
+ * and checks the validity of the registry key. <p>
+ *
+ * Has <b> OK </b> status if the registry key isn't valid after the method
+ * call, or if the method isn't supported by the component (the object
+ * relation <code>'NR'</code> isn't null). <p>
+ */
+ public void _close() {
+ if (nr != null) {
+ log.println("'close()' isn't supported by '" + nr + "'");
+ tRes.tested("close()", true);
+ return;
+ }
+
+ try {
+ oObj.open(openF, false, true);
+ oObj.close();
+ } catch (com.sun.star.registry.InvalidRegistryException e) {
+ e.printStackTrace(log);
+ tRes.tested("close()", false);
+ return;
+ }
+
+ tRes.tested("close()", !oObj.isValid());
+ }
+
+ /**
+ * Test checks value returned by the object relation <code>'NR'</code>,
+ * opens the registry key with the URL from
+ * <code>'XSimpleRegistry.destroy'</code> relation, calls the method
+ * and checks the validity of the registry key. <p>
+ *
+ * Has <b> OK </b> status if the registry key isn't valid after the method
+ * call, or if the method isn't supported by the component (the object
+ * relation <code>'NR'</code> isn't null). <p>
+ */
+ public void _destroy() {
+ if (nr != null) {
+ log.println("'destroy()' isn't supported by '" +nr + "'");
+ tRes.tested("destroy()", true);
+ return;
+ }
+
+ try {
+ oObj.open(destroyF, false, true);
+ oObj.destroy();
+ } catch (com.sun.star.registry.InvalidRegistryException e) {
+ e.printStackTrace(log);
+ tRes.tested("destroy()", false);
+ return;
+ }
+
+ tRes.tested("destroy()", !oObj.isValid());
+ }
+
+ /**
+ * Test opens the registry key with the URL from
+ * <code>'XSimpleRegistry.open'</code> relation, calls the method,
+ * checks returned value and closes the registry key. <p>
+ * Has <b> OK </b> status if returned value is true. <p>
+ */
+ public void _isValid() {
+ boolean valid = true;
+
+ openReg(oObj, openF, false, true);
+ valid = oObj.isValid();
+ closeReg(oObj);
+
+ tRes.tested("isValid()", valid);
+ }
+
+ /**
+ * Method calls <code>close()</code> of the interface
+ * <code>com.sun.star.registry.XRegistryKey</code>. <p>
+ * @param reg interface <code>com.sun.star.registry.XRegistryKey</code>
+ * @param url specifies the complete URL to access the data source
+ * @param arg1 specifies if the data source should be opened for read only
+ * @param arg2 specifies if the data source should be created if it does not
+ * already exist
+ */
+ public void openReg(XSimpleRegistry reg, String url,
+ boolean arg1, boolean arg2) {
+ if (nr == null) {
+ try {
+ reg.open(url, arg1, arg2);
+ } catch (com.sun.star.registry.InvalidRegistryException e) {
+ log.print("Couldn't open registry:");
+ e.printStackTrace(log);
+ }
+ }
+ }
+
+ /**
+ * Method calls <code>close()</code> of the interface
+ * <code>com.sun.star.registry.XRegistryKey</code>. <p>
+ * @param interface <code>com.sun.star.registry.XRegistryKey</code>
+ */
+ public void closeReg(XSimpleRegistry reg) {
+ if (nr == null) {
+ try {
+ reg.close();
+ } catch (com.sun.star.registry.InvalidRegistryException e) {
+ log.print("Couldn't close registry:");
+ e.printStackTrace(log);
+ }
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/script/_XEventAttacherManager.java b/qadevOOo/tests/java/ifc/script/_XEventAttacherManager.java
new file mode 100644
index 000000000000..8b350a3a4065
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/script/_XEventAttacherManager.java
@@ -0,0 +1,531 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XEventAttacherManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.script;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.script.ScriptEvent;
+import com.sun.star.script.ScriptEventDescriptor;
+import com.sun.star.script.XEventAttacherManager;
+import com.sun.star.script.XScriptListener;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.script.XEventAttacherManager</code>
+* interface methods :
+* <ul>
+* <li><code> registerScriptEvent()</code></li>
+* <li><code> registerScriptEvents()</code></li>
+* <li><code> revokeScriptEvent()</code></li>
+* <li><code> revokeScriptEvents()</code></li>
+* <li><code> insertEntry()</code></li>
+* <li><code> removeEntry()</code></li>
+* <li><code> getScriptEvents()</code></li>
+* <li><code> attach()</code></li>
+* <li><code> detach()</code></li>
+* <li><code> addScriptListener()</code></li>
+* <li><code> removeScriptListener()</code></li>
+* </ul> <p>
+* @see com.sun.star.script.XEventAttacherManager
+*/
+public class _XEventAttacherManager extends MultiMethodTest {
+
+ /**
+ * oObj filled by MultiMethodTest
+ */
+ public XEventAttacherManager oObj = null;
+
+ int index;
+
+ /**
+ * Test calls the method and stores index of new entry. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _insertEntry() {
+ index = 0;
+ try {
+ oObj.insertEntry(index);
+ tRes.tested("insertEntry()", true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("insertEntry(" + index
+ + ") throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("insertEntry()", false);
+ }
+ }
+
+ ScriptEventDescriptor desc;
+
+ /**
+ * Test creates <code>ScriptEventDescriptor</code>, registers
+ * the script event and stores the descriptor. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertEntry() </code> : to have entry's index</li>
+ * </ul>
+ * @see com.sun.star.script.ScriptEventDescriptor
+ */
+ public void _registerScriptEvent() {
+ requiredMethod("insertEntry()");
+ desc = new ScriptEventDescriptor(
+ "XEventListener1",
+ "disposing", "", "Basic", "");
+
+ try {
+ oObj.registerScriptEvent(index, desc);
+ tRes.tested("registerScriptEvent()", true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("registerScriptEvent() throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("registerScriptEvent()", false);
+ }
+ }
+
+ ScriptEventDescriptor descs[];
+
+ /**
+ * Test creates array of <code>ScriptEventDescriptor</code>, registers
+ * this script events and stores the descriptors. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertEntry() </code> : to have entry's index</li>
+ * </ul>
+ * @see com.sun.star.script.ScriptEventDescriptor
+ */
+ public void _registerScriptEvents() {
+ requiredMethod("insertEntry()");
+ descs = new ScriptEventDescriptor[] {
+ new ScriptEventDescriptor(
+ "XEventListener2",
+ "disposing", "", "Basic", ""),
+ new ScriptEventDescriptor(
+ "XEventListener3",
+ "disposing", "", "Basic", "")
+ };
+
+ try {
+ oObj.registerScriptEvents(index, descs);
+ tRes.tested("registerScriptEvents()", true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("registerScriptEvents() throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("registerScriptEvents()", false);
+ }
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned array of descriptors contains
+ * array of descriptors registered by methods <code>registerScriptEvents</code>
+ * and <code>registerScriptEvent</code> and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerScriptEvent() </code> :
+ * to have registered descriptor </li>
+ * <li> <code> registerScriptEvents() </code> :
+ * to have registered descriptors </li>
+ * </ul>
+ */
+ public void _getScriptEvents() {
+ requiredMethod("registerScriptEvent()");
+ requiredMethod("registerScriptEvents()");
+
+ ScriptEventDescriptor[] res;
+
+ try {
+ res = oObj.getScriptEvents(index);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("registerScriptEvents() throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("registerScriptEvents()", false);
+ return;
+ }
+
+ // checking the desc and descs are in script events
+ tRes.tested("getScriptEvents()",
+ contains(res, desc) && containsArray(res, descs));
+
+ log.println("Script events :") ;
+ printEvents(res) ;
+ }
+
+ /**
+ * Method checks that array of descriptors contains the concrete desciptor.
+ * @param container the array of descriptors
+ * @param evt the descriptor which presence in the array is checked
+ * @return true if the descriptor presence in the array
+ */
+ boolean contains(ScriptEventDescriptor[] container,
+ ScriptEventDescriptor evt) {
+ for (int i = 0; i < container.length; i++) {
+ if (equal(container[i], evt)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Method checks that one array of descriptors contains
+ * another array of descriptors.
+ * @param container the array of descriptors
+ * @param events the array of descriptors which presence
+ * in array <code>container</code> is checked
+ * @return true if the array <code>events</code> contains in the array
+ * <code>container</code>
+ */
+ boolean containsArray(ScriptEventDescriptor[] container,
+ ScriptEventDescriptor[] events) {
+ for (int i = 0; i < events.length; i++) {
+ if (!contains(container, events[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Compares descriptor <code>evt1</code> to descriptor <code>evt2</code>.
+ * Two descriptors are considered equal if all their fields are equal.
+ * @return true if the argument is not <code>null</code> and
+ * the descriptors are equal; false otherwise
+ */
+ boolean equal(ScriptEventDescriptor evt1,
+ ScriptEventDescriptor evt2) {
+ return evt1.ListenerType.equals(evt2.ListenerType)
+ && evt1.EventMethod.equals(evt2.EventMethod)
+ && evt1.ScriptType.equals(evt2.ScriptType)
+ && evt1.ScriptCode.equals(evt2.ScriptCode)
+ && evt1.AddListenerParam.equals(evt2.AddListenerParam);
+ }
+
+ /**
+ * Prints fields of descriptor <code>evt</code> to log.
+ * @param evt the descriptor that needs to be printed to log
+ */
+ void printEvent(ScriptEventDescriptor evt) {
+ if (evt == null) {
+ log.println("null");
+ } else {
+ log.println("\"" + evt.ListenerType + "\",\""
+ + evt.EventMethod + "\",\""
+ + evt.ScriptType + "\",\""
+ + evt.ScriptCode + "\",\""
+ + evt.AddListenerParam + "\"");
+ }
+ }
+
+ /**
+ * Prints the descriptors to log.
+ * @param events the array of descriptors that need to be printed to log
+ */
+ void printEvents(ScriptEventDescriptor events[]) {
+ if (events == null) {
+ log.println("null");
+ } else {
+ for (int i = 0; i < events.length; i++) {
+ printEvent(events[i]);
+ }
+ }
+ }
+
+ Object attachedObject;
+
+ /**
+ * Test creates instance of <code>TypeDescriptionProvider</code>,
+ * stores it and attaches it to the entry with index stored in the method
+ * <code>insertEntry()</code>. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertEntry() </code> : to have entry's index for attach</li>
+ * @see com.sun.star.reflection.TypeDescriptionProvider
+ */
+ public void _attach() {
+ requiredMethod("insertEntry()");
+
+ try {
+ XMultiServiceFactory xMSF = tParam.getMSF();
+ attachedObject = xMSF.createInstance
+ ( "com.sun.star.reflection.TypeDescriptionProvider" );
+ } catch( com.sun.star.uno.Exception e ) {
+ log.println("Service not available" );
+ e.printStackTrace(log);
+ tRes.tested("attach()", false);
+ return;
+ }
+
+ try {
+ oObj.attach(index, attachedObject, "param");
+ tRes.tested("attach()", true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("attach() throws exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("attach()", false);
+ } catch (com.sun.star.lang.ServiceNotRegisteredException e) {
+ log.println("attach() throws exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("attach()", false);
+ }
+ }
+
+ /**
+ * Test calls the method for the object that was stored in the method
+ * <code>attach()</code>. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> attach() </code> : to have attached object </li>
+ * </ul>
+ */
+ public void _detach() {
+ requiredMethod("attach()");
+
+ try {
+ oObj.detach(index, attachedObject);
+ tRes.tested("detach()", true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("detach() throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("detach()", false);
+ }
+ }
+
+ /**
+ * Test revokes script event that was registered by method
+ * <code>registerScriptEvent()</code> and checks that the description
+ * was removed. <p>
+ * Has <b> OK </b> status if description was successfully removed. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerScriptEvent() </code> :
+ * to have registered descriptor </li>
+ * </ul>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getScriptEvents() </code> :
+ * this method must be executed first </li>
+ * </ul>
+ */
+ public void _revokeScriptEvent() {
+ requiredMethod("registerScriptEvent()");
+ executeMethod("getScriptEvents()") ;
+
+ try {
+ oObj.revokeScriptEvent(index, desc.ListenerType,
+ desc.EventMethod, "");
+
+ ScriptEventDescriptor[] res = oObj.getScriptEvents(index);
+ // checking that the desc has been removed
+ tRes.tested("revokeScriptEvent()", !contains(res, desc));
+ printEvents(res) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("revokeScriptEvent() throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("revokeScriptEvent()", false);
+ }
+ }
+
+ /**
+ * Test revokes script events that was registered by method
+ * <code>registerScriptEvents()</code> and checks that the descriptions
+ * were removed. <p>
+ * Has <b> OK </b> status if descriptions were successfully removed. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> revokeScriptEvent() </code> :
+ * this method must be executed first </li>
+ * </ul>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getScriptEvents() </code> :
+ * this method must be executed first </li>
+ * </ul>
+ */
+ public void _revokeScriptEvents() {
+ requiredMethod("revokeScriptEvent()");
+ executeMethod("getScriptEvents()") ;
+
+ try {
+ oObj.revokeScriptEvents(index);
+
+ ScriptEventDescriptor[] res = oObj.getScriptEvents(index);
+ // checking that all events have been removed
+ tRes.tested("revokeScriptEvents()",
+ res == null || res.length == 0);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("revokeScriptEvents() throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("revokeScriptEvents()", false);
+ }
+ }
+
+ /**
+ * Test calls the method with entry's index that was stored in method
+ * <code>insertEntry()</code>. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertEntry() </code> :
+ * to have entry's index </li>
+ */
+ public void _removeEntry() {
+ requiredMethod("insertEntry()");
+ try {
+ oObj.removeEntry(index);
+ tRes.tested("removeEntry()", true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("removeEntry(" + index
+ + ") throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("removeEntry()", false);
+ }
+ }
+
+ XScriptListener listener;
+
+ /**
+ * Test creates object that supports interface <code>XScriptListener</code>,
+ * stores it and addes this scripts listener. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * @see com.sun.star.script.XScriptListener
+ */
+ public void _addScriptListener() {
+ listener = new MyScriptListener();
+
+ try {
+ oObj.addScriptListener(listener);
+ tRes.tested("addScriptListener()", true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("addScriptListener() throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("addScriptListener()", false);
+ }
+ }
+
+ /**
+ * Test removes script listener that was stored in method
+ * <code>addScriptListener()</code>. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addScriptListener() </code> :
+ * to have script listener </li>
+ * </ul>
+ */
+ public void _removeScriptListener() {
+ requiredMethod("addScriptListener()");
+
+ try {
+ oObj.removeScriptListener(listener);
+ tRes.tested("removeScriptListener()", true);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("removeScriptListener() throws unexpected exception "
+ + e.getMessage());
+ e.printStackTrace(log);
+ tRes.tested("removeScriptListener()", false);
+ }
+ }
+
+ /**
+ * Class implement interface <code>XScriptListener</code>
+ * for test of the method <code>addScriptListener()</code>.
+ * No functionality implemented.
+ * @see com.sun.star.script.XScriptListener
+ */
+ class MyScriptListener implements XScriptListener {
+ public void firing(ScriptEvent evt) {
+ }
+
+ public Object approveFiring(ScriptEvent evt) {
+ return evt.Helper;
+ }
+
+ public void disposing(EventObject evt) {
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java
new file mode 100644
index 000000000000..43ab97d736f9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XInvocationAdapterFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.script;
+
+import com.sun.star.io.XInputStream;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.script.XInvocation;
+import com.sun.star.script.XInvocationAdapterFactory;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.script.XInvocationAdapterFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createAdapter()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.script.XInvocationAdapterFactory
+*/
+public class _XInvocationAdapterFactory extends MultiMethodTest {
+
+ /**
+ * oObj filled by MultiMethodTest
+ */
+ public XInvocationAdapterFactory oObj = null;
+
+ /**
+ * First an invocation object of <code>com.sun.star.io.Pipe</code>
+ * instance is created using <code>com.sun.star.script.Invocation
+ * </code> service. Then trying to create an adapter of this
+ * invocation for <code>com.sun.star.io.XInputStream</code>
+ * interface. <p>
+ * Has <b>OK</b> status if the adapter returned is successfully
+ * queried for <code>com.sun.star.io.XInputStream</code>
+ * interface.
+ * @see com.sun.star.script.Invocation
+ * @see com.sun.star.script.XInvocation
+ * @see com.sun.star.io.Pipe
+ */
+ public void _createAdapter() {
+ XInvocation xInv = null ;
+ try {
+ Object[] args = {tParam.getMSF().createInstance
+ ("com.sun.star.io.Pipe")};
+
+ Object oInvFac = tParam.getMSF().createInstance
+ ("com.sun.star.script.Invocation") ;
+
+ XSingleServiceFactory xInvFac = (XSingleServiceFactory) UnoRuntime.
+ queryInterface(XSingleServiceFactory.class, oInvFac) ;
+
+ Object oInv = xInvFac.createInstanceWithArguments(args) ;
+
+ xInv = (XInvocation) UnoRuntime.queryInterface
+ (XInvocation.class, oInv) ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Cann't create invocation for object", e) ;
+ }
+
+ XInterface xInStr = null ;
+
+ Object adp = oObj.createAdapter(xInv,
+ new Type(XInputStream.class)) ;
+
+ xInStr = (XInterface) UnoRuntime.queryInterface
+ (XInputStream.class, adp) ;
+
+
+ if (xInStr != null)
+ tRes.tested("createAdapter()", true) ;
+ else {
+ log.println("Adapter created doesn't implement required interface") ;
+ tRes.tested("createAdapter()", false) ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java
new file mode 100644
index 000000000000..30d825e09021
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XInvocationAdapterFactory2.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.script;
+
+import com.sun.star.io.XInputStream;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.script.XInvocation;
+import com.sun.star.script.XInvocationAdapterFactory2;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.script.XInvocationAdapterFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createAdapter()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.script.XInvocationAdapterFactory
+*/
+public class _XInvocationAdapterFactory2 extends MultiMethodTest {
+
+ /**
+ * oObj filled by MultiMethodTest
+ */
+ public XInvocationAdapterFactory2 oObj = null;
+
+ /**
+ * First an invocation object of <code>com.sun.star.io.Pipe</code>
+ * instance is created using <code>com.sun.star.script.Invocation
+ * </code> service. Then trying to create an adapter of this
+ * invocation for <code>com.sun.star.io.XInputStream</code>
+ * interface. <p>
+ * Has <b>OK</b> status if the adapter returned is successfully
+ * queried for <code>com.sun.star.io.XInputStream</code>
+ * interface.
+ * @see com.sun.star.script.Invocation
+ * @see com.sun.star.script.XInvocation
+ * @see com.sun.star.io.Pipe
+ */
+ public void _createAdapter() {
+ XInvocation xInv = null ;
+ try {
+ Object[] args = {tParam.getMSF().createInstance
+ ("com.sun.star.io.Pipe")};
+
+ Object oInvFac = tParam.getMSF().createInstance
+ ("com.sun.star.script.Invocation") ;
+
+ XSingleServiceFactory xInvFac = (XSingleServiceFactory) UnoRuntime.
+ queryInterface(XSingleServiceFactory.class, oInvFac) ;
+
+ Object oInv = xInvFac.createInstanceWithArguments(args) ;
+
+ xInv = (XInvocation) UnoRuntime.queryInterface
+ (XInvocation.class, oInv) ;
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Cann't create invocation for object", e) ;
+ }
+
+ XInterface xInStr = null ;
+
+ Type[] types = new Type[1];
+ types[0] = new Type(XInputStream.class);
+
+ Object adp = oObj.createAdapter(xInv,types);
+
+ xInStr = (XInterface) UnoRuntime.queryInterface
+ (XInputStream.class, adp) ;
+
+
+ if (xInStr != null)
+ tRes.tested("createAdapter()", true) ;
+ else {
+ log.println("Adapter created doesn't implement required interface") ;
+ tRes.tested("createAdapter()", false) ;
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/script/_XTypeConverter.java b/qadevOOo/tests/java/ifc/script/_XTypeConverter.java
new file mode 100644
index 000000000000..845d7382a15d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/script/_XTypeConverter.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTypeConverter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.script;
+
+import com.sun.star.container.XSet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.script.XTypeConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.TypeClass;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.script.XTypeConverter</code>
+* interface methods :
+* <ul>
+* <li><code> convertTo()</code></li>
+* <li><code> convertToSimpleType()</code></li>
+* </ul> <p>
+* @see com.sun.star.script.XTypeConverter
+*/
+public class _XTypeConverter extends MultiMethodTest {
+
+ /**
+ * oObj filled by MultiMethodTest
+ */
+ public XTypeConverter oObj = null;
+
+ /**
+ * Test creates instance of <code>TypeDescriptionManager</code>,
+ * and converts it to <code>XSet</code>. <p>
+ * Has <b> OK </b> status if returned value is instance of <code>XSet</code>
+ * and no exceptions were thrown. <p>
+ * @see com.sun.star.comp.stoc.TypeDescriptionManager
+ * @see com.sun.star.container.XSet
+ */
+ public void _convertTo() {
+ XMultiServiceFactory xMSF = tParam.getMSF() ;
+ Object value = null ;
+
+ try {
+ value = xMSF.createInstance
+ ("com.sun.star.comp.stoc.TypeDescriptionManager") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create value to convert") ;
+ e.printStackTrace(log) ;
+ tRes.tested("convertTo()", false) ;
+ }
+
+ try {
+ Type destType = new Type(XSet.class) ;
+
+ Object res = oObj.convertTo(value, destType) ;
+
+ tRes.tested("convertTo()", res instanceof XSet) ;
+ } catch (com.sun.star.script.CannotConvertException e) {
+ log.println("Exception while converting value.") ;
+ e.printStackTrace(log) ;
+ tRes.tested("convertTo()", false) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while converting value.") ;
+ e.printStackTrace(log) ;
+ tRes.tested("convertTo()", false) ;
+ }
+ }
+
+ /**
+ * Test creates instance of <code>Integer</code>,
+ * and converts it to <code>String</code>. <p>
+ * Has <b> OK </b> status if returned value is instance of <code>String</code>,
+ * if returned value is string representation of integer value that
+ * was passed to method and no exceptions were thrown. <p>
+ */
+ public void _convertToSimpleType() {
+ Object value = new Integer(123) ;
+ Object destValue = null ;
+
+ try {
+ destValue = oObj.convertToSimpleType(value, TypeClass.STRING) ;
+ } catch (com.sun.star.script.CannotConvertException e) {
+ log.println("Exception while converting value.") ;
+ e.printStackTrace(log) ;
+ tRes.tested("convertToSimpleType()", false) ;
+ return ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while converting value.") ;
+ e.printStackTrace(log) ;
+ tRes.tested("convertToSimpleType()", false) ;
+ return ;
+ }
+
+ tRes.tested("convertToSimpleType()", destValue != null &&
+ destValue instanceof String &&
+ ((String) destValue).equals("123")) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_DataSource.java b/qadevOOo/tests/java/ifc/sdb/_DataSource.java
new file mode 100644
index 000000000000..eca020b54228
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_DataSource.java
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DataSource.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.beans.PropertyValue;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+ * Testing <code>com.sun.star.sdb.DataSource</code>
+ * service properties :
+ * <ul>
+ * <li><code> Name</code></li>
+ * <li><code> URL</code></li>
+ * <li><code> Info</code></li>
+ * <li><code> User</code></li>
+ * <li><code> Password</code></li>
+ * <li><code> IsPasswordRequired</code></li>
+ * <li><code> SuppressVersionColumns</code></li>
+ * <li><code> IsReadOnly</code></li>
+ * <li><code> NumberFormatsSupplier</code></li>
+ * <li><code> TableFilter</code></li>
+ * <li><code> TableTypeFilter</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code> <p>.
+* After this interface test <b>it's better to recreate</b> object tested.
+* @see com.sun.star.beans.XPropertySet
+* @see com.sun.star.beans.XPropertySetInfo
+* @see com.sun.star.beans.Property
+* @see com.sun.star.lang.XServiceInfo
+*/
+public class _DataSource extends MultiPropertyTest {
+
+ /**
+ * This property is an array of additional parameters for database
+ * connecting. Parameter is <code>PropertyValue</code> structure.
+ * The test just changes existing array onto array with a single
+ * element <code>("user", "API_QA_Tester")</code> <p>
+ *
+ * After testing old value is set for this property. <p>
+ *
+ * Result is OK: if property successfully changed with no excepions.
+ * @see com.sun.star.beans.PropertyValue
+ */
+ public void _Info() {
+ try {
+ Object oldInfo = oObj.getPropertyValue("Info") ;
+
+ testProperty("Info", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+
+ PropertyValue propUsr = new PropertyValue(),
+ propPass = new PropertyValue() ;
+
+ propUsr.Name = "user" ;
+ propUsr.Value = "API_QA_Tester" ;
+ propPass.Name = "password" ;
+ propPass.Value = "guest" ;
+
+ return new PropertyValue[] { propUsr, propPass } ;
+ }
+ }) ;
+
+ oObj.setPropertyValue("Info", oldInfo) ;
+ } 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) {}
+ }
+
+ /**
+ * Property is tested by the common method, but after testing
+ * old value is set for this property.
+ */
+ public void _URL() {
+ try {
+ Object oldURL = oObj.getPropertyValue("URL") ;
+
+ testProperty("URL") ;
+
+ oObj.setPropertyValue("URL", oldURL) ;
+ } 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) {}
+ }
+
+ /**
+ * Property is tested by the common method, but after testing
+ * old value is set for this property.
+ */
+ public void _User() {
+ try {
+ Object oldUser = oObj.getPropertyValue("User") ;
+
+ testProperty("User") ;
+
+ oObj.setPropertyValue("User", oldUser) ;
+ } 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) {}
+ }
+
+ /**
+ * Property is tested by the common method, but after testing
+ * old value is set for this property.
+ */
+ public void _Password() {
+ try {
+ Object oldPass = oObj.getPropertyValue("Password") ;
+
+ testProperty("Password") ;
+
+ oObj.setPropertyValue("Password", oldPass) ;
+ } 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) {}
+ }
+
+ /**
+ * New value for the test is always <code>null</code>.
+ */
+ public void _NumberFormatsSupplier() {
+ testProperty("NumberFormatsSupplier", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return null ;
+ }
+ }) ;
+ }
+
+ /**
+ * If object test allows to recreate environment it is better to do it.
+ */
+ public void after() {
+ try {
+ oObj.setPropertyValue("IsPasswordRequired",new Boolean(false));
+ } catch (Exception e) {
+ log.println("Couldn't set 'IsPasswordRequired' to false");
+ }
+ }
+
+} // finish class _DataSource
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_DatasourceAdministrationDialog.java b/qadevOOo/tests/java/ifc/sdb/_DatasourceAdministrationDialog.java
new file mode 100644
index 000000000000..2affcc4597bc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_DatasourceAdministrationDialog.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DatasourceAdministrationDialog.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.sdb.DatasourceAdministrationDialog</code>
+ * service properties :
+ * <ul>
+ * <li><code> Title</code></li>
+ * <li><code> ParentWindow</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.sdb.DatasourceAdministrationDialog
+ */
+public class _DatasourceAdministrationDialog extends MultiPropertyTest {
+
+} // EOF DatasourceAdministrationDialog
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_ErrorMessageDialog.java b/qadevOOo/tests/java/ifc/sdb/_ErrorMessageDialog.java
new file mode 100644
index 000000000000..c4f3addb67cf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_ErrorMessageDialog.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ErrorMessageDialog.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiPropertyTest;
+import lib.TestEnvironment;
+
+/**
+ * Testing <code>com.sun.star.sdb.ErrorMessageDialog</code>
+ * service properties :
+ * <ul>
+ * <li><code> Title</code></li>
+ * <li><code> ParentWindow</code></li>
+ * <li><code> SQLException</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'ERR1', 'ERR2'</code>
+ * (of type <code>com.sun.star.sdbc.SQLException</code>):
+ * two objects which are used for changing 'SQLException'
+ * property. </li>
+ * <ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.sdb.ErrorMessageDialog
+ */
+public class _ErrorMessageDialog extends MultiPropertyTest {
+
+ /**
+ * <code>SQLException</code> instances must be used as property
+ * value.
+ */
+ public void _SQLException() {
+ log.println("Testing with custom Property tester") ;
+ final TestEnvironment ftEnv = tEnv ;
+ testProperty("SQLException", tEnv.getObjRelation("ERR1"),
+ tEnv.getObjRelation("ERR2")) ;
+ }
+
+} // finish class _ErrorMessageDialog
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_QueryDefinition.java b/qadevOOo/tests/java/ifc/sdb/_QueryDefinition.java
new file mode 100644
index 000000000000..e1613294084c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_QueryDefinition.java
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * $RCSfile: _QueryDefinition.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.sdb.QueryDefinition</code>
+ * service properties :
+ * <ul>
+ * <li><code> Name</code></li>
+ * <li><code> Command</code></li>
+ * <li><code> EscapeProcessing</code></li>
+ * <li><code> UpdateTableName</code></li>
+ * <li><code> UpdateCatalogName</code></li>
+ * <li><code> UpdateSchemaName</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.sdb.QueryDefinition
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.beans.XPropertySetInfo
+ * @see com.sun.star.beans.Property
+ * @see com.sun.star.lang.XServiceInfo
+ */
+public class _QueryDefinition extends MultiPropertyTest {
+
+
+} // finish class _QueryDefinition
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_RowSet.java b/qadevOOo/tests/java/ifc/sdb/_RowSet.java
new file mode 100644
index 000000000000..d005305b5ba2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_RowSet.java
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * $RCSfile: _RowSet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.sdbc.XConnection;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+ * Testing <code>com.sun.star.sdb.RowSet</code>
+ * service properties :
+ * <ul>
+ * <li><code> ActiveConnection</code></li>
+ * <li><code> DataSourceName</code></li>
+ * <li><code> Command</code></li>
+ * <li><code> CommandType</code></li>
+ * <li><code> ActiveCommand</code></li>
+ * <li><code> IgnoreResult</code></li>
+ * <li><code> Filter</code></li>
+ * <li><code> ApplyFilter</code></li>
+ * <li><code> Order</code></li>
+ * <li><code> Privileges</code></li>
+ * <li><code> IsModified</code></li>
+ * <li><code> IsNew</code></li>
+ * <li><code> RowCount</code></li>
+ * <li><code> IsRowCountFinal</code></li>
+ * <li><code> UpdateTableName</code></li>
+ * <li><code> UpdateCatalogName</code></li>
+ * <li><code> UpdateSchemaName</code></li>
+ * </ul> <p>
+ *
+ * Properties are tested in a safe way, this means that old
+ * properties' values are restored to their previous values
+ * after testing. These values are meaningfull for further
+ * testing. <p>
+ *
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.sdb.RowSet
+ */
+public class _RowSet extends MultiPropertyTest {
+
+ /**
+ * The tester implementation which restores properties
+ * values after testing.
+ */
+ protected class SafeTester extends PropertyTester {
+ Object oldValue = null ;
+
+ protected Object getNewValue(String prop, Object old) {
+ log.println("Testing with SafeTester ...") ;
+ oldValue = old ;
+ return super.getNewValue(prop, old) ;
+ }
+
+ protected void checkResult(String propName, Object oldValue,
+ Object newValue, Object resValue, Exception exception)
+ throws Exception {
+
+ super.checkResult(propName, oldValue, newValue, resValue, exception);
+
+ try {
+ oObj.setPropertyValue(propName, this.oldValue);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while setting property to its old value '" +
+ this.oldValue + "' (ignoring) : " + e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while setting property to its old value '" +
+ this.oldValue + "' (ignoring) : " + e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while setting property to its old value '" +
+ this.oldValue + "' (ignoring) : " + e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while setting property to its old value '" +
+ this.oldValue + "' (ignoring) : " + e );
+ }
+
+ }
+ }
+
+ /**
+ * Overriden method which tests all the properties
+ * with <code>SafeTester</code>.
+ *
+ * @see #SafeTester
+ */
+ protected void testProperty(String propName) {
+ testProperty(propName, new SafeTester()) ;
+ }
+
+ public void _ActiveConnection() {
+ boolean result = false;
+ try {
+ XConnection the_connection = (XConnection)
+ oObj.getPropertyValue("ActiveConnection");
+ result = (the_connection != null);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("the property is unknown");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println(e.getMessage());
+ }
+
+ tRes.tested("ActiveConnection", result) ;
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+} // EOF DatasourceAdministrationDialog
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XBookmarksSupplier.java b/qadevOOo/tests/java/ifc/sdb/_XBookmarksSupplier.java
new file mode 100644
index 000000000000..f5922679e319
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XBookmarksSupplier.java
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XBookmarksSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdb.XBookmarksSupplier;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.sdb.XBookmarksSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getBookmarks()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.sdb.XBookmarksSupplier
+ */
+public class _XBookmarksSupplier extends MultiMethodTest {
+
+ public XBookmarksSupplier oObj = null ;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getBookmarks() {
+ XNameAccess bookmarks = oObj.getBookmarks();
+ tRes.tested("getBookmarks()",bookmarks != null);
+ }
+
+} // finish class _XBookmarksSupplier
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XCompletedConnection.java b/qadevOOo/tests/java/ifc/sdb/_XCompletedConnection.java
new file mode 100644
index 000000000000..87a8d2e9f270
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XCompletedConnection.java
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCompletedConnection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.sdb.XCompletedConnection;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.task.XInteractionHandler;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.sdb.XCompletedConnection</code>
+ * interface methods :
+ * <ul>
+ * <li><code> connectWithCompletion()</code></li>
+ * </ul> <p>
+* The following object relations required :
+* <ul>
+* <li> <code>'XCompletedConnection.Handler'</code> : passed as parameter
+* to <code>connectWithCompletion</code> method. </li>
+* </ul>
+* @see com.sun.star.sdb.XCompletedConnection
+* @see com.sun.star.task.XInteractionHandler
+* @see com.sun.star.sdbc.XConnection
+*/
+public class _XCompletedConnection extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XCompletedConnection oObj = null ;
+
+ /**
+ * Test call the method with handler passed as object relation.
+ * Then value returned is checked.<p>
+ * Has OK status if not null value returned. <&nbsp>
+ * FAILED if exception occured, null value returned or object
+ * relation was not found.
+ */
+ public void _connectWithCompletion() throws StatusException {
+ XInteractionHandler handler = (XInteractionHandler)
+ tEnv.getObjRelation("XCompletedConnection.Handler") ;
+
+ if (handler == null) {
+ log.println("Required object relation not found !") ;
+ tRes.tested("connectWithCompletion()", false) ;
+ return ;
+ }
+
+ XConnection con = null ;
+ try {
+ con = oObj.connectWithCompletion(handler) ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ throw new StatusException("Exception while method calling", e) ;
+ }
+
+ tRes.tested("connectWithCompletion()", con != null) ;
+ }
+} // finish class _XCompletedConnection
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XQueryDefinitionsSupplier.java b/qadevOOo/tests/java/ifc/sdb/_XQueryDefinitionsSupplier.java
new file mode 100644
index 000000000000..05f1a2408501
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XQueryDefinitionsSupplier.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XQueryDefinitionsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdb.XQueryDefinitionsSupplier;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.sdb.XQueryDefinitionsSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getQueryDefinitions()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.sdb.XQueryDefinitionsSupplier
+ */
+public class _XQueryDefinitionsSupplier extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XQueryDefinitionsSupplier oObj = null ;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getQueryDefinitions() {
+
+ XNameAccess docs = oObj.getQueryDefinitions() ;
+
+ String[] docNames = docs.getElementNames() ;
+ if (docNames != null) {
+ log.println("Totally " + docNames.length + " queries :") ;
+ for (int i = 0; i < docNames.length; i++)
+ log.println(" " + docNames[i]) ;
+ }
+
+ tRes.tested("getQueryDefinitions()", docNames != null) ;
+ }
+
+} // finish class _XQueryDefinitionsSupplier
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XResultSetAccess.java b/qadevOOo/tests/java/ifc/sdb/_XResultSetAccess.java
new file mode 100644
index 000000000000..0e439eb3d3ab
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XResultSetAccess.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XResultSetAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.sdb.XResultSetAccess;
+import com.sun.star.sdbc.XResultSet;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sdb.XResultSetAccess</code>
+* interface methods :
+* <ul>
+* <li><code> createResultSet()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.sdb.XResultSetAccess
+*/
+public class _XResultSetAccess extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XResultSetAccess oObj = null ;
+
+ /**
+ * tries to create a ResultSet for the Object</br>
+ * an XResultSet is returned.</br>
+ * The test is OK if an not null ResultSet is returned
+ */
+ public void _createResultSet() {
+
+ try {
+ XResultSet the_Set = oObj.createResultSet();
+ if (the_Set == null) log.println("'createResulSet()' returns NULL");
+ tRes.tested("createResultSet()",the_Set != null);
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("Exception while checking 'createResultSet()'");
+ e.printStackTrace(log);
+ tRes.tested("createResultSet()",false);
+ }
+
+ }
+} // finish class _XResultSetAccess
+
+
diff --git a/qadevOOo/tests/java/ifc/sdb/_XRowSetApproveBroadcaster.java b/qadevOOo/tests/java/ifc/sdb/_XRowSetApproveBroadcaster.java
new file mode 100644
index 000000000000..2c6a7ae9065d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdb/_XRowSetApproveBroadcaster.java
@@ -0,0 +1,248 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRowSetApproveBroadcaster.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdb;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.sdb.RowChangeEvent;
+import com.sun.star.sdb.XRowSetApproveBroadcaster;
+import com.sun.star.sdb.XRowSetApproveListener;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* <code>com.sun.star.sdb.XRowSetApproveBroadcaster</code> interface test. <p>
+* Required object relations :
+* <ul>
+* <li> <code>'XRowSetApproveBroadcaster.ApproveChecker'</code>:
+* implementation of inner interface <code>RowSetApproveChecker</code>
+* which can move cursor within a rowset, change row, and change the
+* whole rowset. </li>
+* </ul> <p>
+* It is better to recreate the object after test, because of unknown
+* actions made by <code>RowSetApproveChecker</code> interface implementation.
+*
+* @see com.sun.star.sdb.XRowSetApproveBroadcaster
+* @see _XRowSetApproveBroadcaster.RowSetApproveChecker
+*/
+public class _XRowSetApproveBroadcaster extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XRowSetApproveBroadcaster oObj = null ;
+
+ /**
+ * The purpose of this interface is to pass to this test
+ * relation which can make some operations with row set
+ * on which <code>XRowSetApproveListener</code>s can react.
+ * @see com.sun.star.sdb.XRowSetApproveListener
+ */
+ public static interface RowSetApproveChecker {
+ /**
+ * Moves cursor within row set. Method <code>approveCursorMove</code>
+ * of <code>XRowSetApproveListener</code> must be called.
+ */
+ public void moveCursor() ;
+ /**
+ * Change rows in row set. Method <code>approveRowChange</code>
+ * of <code>XRowSetApproveListener</code> must be called.
+ * @return <code>RowChangeEvent</code> structure which contains
+ * what type of change was made and how many rows it affected.
+ * @see com.sun.star.sdb.RowChangeEvent
+ */
+ public RowChangeEvent changeRow() ;
+ /**
+ * Change the whole row set. Method <code>approveRowSetChange</code>
+ * of <code>XRowSetApproveListener</code> must be called.
+ */
+ public void changeRowSet() ;
+ }
+
+ /**
+ * Implementation of <code>XRowSetApproveListener</code> interface
+ * which just detects and stores approve requipements. They are checked
+ * later.
+ */
+ private class TestListener implements XRowSetApproveListener {
+ public boolean approveRequests = true ;
+ public boolean approveCursorMoveCalled = false ;
+ public boolean approveRowChangeCalled = false ;
+ public RowChangeEvent approveRowChangeEvent = null ;
+ public boolean approveRowSetChangeCalled = false ;
+
+ public TestListener(boolean approve) {
+ approveRequests = approve ;
+ }
+
+ public void reset() {
+ approveCursorMoveCalled = false ;
+ approveRowChangeCalled = false ;
+ approveRowSetChangeCalled = false ;
+ }
+ public boolean approveCursorMove(EventObject ev) {
+ approveCursorMoveCalled = true ;
+ return approveRequests ;
+ }
+ public boolean approveRowChange(RowChangeEvent ev) {
+ approveRowChangeCalled = true ;
+ approveRowChangeEvent = ev ;
+ return approveRequests ;
+ }
+ public boolean approveRowSetChange(EventObject ev) {
+ approveRowSetChangeCalled = true ;
+ return approveRequests ;
+ }
+ public void disposing(EventObject ev) {}
+ }
+ private TestListener listener1 = null ;
+ private TestListener listener2 = null ;
+
+ private RowSetApproveChecker checker = null ;
+
+ /**
+ * Tries to retrieve object relation.
+ */
+ public void before() {
+ checker = (RowSetApproveChecker) tEnv.getObjRelation
+ ("XRowSetApproveBroadcaster.ApproveChecker") ;
+
+ if (checker == null) {
+ log.println("!!! Relation for test not found !!!") ;
+ throw new StatusException(Status.failed
+ ("!!! Relation for test not found !!!")) ;
+ }
+ }
+
+ /**
+ * Creates and adds listener, then call <code>RowSetApproveChecker</code>
+ * methods for listener methods to be called. Then checks if
+ * listener methods were called on appropriate actions. <p>
+ * Has OK status : If and only if appropriate listener methods called,
+ * and listener <code>approveRowChange</code> method has write parameter,
+ * i.e. type and rows number expected.
+ */
+ public void _addRowSetApproveListener() {
+ listener1 = new TestListener(true) ;
+ oObj.addRowSetApproveListener(listener1) ;
+ log.println("Listener added.") ;
+
+ boolean result = true ;
+
+ checker.moveCursor() ;
+ log.println("Cursor moved.") ;
+ result &= listener1.approveCursorMoveCalled ;
+
+ listener1.reset() ;
+ RowChangeEvent actualEvent = checker.changeRow() ;
+ log.println("Row changed.") ;
+
+ RowChangeEvent event = listener1.approveRowChangeEvent ;
+ result &= listener1.approveRowChangeCalled ;
+
+ boolean eventOK = event.Action == actualEvent.Action &&
+ event.Rows == actualEvent.Rows ;
+
+ result &= eventOK ;
+
+ listener1.reset() ;
+ checker.changeRowSet();
+ log.println("Row set changed.") ;
+ result &= listener1.approveRowSetChangeCalled ;
+
+ tRes.tested("addRowSetApproveListener()", result) ;
+ }
+
+ /**
+ * Removes listener inserted before, then perform all actions
+ * on which listener must react. <p>
+ * Has OK status if no listener methods were called. <p>
+ * Methods required to pass before :
+ * <ul>
+ * <li> <code>_addRowSetApproveListener</code> </li>
+ * </ul>
+ */
+ public void _removeRowSetApproveListener() {
+ requiredMethod("addRowSetApproveListener()") ;
+
+ listener1.reset() ;
+
+ oObj.removeRowSetApproveListener(listener1) ;
+
+ checker.moveCursor() ;
+ checker.changeRow() ;
+ checker.changeRowSet() ;
+
+ tRes.tested("removeRowSetApproveListener()",
+ !listener1.approveCursorMoveCalled &&
+ !listener1.approveRowChangeCalled &&
+ !listener1.approveRowSetChangeCalled) ;
+ }
+
+ /**
+ * Disposes object environment.
+ */
+ public void after() {
+ //disposeEnvironment() ;
+ }
+
+} // finish class _XRowSetApproveBroadcaster
+
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_ResultSet.java b/qadevOOo/tests/java/ifc/sdbc/_ResultSet.java
new file mode 100644
index 000000000000..cd5e0914672d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_ResultSet.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ResultSet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sdbc.ResultSet</code>
+* service properties :
+* <ul>
+* <li><code> CursorName</code></li>
+* <li><code> ResultSetConcurrency</code></li>
+* <li><code> ResultSetType</code></li>
+* <li><code> FetchDirection</code></li>
+* <li><code> FetchSize</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sdbc.ResultSet
+*/
+public class _ResultSet extends MultiPropertyTest {
+
+
+} // finish class _ResultSet
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_RowSet.java b/qadevOOo/tests/java/ifc/sdbc/_RowSet.java
new file mode 100644
index 000000000000..8bb1158541b7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_RowSet.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: _RowSet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sdbc.RowSet</code>
+* service properties :
+* <ul>
+* <li><code> DataSourceName</code></li>
+* <li><code> URL</code></li>
+* <li><code> Command</code></li>
+* <li><code> TransactionIsolation</code></li>
+* <li><code> TypeMap</code></li>
+* <li><code> EscapeProcessing</code></li>
+* <li><code> QueryTimeOut</code></li>
+* <li><code> MaxFieldSize</code></li>
+* <li><code> MaxRows</code></li>
+* <li><code> User</code></li>
+* <li><code> Password</code></li>
+* <li><code> ResultSetType</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sdbc.RowSet
+*/
+public class _RowSet extends MultiPropertyTest {
+
+
+} // finish class _RowSet
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XCloseable.java b/qadevOOo/tests/java/ifc/sdbc/_XCloseable.java
new file mode 100644
index 000000000000..b9c6065f39dc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XCloseable.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCloseable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XCloseable;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sdbc.XCloseable</code>
+* interface methods :
+* <ul>
+* <li><code> close()</code></li>
+* </ul> <p>
+* After test object must be recreated.
+* @see com.sun.star.sdbc.XCloseable
+*/
+public class _XCloseable extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XCloseable oObj = null ;
+
+ /**
+ * Closes row set. If the component implements the interface
+ * <code>com.sun.star.sdbc.XResutlSet</code> then tries to move
+ * the cursor to the first row in the result set.
+ * Has OK status if no exceptions were thrown during first call and
+ * if expected SQL exception was thrown during cursor moving.
+ */
+ public void _close() throws StatusException {
+ boolean res = false;
+ try {
+ oObj.close();
+ res = true;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL Exception occured:" + e) ;
+ res = false;
+ }
+
+ XResultSet resSet = (XResultSet)
+ UnoRuntime.queryInterface(XResultSet.class, oObj);
+
+ if (resSet != null) {
+ try {
+ resSet.first();
+ log.println("Expected SQLException not occured !");
+ res = false;
+ } catch(SQLException e) {
+ log.println("Expected SQLException occured");
+ res = true;
+ }
+ }
+
+ tRes.tested("close()", res);
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+
+} // finish class _XCloseable
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XColumnLocate.java b/qadevOOo/tests/java/ifc/sdbc/_XColumnLocate.java
new file mode 100644
index 000000000000..9de05cc7d502
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XColumnLocate.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XColumnLocate.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XColumnLocate;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+/**
+* Testing <code>com.sun.star.sdbc.XColumnLocate</code>
+* interface methods :
+* <ul>
+* <li><code> findColumn()</code></li>
+* </ul> <p>
+* The test required the following relations :
+* <ul>
+* <li> <code> XColumnLocate.ColumnName </code> : The name of the first
+* column. </li>
+* </ul>
+* @see com.sun.star.sdbc.XColumnLocate
+*/
+public class _XColumnLocate extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XColumnLocate oObj = null ;
+
+ /**
+ * Using column name from object relation trying to find out
+ * the index of this column. <p>
+ * Has OK status if column index returned by method equals to 1,
+ * FAILED otherwise.
+ */
+ public void _findColumn() {
+ boolean result = false ;
+ String colName = (String) tEnv.getObjRelation("XColumnLocate.ColumnName") ;
+
+ if (colName == null) {
+ throw new StatusException(
+ Status.failed("Object relation 'XColumnLocate.ColumnName' " +
+ "for this interface not found"));
+ }
+
+ try {
+ int colIdx = oObj.findColumn(colName) ;
+ result = colIdx == 1 ;
+ } catch (SQLException e) {
+ log.println("Exception occured:");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("findColumn()", result);
+ }
+
+} // finish class _XColumnLocate
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XDataSource.java b/qadevOOo/tests/java/ifc/sdbc/_XDataSource.java
new file mode 100644
index 000000000000..da45858604ca
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XDataSource.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataSource.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import lib.MultiMethodTest;
+import com.sun.star.sdbc.XDataSource;
+import com.sun.star.sdbc.XConnection;
+
+/**
+* Testing <code>com.sun.star.sdbc.XDataSource</code>
+* interface methods :
+* <ul>
+* <li><code>getConnection()</code></li>
+* <li><code>setLoginTimeout()</code></li>
+* <li><code>getLoginTimeout()</code></li>
+* </ul> <p>
+* @see com.sun.star.sdbc.XDataSource
+*/
+public class _XDataSource extends MultiMethodTest {
+ // oObj filled by MultiMethodTest
+ public XDataSource oObj = null;
+
+ /**
+ * Calls the method and checks returned value.
+ * Has OK status if exception wasn't thrown and
+ * if returned value isn't null.
+ */
+ public void _getConnection() {
+ boolean res = true;
+
+ try {
+ XConnection connection = oObj.getConnection("", "");
+ res = connection != null;
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Unexpected exception:");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("getConnection()", res);
+ }
+
+ /**
+ * Sets new timeout, compares with timeout returned by the method
+ * <code>getLoginTimeout()</code>.
+ * Has OK status if exception wasn't thrown and if timeout values are equal.
+ */
+ public void _setLoginTimeout() {
+ requiredMethod("getLoginTimeout()");
+ boolean res = true;
+
+ try {
+ final int TO = 111;
+ log.println("setLoginTimeout(" + TO + ")");
+ oObj.setLoginTimeout(TO);
+ int timeout = oObj.getLoginTimeout();
+ res = timeout == TO;
+ log.println("getLoginTimeout(): " + timeout);
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Unexpected exception:");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("setLoginTimeout()", res);
+ }
+
+ /**
+ * Calls the method and checks returned value.
+ * Has OK status if exception wasn't thrown and
+ * if returned value is equal to zero.
+ */
+ public void _getLoginTimeout() {
+ boolean res = true;
+
+ try {
+ int timeout = oObj.getLoginTimeout();
+ log.println("getLoginTimeout(): " + timeout);
+ res = timeout == 0;
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Unexpected exception:");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("getLoginTimeout()", res);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XDriver.java b/qadevOOo/tests/java/ifc/sdbc/_XDriver.java
new file mode 100644
index 000000000000..26d1ed38b833
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XDriver.java
@@ -0,0 +1,246 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDriver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import lib.MultiMethodTest;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.sdbc.XDriver;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.DriverPropertyInfo;
+
+/**
+* Testing <code>com.sun.star.sdbc.XDriver</code>
+* interface methods :
+* <ul>
+* <li><code> connect()</code></li>
+* <li><code> acceptsURL()</code></li>
+* <li><code> getPropertyInfo()</code></li>
+* <li><code> getMajorVersion()</code></li>
+* <li><code> getMinorVersion()</code></li>
+* </ul> <p>
+* Required object relations :
+* <ul>
+* <li> <code>'XDriver.URL'</code>:
+* is the URL of the database to which to connect</code></li>
+* <li><code>'XDriver.UNSUITABLE_URL'</code>:
+* the wrong kind of URL to connect using given driver</li>
+* <li><code>'XDriver.INFO'</code>:
+* a list of arbitrary string tag/value pairs as connection arguments</li>
+* </ul> <p>
+* @see com.sun.star.sdbc.XDriver
+*/
+public class _XDriver extends MultiMethodTest {
+ // oObj filled by MultiMethodTest
+ public XDriver oObj = null;
+ String url = null;
+ String wrongUrl = null;
+ String nbu = null;
+ PropertyValue[] info = null;
+
+ /**
+ * Retrieves relations.
+ * @throw StatusException If any relation not found.
+ */
+ protected void before() {
+ nbu = (String) tEnv.getObjRelation("NoBadURL");
+ url = (String)tEnv.getObjRelation("XDriver.URL");
+ if (url == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XDriver.URL'"));
+ }
+ wrongUrl = (String)tEnv.getObjRelation("XDriver.UNSUITABLE_URL");
+ if (wrongUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XDriver.WRONG_URL'"));
+ }
+ info = (PropertyValue[])tEnv.getObjRelation("XDriver.INFO");
+ if (info == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XDriver.INFO'"));
+ }
+ }
+
+ /**
+ * Connects to <code>'XDriver.URL'</code>,
+ * to <code>'XDriver.UNSUITABLE_URL'</code> and to wrong URL using
+ * <code>'XDriver.INFO'</code>.
+ * Has OK status if the method returns not null for <code>'XDriver.URL'</code>,
+ * null for <code>'XDriver.UNSUITABLE_URL'</code> and
+ * exception was thrown during the call with a wrong URL.
+ */
+ public void _connect() {
+ boolean res = true;
+
+ try {
+ log.println("Trying to connect to " + url);
+ XConnection connection = oObj.connect(url, info);
+ res = (connection != null);
+ log.println("Connected? " + res);
+ log.println("Trying to connect to " + wrongUrl);
+ connection = oObj.connect(wrongUrl, info);
+ res &= (connection == null);
+ log.println("Connected? " + !res);
+ } catch(SQLException e) {
+ log.println("Unexpected exception");
+ res &= false;
+ }
+
+ if (nbu==null) {
+ try {
+ String badUrl = url + "bla";
+ log.println("Trying to connect to " + badUrl);
+ oObj.connect(badUrl, info);
+ res &= false;
+ log.println("Expected exception isn't thrown");
+ } catch(SQLException e) {
+ log.println("Expected exception");
+ res &= true;
+ }
+ }
+
+ tRes.tested("connect()", res);
+ }
+
+ /**
+ * Calls the method for <code>'XDriver.URL'</code> and
+ * for <code>'XDriver.UNSUITABLE_URL'</code>.
+ * Has OK status if the method returns true for <code>'XDriver.URL'</code>
+ * and false for <code>'XDriver.UNSUITABLE_URL'</code>.
+ */
+ public void _acceptsURL() {
+ boolean res = false;
+
+ try {
+ res = oObj.acceptsURL(url);
+ log.println("Accepts " + url + "? " + res);
+ res &= !oObj.acceptsURL(wrongUrl);
+ log.println("Accepts " + wrongUrl + "? " + !res);
+ } catch(SQLException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("acceptsURL()", res);
+ }
+
+ /**
+ * Calls the method with passed <code>'XDriver.URL'</code> and
+ * <code>'XDriver.INFO'</code>. Prints obtained driver properties info
+ * to log.
+ * Has OK status if returned value isn't null.
+ */
+ public void _getPropertyInfo() {
+ requiredMethod("acceptsURL()");
+ boolean res = false;
+ DriverPropertyInfo[] dpi = null;
+ try {
+ dpi = oObj.getPropertyInfo(url, info);
+ } catch(SQLException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ if (dpi != null) {
+ res = true;
+ log.println("Driver properties info:");
+ for(int i = 0; i < dpi.length; i++) {
+ log.println("Property: " + dpi[i].Name);
+ log.println("Description: " + dpi[i].Description);
+ log.println("IsRequired? " + dpi[i].IsRequired);
+ log.println("Value: " + dpi[i].Value);
+ log.println("Choices: ");
+ for(int j = 0; j < dpi[i].Choices.length; j++) {
+ log.println("\t" + dpi[i].Choices[j]);
+ }
+ }
+ }
+
+ tRes.tested("getPropertyInfo()", res);
+ }
+
+ /**
+ * Calls the method.
+ * Has OK status if returned value is greater than or is equal to 1.
+ */
+ public void _getMajorVersion() {
+ int majorVer = oObj.getMajorVersion();
+ boolean res = majorVer >= 1;
+ log.println("Major version " + majorVer);
+ tRes.tested("getMajorVersion()", res);
+ }
+
+ /**
+ * Calls the method.
+ * Has OK status if returned value is greater than or is equal to 0.
+ */
+ public void _getMinorVersion() {
+ int minorVer = oObj.getMinorVersion();
+ boolean res = minorVer >= 0;
+ log.println("Minor version " + minorVer);
+ tRes.tested("getMinorVersion()", res);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XDriverManager.java b/qadevOOo/tests/java/ifc/sdbc/_XDriverManager.java
new file mode 100644
index 000000000000..e2d46226e68f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XDriverManager.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDriverManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import lib.MultiMethodTest;
+import com.sun.star.sdbc.XDriverManager;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.beans.PropertyValue;
+
+/**
+* Testing <code>com.sun.star.sdbc.XDriverManager</code>
+* interface methods :
+* <ul>
+* <li><code> getConnection()</code></li>
+* <li><code> getConnectionWithInfo()</code></li>
+* <li><code> setLoginTimeout()</code></li>
+* <li><code> getLoginTimeout()</code></li>
+* </ul> <p>
+* Required object relations :
+* <ul>
+* <li> <code>'SDBC.URL'</code>:
+* is the URL of the database to which to connect using sdbc-driver
+* </code></li>
+* <li> <code>'JDBC.URL'</code>:
+* is the URL of the database to which to connect using jdbc-driver
+* </code></li>
+* <li> <code>'JDBC.INFO'</code> of type <code>PropertyValue[]</code>:
+* a list of arbitrary string tag/value pairs as connection arguments;
+* normally at least a "user" and "password" property should be included
+* </code></li>
+* </ul> <p>
+* @see com.sun.star.sdbc.XDriverManager
+*/
+public class _XDriverManager extends MultiMethodTest {
+ // oObj filled by MultiMethodTest
+ public XDriverManager oObj = null;
+ String sdbcURL = null;
+ String jdbcURL = null;
+ PropertyValue[] jdbcINFO = null;
+
+ /**
+ * Retrieves the required object relations.
+ */
+ protected void before() {
+ sdbcURL = (String)tEnv.getObjRelation("SDBC.URL");
+ if (sdbcURL == null) {
+ throw new StatusException(
+ Status.failed("Couldn't get relation 'SDBC.URL'"));
+ }
+ jdbcURL = (String)tEnv.getObjRelation("JDBC.URL");
+ if (jdbcURL == null) {
+ throw new StatusException(
+ Status.failed("Couldn't get relation 'JDBC.URL'"));
+ }
+ jdbcINFO = (PropertyValue[])tEnv.getObjRelation("JDBC.INFO");
+ if (jdbcINFO == null) {
+ throw new StatusException(
+ Status.failed("Couldn't get relation 'JDBC.INFO'"));
+ }
+ }
+
+ /**
+ * Calls the method with the url received from the relation
+ * <code>SDBC.URL</code>.
+ * Has OK status if exception wasn't thrown and
+ * if returned value isn't null.
+ */
+ public void _getConnection() {
+ boolean res = true;
+
+ try {
+ log.println("getConnection(" + sdbcURL + ")");
+ XConnection connection = oObj.getConnection(sdbcURL);
+ res = connection != null;
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("getConnection()", res);
+ }
+
+ /**
+ * Calls the method with the url received from the relation
+ * <code>JDBC.URL</code> and with info received from the relation
+ * <code>JDBC.INFO</code>.
+ * Has OK status if exception wasn't thrown and
+ * if returned value isn't null.
+ */
+ public void _getConnectionWithInfo() {
+ boolean res = true;
+
+ try {
+ log.println("getConnectionWithInfo(" + jdbcURL + ")");
+ XConnection connection =
+ oObj.getConnectionWithInfo(jdbcURL, jdbcINFO);
+ res = connection != null;
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("getConnectionWithInfo()", res);
+ }
+
+ /**
+ * Calls the method and checks returned value.
+ * Has OK status if timeout that was set and timeout that was returned by
+ * the method <code>getLoginTimeout()</code> are equal.
+ */
+ public void _setLoginTimeout() {
+ requiredMethod("getLoginTimeout()");
+ boolean res = true;
+ final int TO = 111;
+ log.println("setLoginTimeout(" + TO + ")");
+ oObj.setLoginTimeout(TO);
+ int timeout = oObj.getLoginTimeout();
+ log.println("getLoginTimeout(): " + timeout);
+ tRes.tested("setLoginTimeout()", timeout == TO);
+ }
+
+ /**
+ * Calls the method.
+ */
+ public void _getLoginTimeout() {
+ int timeout = oObj.getLoginTimeout();
+ log.println("getLoginTimeout(): " + timeout);
+
+ tRes.tested("getLoginTimeout()", true);
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XIsolatedConnection.java b/qadevOOo/tests/java/ifc/sdbc/_XIsolatedConnection.java
new file mode 100644
index 000000000000..0f868351c432
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XIsolatedConnection.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XIsolatedConnection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.sdbc.XIsolatedConnection;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.task.XInteractionHandler;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.sdb.XCompletedConnection</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getIsolatedConnectionWithCompletion()</code></li>
+ * <li><code> getIsolatedConnection()</code></li>
+ * </ul> <p>
+* The following object relations required :
+* <ul>
+* <li> <code>'XCompletedConnection.Handler'</code> : passed as parameter
+* to <code>connectWithCompletion</code> method. </li>
+* </ul>
+* @see com.sun.star.sdb.XIsolatedConnection
+* @see com.sun.star.task.XInteractionHandler
+* @see com.sun.star.sdbc.XConnection
+*/
+public class _XIsolatedConnection extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XIsolatedConnection oObj = null ;
+
+ /**
+ * Test call the method with handler passed as object relation.
+ * Then value returned is checked.<p>
+ * Has OK status if not null value returned. <&nbsp>
+ * FAILED if exception occured, null value returned or object
+ * relation was not found.
+ */
+ public void _getIsolatedConnectionWithCompletion() throws StatusException {
+ XInteractionHandler handler = (XInteractionHandler)
+ tEnv.getObjRelation("XCompletedConnection.Handler") ;
+
+ if (handler == null) {
+ log.println("Required object relation not found !") ;
+ tRes.tested("getIsolatedConnectionWithCompletion()", false) ;
+ return ;
+ }
+
+ XConnection con = null ;
+ try {
+ con = oObj.getIsolatedConnectionWithCompletion(handler) ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ throw new StatusException("Exception while method calling", e) ;
+ }
+
+ tRes.tested("getIsolatedConnectionWithCompletion()", con != null) ;
+ }
+
+ /**
+ * Test call the method with handler passed as object relation.
+ * Then value returned is checked.<p>
+ * Has OK status if not null value returned. <&nbsp>
+ * FAILED if exception occured, null value returned or object
+ * relation was not found.
+ */
+ public void _getIsolatedConnection() throws StatusException {
+ String[] userSettings = (String[])
+ tEnv.getObjRelation("UserAndPassword") ;
+
+ String user = null;
+ String pwd = null;
+ if (userSettings == null) {
+ log.println("Required object relation not found !") ;
+ }
+
+ if (userSettings[0] != null)
+ user = userSettings[0].equals("")?"<empty>":userSettings[0];
+ else
+ user = "<null>";
+ if (userSettings[1] != null)
+ pwd = userSettings[1].equals("")?"<empty>":userSettings[1];
+ else
+ pwd = "<null>";
+
+ log.println("Testing \"getIsolatedConnection('user', 'password')\"\n" +
+ "with user = '" + user + "'; password = '" + pwd + "'");
+ XConnection con = null ;
+ try {
+ con = oObj.getIsolatedConnection(user, pwd) ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ throw new StatusException("Exception while method calling", e) ;
+ }
+
+ tRes.tested("getIsolatedConnection()", con != null) ;
+ }
+} // finish class _XIsolatedConnection
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XParameters.java b/qadevOOo/tests/java/ifc/sdbc/_XParameters.java
new file mode 100644
index 000000000000..3aec275e2ed0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XParameters.java
@@ -0,0 +1,602 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XParameters.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.io.XDataInputStream;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XTextInputStream;
+import com.sun.star.sdbc.DataType;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XParameters;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.Date;
+import com.sun.star.util.DateTime;
+import com.sun.star.util.Time;
+import java.util.Vector;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+/**
+* Testing <code>com.sun.star.sdbc.XParameters</code>
+* interface methods :
+* <ul>
+* <li><code> setNull()</code></li>
+* <li><code> setObjectNull()</code></li>
+* <li><code> setBoolean()</code></li>
+* <li><code> setByte()</code></li>
+* <li><code> setShort()</code></li>
+* <li><code> setInt()</code></li>
+* <li><code> setLong()</code></li>
+* <li><code> setFloat()</code></li>
+* <li><code> setDouble()</code></li>
+* <li><code> setString()</code></li>
+* <li><code> setBytes()</code></li>
+* <li><code> setDate()</code></li>
+* <li><code> setTime()</code></li>
+* <li><code> setTimestamp()</code></li>
+* <li><code> setBinaryStream()</code></li>
+* <li><code> setCharacterStream()</code></li>
+* <li><code> setObject()</code></li>
+* <li><code> setObjectWithInfo()</code></li>
+* <li><code> setRef()</code></li>
+* <li><code> setBlob()</code></li>
+* <li><code> setClob()</code></li>
+* <li><code> setArray()</code></li>
+* <li><code> clearParameters()</code></li>
+* </ul> <p>
+* Object relations required :
+* <ul>
+* <li> <code>'XParameters.ParamValues'</code> : is a
+* <code>java.util.Vector</code> object
+* that contains parameter types and values of the statement. Each
+* element of vector corresponds to appropriate parameter (element
+* with index 0 to parameter #1, 1 -> #2, etc.). <p>
+* The following <code>XParameters</code> methods correspond to classes
+* in Vector :
+* <ul>
+* <li> <code>setBinaryStream</code> -
+* <code>com.sun.star.io.XDataInputStream</code> class. </li>
+* <li> <code>setCharacterStream</code> -
+* <code>com.sun.star.io.XTextInputStream</code> class. </li>
+* <li> <code>setObject</code> -
+* <code>java.lang.Object[]</code> class, the element with
+* index 0 must be used. </li>
+* </ul>
+* Other methods uses types of their arguments (i.e. <code>java.lang.String</code>
+* for <code>setString</code> method, <code>com.sun.star.sdbc.XRef</code>
+* for <code>setRef</code> method).
+* </li>
+* </ul>
+* @see com.sun.star.sdbc.XParameters
+*/
+public class _XParameters extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XParameters oObj = null ;
+
+ private Vector data = null ;
+
+ /**
+ * Gets object relation
+ */
+ public void before() {
+ data = (Vector) tEnv.getObjRelation("XParameters.ParamValues") ;
+ if (data == null) {
+ log.println("!!! Relation not found !!!") ;
+ }
+ }
+
+ /**
+ * Sets String parameter (if exists) to SQL NULL value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setNull() {
+ boolean result = true ;
+ int idx = findParamOfType(String.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setNull(idx, DataType.VARCHAR) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setNull()", result) ;
+ }
+
+ public void _setObjectNull() {
+ /*
+ !!! TO DO !!!
+ */
+ tRes.tested("setObjectNull()", Status.skipped(true)) ;
+ }
+
+ /**
+ * Sets String parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setString() {
+ boolean result = true ;
+ int idx = findParamOfType(String.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setString(idx, "XParameters") ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setString()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setBoolean() {
+ boolean result = true ;
+ int idx = findParamOfType(Boolean.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setBoolean(idx, true) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setBoolean()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setByte() {
+ boolean result = true ;
+ int idx = findParamOfType(Byte.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setByte(idx, (byte)122) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setByte()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setShort() {
+ boolean result = true ;
+ int idx = findParamOfType(Short.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setShort(idx, (short)133) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setShort()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setInt() {
+ boolean result = true ;
+ int idx = findParamOfType(Integer.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setInt(idx, 13300) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setInt()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setLong() {
+ boolean result = true ;
+ int idx = findParamOfType(Long.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setLong(idx, 13362453) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setLong()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setFloat() {
+ boolean result = true ;
+ int idx = findParamOfType(Float.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setFloat(idx, (float)133.55) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setFloat()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setDouble() {
+ boolean result = true ;
+ int idx = findParamOfType(Double.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setDouble(idx, 133) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setDouble()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setBytes() {
+ boolean result = true ;
+ int idx = findParamOfType(byte[].class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setBytes(idx, new byte[] {5}) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setBytes()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setDate() {
+ boolean result = true ;
+ int idx = findParamOfType(Date.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setDate(idx, new Date ((short)19, (short)01, (short)1979)) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setDate()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setTime() {
+ boolean result = true ;
+ int idx = findParamOfType(Time.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setTime(idx, new Time((short)1,(short)2,(short)3,(short)44)) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setTime()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setTimestamp() {
+ boolean result = true ;
+ int idx = findParamOfType(DateTime.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ oObj.setTimestamp(idx, new DateTime((short)1,(short)2,(short)3,
+ (short)4, (short)19, (short)01, (short)1979)) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setTimestamp()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setBinaryStream() {
+ boolean result = true ;
+ int idx = findParamOfType(XDataInputStream.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ Object oStream = tParam.getMSF().createInstance
+ ("com.sun.star.io.DataInputStream") ;
+ XInputStream xStream = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oStream);
+
+ oObj.setBinaryStream(idx, xStream, 2) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setBinaryStream()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setCharacterStream() {
+ boolean result = true ;
+ int idx = findParamOfType(XTextInputStream.class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ Object oStream = tParam.getMSF().createInstance
+ ("com.sun.star.io.TextInputStream") ;
+ XInputStream xStream = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oStream);
+
+ oObj.setCharacterStream(idx, xStream, 2) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setCharacterStream()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setObject() {
+ boolean result = true ;
+ int idx = findParamOfType(Object[].class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ Object obj = tParam.getMSF().createInstance
+ ("com.sun.star.io.Pipe") ;
+
+ oObj.setObject(idx, obj) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setObject()", result) ;
+ }
+
+ /**
+ * Sets parameter (if exists) to new value. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _setObjectWithInfo() {
+ boolean result = true ;
+ int idx = findParamOfType(Object[].class) ;
+ if (idx < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ Object obj = tParam.getMSF().createInstance
+ ("com.sun.star.io.Pipe") ;
+
+ oObj.setObjectWithInfo(idx, obj, DataType.OBJECT, 0) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("setObjectWithInfo()", result) ;
+ }
+
+ public void _setRef() {
+ /*
+ !!! TO DO !!!
+ */
+ tRes.tested("setRef()", Status.skipped(true)) ;
+ }
+ public void _setBlob() {
+ /*
+ !!! TO DO !!!
+ */
+ tRes.tested("setBlob()", Status.skipped(true)) ;
+ }
+ public void _setClob() {
+ /*
+ !!! TO DO !!!
+ */
+ tRes.tested("setClob()", Status.skipped(true)) ;
+ }
+ public void _setArray() {
+ /*
+ !!! TO DO !!!
+ */
+ tRes.tested("setArray()", Status.skipped(true)) ;
+ }
+
+ /**
+ * Calls method. <p>
+ * Has OK status if no exceptions occured.
+ */
+ public void _clearParameters() {
+ boolean result = true ;
+ try {
+ oObj.clearParameters() ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+
+ tRes.tested("clearParameters()", result) ;
+ }
+
+
+ /**
+ * Finds in relation vector index of parameter of the appropriate
+ * type.
+ */
+ private int findParamOfType(Class clz) {
+
+ for (int i = 0; i < data.size(); i++)
+ if (clz.isInstance(data.get(i))) return i + 1 ;
+ return -1 ;
+ }
+
+} // finish class _XParameters
+
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XResultSet.java b/qadevOOo/tests/java/ifc/sdbc/_XResultSet.java
new file mode 100644
index 000000000000..865f8c0f151b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XResultSet.java
@@ -0,0 +1,538 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XResultSet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.sdbc.XRow;
+import com.sun.star.sdbc.XRowUpdate;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+/**
+* Testing <code>com.sun.star.sdbc.XResultSet</code>
+* interface methods :
+* <ul>
+* <li><code> next()</code></li>
+* <li><code> isBeforeFirst()</code></li>
+* <li><code> isAfterLast()</code></li>
+* <li><code> isFirst()</code></li>
+* <li><code> isLast()</code></li>
+* <li><code> beforeFirst()</code></li>
+* <li><code> afterLast()</code></li>
+* <li><code> first()</code></li>
+* <li><code> last()</code></li>
+* <li><code> getRow()</code></li>
+* <li><code> absolute()</code></li>
+* <li><code> relative()</code></li>
+* <li><code> previous()</code></li>
+* <li><code> refreshRow()</code></li>
+* <li><code> rowUpdated()</code></li>
+* <li><code> rowInserted()</code></li>
+* <li><code> rowDeleted()</code></li>
+* <li><code> getStatement()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XResultSet.hasStatement'</code> (<b>optional</b> of type
+* <code>Object</code>):
+* it the relation exists than <code>getStatement</code> method
+* must not return <code>null</code> </li>
+* <ul> <p>
+* Test places DB cursor to different positions and then checks
+* its current position. <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.sdbc.XResultSet
+*/
+public class _XResultSet extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XResultSet oObj = null ;
+
+ /**
+ * Positions the cursor to the first row.
+ * Forces method tests to be executed in definite order.
+ */
+ public void before() {
+ try {
+ oObj.last() ;
+ log.println("Totally number of rows is " + oObj.getRow()) ;
+ oObj.first() ;
+ } catch (SQLException e) {
+ log.println("Ignored exception :") ;
+ e.printStackTrace(log);
+ }
+
+ executeMethod("isBeforeFirst()") ;
+ executeMethod("isAfterLast()") ;
+ executeMethod("isLast()") ;
+ executeMethod("isFirst()") ;
+ executeMethod("next()") ;
+ executeMethod("previous()") ;
+ }
+
+ /**
+ * Places the cursor before the first row. <p>
+ * Has <b>OK</b> status if no exceptions were thrown.
+ */
+ public void _beforeFirst() {
+ try {
+ oObj.beforeFirst() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ tRes.tested("beforeFirst()", false) ;
+ return ;
+ }
+ tRes.tested("beforeFirst()", true) ;
+ }
+
+ /**
+ * The method is called immediatly after <code>beforeFirst</code>
+ * method test. <p>
+ * Has <b>OK</b> status if method returns <code>true</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> beforeFirst </code> : to position cursor before
+ * the first row. </li>
+ * </ul>
+ */
+ public void _isBeforeFirst() {
+ requiredMethod("beforeFirst()") ;
+
+ boolean result = true ;
+
+ try {
+ result = oObj.isBeforeFirst() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("isBeforeFirst()", result) ;
+ }
+
+ /**
+ * Places the cursor after the last row. <p>
+ * Has <b>OK</b> status if no exceptions were thrown.
+ */
+ public void _afterLast() {
+ try {
+ oObj.afterLast() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ tRes.tested("afterLast()", false) ;
+ return ;
+ }
+ tRes.tested("afterLast()", true) ;
+ }
+
+ /**
+ * The method is called immediatly after <code>afterLast</code>
+ * method test. <p>
+ * Has <b>OK</b> status if method returns <code>true</code> <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> afterLast </code> : to position cursor after
+ * the last row. </li>
+ * </ul>
+ */
+ public void _isAfterLast() {
+ requiredMethod("afterLast()") ;
+
+ boolean result = true ;
+
+ try {
+ result = oObj.isAfterLast() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("isAfterLast()", result) ;
+ }
+
+ /**
+ * Places the cursor on the first row. <p>
+ * Has <b>OK</b> status if no exceptions were thrown.
+ */
+ public void _first() {
+ try {
+ oObj.first() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ tRes.tested("first()", false) ;
+ return ;
+ }
+ tRes.tested("first()", true) ;
+ }
+
+ /**
+ * The method is called immediatly after <code>first</code>
+ * method test. <p>
+ * Has <b>OK</b> status if method returns <code>true</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> first </code> : to position cursor on
+ * the first row. </li>
+ * </ul>
+ */
+ public void _isFirst() {
+ requiredMethod("first()") ;
+
+ boolean result = true ;
+
+ try {
+ result = oObj.isFirst() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("isFirst()", result) ;
+ }
+
+ /**
+ * Places the cursor on the last row. <p>
+ * Has <b>OK</b> status if no exceptions were thrown.
+ */
+ public void _last() {
+ try {
+ oObj.last() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ tRes.tested("last()", false) ;
+ return ;
+ }
+ tRes.tested("last()", true) ;
+ }
+
+ /**
+ * The method is called immediatly after <code>last</code>
+ * method test. <p>
+ * Has <b>OK</b> status if method returns <code>true</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> last </code> : to position cursor on
+ * the last row. </li>
+ * </ul>
+ */
+ public void _isLast() {
+ requiredMethod("last()") ;
+ boolean result = true ;
+
+ try {
+ result = oObj.isLast() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("isLast()", result) ;
+ }
+
+ /**
+ * Places the cursor on the row number 1. <p>
+ * Has <b>OK</b> status if no exceptions were thrown.
+ */
+ public void _absolute() {
+ boolean result = true ;
+
+ try {
+ oObj.absolute(1) ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("absolute()", result) ;
+ }
+
+ /**
+ * The method is called immediatly after <code>absolute</code>
+ * method test. <p>
+ * Has <b>OK</b> status if method returns 1. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> absolute </code> : to position cursor on
+ * the row number 1. </li>
+ * </ul>
+ */
+ public void _getRow() {
+ requiredMethod("absolute()");
+ boolean result = true;
+
+ try {
+ result &= oObj.getRow() == 1;
+ } catch (SQLException e) {
+ log.println("Exception occured:");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("getRow()", result);
+ }
+
+ /**
+ * Positions the cursor to the next row. Current row
+ * number is retrieved before and after method call. <p>
+ * Has <b>OK</b> status if current row number increases
+ * by 1 after method call.
+ */
+ public void _next() {
+ boolean result = true ;
+
+ try {
+ int prevRow = oObj.getRow() ;
+ oObj.next() ;
+
+ log.println("Row was : " + prevRow + ", row is : " + oObj.getRow());
+ result &= prevRow + 1 == oObj.getRow() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("next()", result) ;
+ }
+
+ /**
+ * Positions the cursor to the previous row. Current row
+ * number is retrieved before and after method call. <p>
+ * Has <b>OK</b> status if current row number decreases
+ * by 1 after method call.
+ */
+ public void _previous() {
+ boolean result = true ;
+
+ try {
+ int prevRow = oObj.getRow() ;
+ oObj.previous() ;
+
+ log.println("Row was : " + prevRow + ", row is : " + oObj.getRow());
+ result &= prevRow - 1 == oObj.getRow() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("previous()", result) ;
+ }
+
+ /**
+ * Positions the cursor relatively by 2 rows forward.
+ * Current row number is retrieved before and after method call. <p>
+ * Has <b>OK</b> status if current row number increases
+ * by 2 after method call.
+ */
+ public void _relative() {
+ boolean result = true ;
+
+ try {
+ oObj.first() ;
+ int prevRow = oObj.getRow() ;
+ oObj.relative(2) ;
+
+ log.println("Row was : " + prevRow + ", row is : " + oObj.getRow());
+
+ result &= prevRow + 2 == oObj.getRow() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("relative()", result) ;
+ }
+
+ /**
+ * If component supports XRow and XRowUpdate then:
+ * test saves current value of string field, updates string,
+ * calls refreshRow() and checks that value of
+ * string field was refetched from DB
+ * else: just calls method.<p>
+ * Has <b>OK</b> status if no exceptions were thrown and value after
+ * refreshRow() equals to saved value.
+ */
+ public void _refreshRow() {
+ XRowUpdate xRowUpdate = (XRowUpdate)
+ UnoRuntime.queryInterface(XRowUpdate.class, oObj);
+ XRow xRow = (XRow)UnoRuntime.queryInterface(XRow.class, oObj);
+
+ if (xRowUpdate == null || xRow == null) {
+ log.println("Test must be modified because XRow or XRowUpdate is't supported");
+ log.println("Only call method");
+ try {
+ oObj.refreshRow() ;
+ tRes.tested("refreshRow()", true) ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ tRes.tested("refreshRow()", false) ;
+ }
+ } else {
+ log.println("Testing of refreshRow()...");
+ try {
+ String oldValue = xRow.getString(util.DBTools.TST_STRING);
+ log.println("Old value: " + oldValue);
+ xRowUpdate.updateString(util.DBTools.TST_STRING,
+ "Test method refreshRow");
+ log.println("New value: "
+ + xRow.getString(util.DBTools.TST_STRING));
+ oObj.refreshRow();
+ String valAfterRefresh =
+ xRow.getString(util.DBTools.TST_STRING);
+ log.println("Value after refresh: " + valAfterRefresh);
+ tRes.tested("refreshRow()", valAfterRefresh.equals(oldValue));
+ } catch(SQLException e) {
+ log.println("Exception occured :");
+ e.printStackTrace(log);
+ tRes.tested("refreshRow()", false);
+ }
+ }
+ }
+
+ /**
+ * Just the method is called. <p>
+ * Has <b>OK</b> status if no exceptions were thrown.
+ */
+ public void _rowUpdated() {
+
+ try {
+ boolean res = oObj.rowUpdated() ;
+ tRes.tested("rowUpdated()", true) ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ tRes.tested("rowUpdated()", false) ;
+ }
+ }
+
+ /**
+ * Just the method is called. <p>
+ * Has <b>OK</b> status if no exceptions were thrown.
+ */
+ public void _rowInserted() {
+ try {
+ boolean res = oObj.rowInserted() ;
+ tRes.tested("rowInserted()", true) ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ tRes.tested("rowInserted()", false) ;
+ }
+ }
+
+ /**
+ * Just the method is called. <p>
+ * Has <b>OK</b> status if no exceptions were thrown.
+ */
+ public void _rowDeleted() {
+ try {
+ boolean res = oObj.rowDeleted() ;
+ tRes.tested("rowDeleted()", true) ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ tRes.tested("rowDeleted()", false) ;
+ }
+ }
+
+ /**
+ * Just the method is called. <p>
+ * Has <b>OK</b> status if the statement returned isn't null or
+ * the relation exists that informs that statement absent (e.g. for
+ * MetaData row set).
+ */
+ public void _getStatement() {
+ try {
+ boolean hasStatement =
+ tEnv.getObjRelation("XResultSet.hasStatement") != null ;
+ Object res = oObj.getStatement() ;
+ tRes.tested("getStatement()",
+ (hasStatement && res != null) || !hasStatement) ;
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ tRes.tested("getStatement()", false) ;
+ }
+ }
+
+ /**
+ * Moves the cursor to the first row to avoid affection to
+ * the following interfaces tests
+ */
+ public void after() {
+ log.println("Finally moving cursor to the first row ...");
+ try {
+ oObj.first();
+ } catch (SQLException e) {
+ log.println("Exception occured :") ;
+ e.printStackTrace(log) ;
+ }
+ }
+
+} // finish class _XResultSet
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XResultSetMetaDataSupplier.java b/qadevOOo/tests/java/ifc/sdbc/_XResultSetMetaDataSupplier.java
new file mode 100644
index 000000000000..355ecc9815f7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XResultSetMetaDataSupplier.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XResultSetMetaDataSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.sdbc.XResultSetMetaData;
+import com.sun.star.sdbc.XResultSetMetaDataSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sdbc.XResultSetMetaDataSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getMetaData()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.sdbc.XResultSetMetaDataSupplier
+*/
+public class _XResultSetMetaDataSupplier extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XResultSetMetaDataSupplier oObj = null ;
+
+ /**
+ * Tries to get the ResultSetMetaData of the Object</br>
+ * an XResultSetMetaData is returned.</br>
+ * The test is OK if an not null ResultSetMetaData is returned
+ */
+ public void _getMetaData() {
+
+ try {
+ XResultSetMetaData the_Meta = oObj.getMetaData();
+ if (the_Meta == null) log.println("'getMetaData()' returns NULL");
+ tRes.tested("getMetaData()",the_Meta != null);
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("Exception while checking 'createResultSet()'");
+ e.printStackTrace(log);
+ tRes.tested("getMetaData()",false);
+ }
+
+ }
+} // finish class _XResultSetMetaDataSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XResultSetUpdate.java b/qadevOOo/tests/java/ifc/sdbc/_XResultSetUpdate.java
new file mode 100644
index 000000000000..871b94a92f95
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XResultSetUpdate.java
@@ -0,0 +1,296 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XResultSetUpdate.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XResultSetUpdate;
+import com.sun.star.sdbc.XRowUpdate;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+/**
+* Testing <code>com.sun.star.sdbc.XResultSetUpdate</code>
+* interface methods :
+* <ul>
+* <li><code> insertRow()</code></li>
+* <li><code> updateRow()</code></li>
+* <li><code> deleteRow()</code></li>
+* <li><code> cancelRowUpdates()</code></li>
+* <li><code> moveToInsertRow()</code></li>
+* <li><code> moveToCurrentRow()</code></li>
+* </ul> <p>
+* The test requires the following object relations :
+* <ul>
+* <li><code>'XResultSetUpdate.UpdateTester'</code>
+* inner <code>UpdateTester</code> interface implementation :
+* is used for checking test results. See interface
+* documentation for more information.</li>
+* </ul>
+* The test is <b>not designed</b> for multithreaded testing. <p>
+* After it's execution environment must be recreated.
+* @see com.sun.star.sdbc.XResultSetUpdate
+*/
+public class _XResultSetUpdate extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XResultSetUpdate oObj = null ;
+
+ private UpdateTester tester = null ;
+
+ /**
+ * Interface contains some methods for checking
+ * test results. It's implementation must be passed
+ * to this test.
+ */
+ public static interface UpdateTester {
+ /**
+ * @return Current number of rows.
+ */
+ public int rowCount() throws SQLException ;
+ /**
+ * Updates some data in the current row but doesn't commit
+ * changes to the source.
+ */
+ public void update() throws SQLException ;
+ /**
+ * Checks if updates made by method <code>update</code> was
+ * commited to the data source.
+ */
+ public boolean wasUpdated() throws SQLException ;
+ /**
+ * Returns current row number. Really it must returns value
+ * < 1 if the current position is on insert row.
+ */
+ public int currentRow() throws SQLException ;
+ }
+
+ /**
+ * Retrieves relation.
+ * @throw StatusException If relation not found.
+ */
+ public void before() throws StatusException {
+ tester = (UpdateTester)tEnv.getObjRelation
+ ("XResultSetUpdate.UpdateTester") ;
+
+ if (tester == null) {
+ log.println("Required relation not found !!!") ;
+ throw new StatusException("Required relation not found !!!",
+ new NullPointerException()) ;
+ }
+ }
+
+ /**
+ * Calls method when the cursor position is on existing row.
+ * Checks total number of rows before and after method call. <p>
+ * Executes <code>moveToCurrentRow</code> method test before to
+ * be sure that cursor is not on the insert row. <p>
+ * Has OK status if after method execution number of rows decreased
+ * by one.
+ */
+ public void _deleteRow() {
+ executeMethod("moveToCurrentRow()") ;
+
+ //temporary to avoid SOffice hanging
+ executeMethod("updateRow()") ;
+ executeMethod("cancelRowUpdates()") ;
+
+ boolean result = true ;
+ try {
+ int rowsBefore = tester.rowCount() ;
+ oObj.deleteRow() ;
+ int rowsAfter = tester.rowCount() ;
+
+ result = rowsBefore == rowsAfter + 1 ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("deleteRow()", result) ;
+ }
+
+ /**
+ * Using relation methods first updates some data in the current
+ * row, then calls <code>updateRow</code> method to commit data.
+ * Then checks if the data changed was commited. <p>
+ * Executes <code>moveToCurrentRow</code> method test before to
+ * be sure that cursor is not on the insert row. <p>
+ * Has OK status if data in the source was changed.
+ */
+ public void _updateRow() {
+ executeMethod("moveToCurrentRow()") ;
+ boolean result = true ;
+ try {
+ tester.update() ;
+ oObj.updateRow() ;
+
+ result = tester.wasUpdated() ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("updateRow()", result) ;
+ }
+
+ /**
+ * Using relation methods first updates some data in the current
+ * row, then calls <code>cancelRowUpdates</code> method.
+ * Then checks if the data changed was not commited. <p>
+ * Executes <code>moveToCurrentRow</code> method test before to
+ * be sure that cursor is not on the insert row. <p>
+ * Has OK status if data in the source was not changed.
+ */
+ public void _cancelRowUpdates() {
+ executeMethod("moveToCurrentRow()") ;
+ boolean result = true ;
+ try {
+ tester.update() ;
+ oObj.cancelRowUpdates() ;
+
+ result = !tester.wasUpdated() ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("cancelRowUpdates()", result) ;
+ }
+
+ /**
+ * Tries to move cursor to insert row. Then checks current row
+ * number. It must be less than 1. (0 as I know) <p>
+ */
+ public void _moveToInsertRow() {
+ boolean result = true ;
+ try {
+ oObj.moveToInsertRow() ;
+
+ result = tester.currentRow() < 1 ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("moveToInsertRow()", result) ;
+ }
+
+ /**
+ * Returns cursor from insert row back to previous row. <p>
+ * <code>moveToInsertRow</code> method test must be executed
+ * first for positioning curosr to insert row. <p>
+ * Has OK status if after method call current row number is
+ * above 0.
+ */
+ public void _moveToCurrentRow() {
+ boolean result = true ;
+ try {
+ oObj.moveToCurrentRow() ;
+
+ result = tester.currentRow() >= 1 ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ tRes.tested("moveToCurrentRow()", result) ;
+ }
+
+ /**
+ * Moves cursor to the insert row, then calls the method
+ * <code>insertRow</code>. Before and after call stores
+ * total number of rows. <p>
+ * Has OK status if after method call rows number increases
+ * by one.
+ */
+ public void _insertRow() {
+ executeMethod("moveToInsertRow()") ;
+ boolean result = true ;
+ try {
+ oObj.moveToCurrentRow();
+ int rowsBefore = tester.rowCount() ;
+ oObj.moveToInsertRow() ;
+ XRowUpdate rowU = (XRowUpdate)
+ UnoRuntime.queryInterface(XRowUpdate.class, oObj);
+ rowU.updateString(1,"open");
+ rowU.updateInt(2,5);
+ rowU.updateDouble(5,3.4);
+ rowU.updateBoolean(10,true);
+ oObj.insertRow() ;
+ oObj.moveToCurrentRow();
+ int rowsAfter = tester.rowCount() ;
+ result = rowsBefore + 1 == rowsAfter ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ log.println("******"+e.getMessage());
+ result = false ;
+ }
+ tRes.tested("insertRow()", result) ;
+ }
+
+ /**
+ * Forces environment to be recreated.
+ */
+ public void after() {
+ //disposeEnvironment() ;
+ }
+} // finish class _XResultSetUpdate
+
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XRow.java b/qadevOOo/tests/java/ifc/sdbc/_XRow.java
new file mode 100644
index 000000000000..3f441d0f1acc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XRow.java
@@ -0,0 +1,576 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRow.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.io.XDataInputStream;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XTextInputStream;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XArray;
+import com.sun.star.sdbc.XBlob;
+import com.sun.star.sdbc.XClob;
+import com.sun.star.sdbc.XRef;
+import com.sun.star.sdbc.XRow;
+import com.sun.star.util.Date;
+import com.sun.star.util.DateTime;
+import com.sun.star.util.Time;
+import java.util.Vector;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sdbc.XRow</code>
+* interface methods :
+* <ul>
+* <li><code> wasNull()</code></li>
+* <li><code> getString()</code></li>
+* <li><code> getBoolean()</code></li>
+* <li><code> getByte()</code></li>
+* <li><code> getShort()</code></li>
+* <li><code> getInt()</code></li>
+* <li><code> getLong()</code></li>
+* <li><code> getFloat()</code></li>
+* <li><code> getDouble()</code></li>
+* <li><code> getBytes()</code></li>
+* <li><code> getDate()</code></li>
+* <li><code> getTime()</code></li>
+* <li><code> getTimestamp()</code></li>
+* <li><code> getBinaryStream()</code></li>
+* <li><code> getCharacterStream()</code></li>
+* <li><code> getObject()</code></li>
+* <li><code> getRef()</code></li>
+* <li><code> getBlob()</code></li>
+* <li><code> getClob()</code></li>
+* <li><code> getArray()</code></li>
+* </ul> <p>
+*
+* This interface is full tested in XRowUpdate interface test. Here
+* only exceptions checked.
+* <p>
+*
+* Object relations required :
+* <ul>
+* <li> <code>'CurrentRowData'</code> : (may be used in other
+* interface tests) is a <code>java.util.Vector</code> object
+* that contains column types and values in current row. Each
+* element of vector corresponds to appropriate column (element
+* with index 0 to column 1, 1 -> 2, etc.). <p>
+* The following <code>XRow</code> methods correspond to classes
+* in Vector :
+* <ul>
+* <li> <code>getBinaryStream</code> -
+* <code>com.sun.star.io.XDataInputStream</code> class. </li>
+* <li> <code>getCharacterStream</code> -
+* <code>com.sun.star.io.XTextInputStream</code> class. </li>
+* <li> <code>getObject</code> -
+* <code>java.lang.Object[]</code> class, the element with
+* index 0 must be used. </li>
+* </ul>
+* Other methods uses types they return (i.e. <code>java.lang.String</code>
+* for <code>getString</code> method, <code>com.sun.star.sdbc.XRef</code>
+* for <code>getRef</code> method).
+* </li>
+* </ul>
+* @see com.sun.star.sdbc.XRaw
+* @see ifc.sdbc._XRowUpdate
+*/
+public class _XRow extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XRow oObj = null ;
+ private Vector data = null ;
+ private boolean notNullRes = true ;
+
+ /**
+ * Retrieves object relation first.
+ */
+ public void before() {
+ data = (Vector) tEnv.getObjRelation("CurrentRowData") ;
+ }
+
+ /**
+ * Always has <b>OK</b> status.
+ */
+ public void _wasNull() {
+ executeMethod("getString()") ;
+ executeMethod("getBoolean()") ;
+ executeMethod("getByte()") ;
+ executeMethod("getShort()") ;
+ executeMethod("getInt()") ;
+ executeMethod("getLong()") ;
+ executeMethod("getFloat()") ;
+ executeMethod("getDouble()") ;
+ executeMethod("getBytes()") ;
+ executeMethod("getDate()") ;
+ executeMethod("getTime()") ;
+ executeMethod("getTimestamp()") ;
+ executeMethod("getBinaryStream()") ;
+ executeMethod("getCharacterStream()") ;
+ executeMethod("getObject()") ;
+ executeMethod("getRef()") ;
+ executeMethod("getBlob()") ;
+ executeMethod("getClob()") ;
+ executeMethod("getArray()") ;
+
+ tRes.tested("wasNull()", notNullRes) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getString() {
+ boolean result = true ;
+ int col = findColumnOfType(String.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ String getStr = oObj.getString(col) ;
+ //result &= ((String)data.get(col - 1)).equals(getStr) ;
+ //notNullRes &= !oObj.wasNull() ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getString()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getBoolean() {
+ boolean result = true ;
+ int col = findColumnOfType(Boolean.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ boolean getVal = oObj.getBoolean(col) ;
+ //result &= ((Boolean)data.get(col - 1)).booleanValue() == getVal ;
+ //notNullRes &= !oObj.wasNull() ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getBoolean()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getByte() {
+ boolean result = true ;
+ int col = findColumnOfType(Byte.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ byte getVal = oObj.getByte(col) ;
+ //result &= ((Byte)data.get(col - 1)).byteValue() == getVal ;
+ //notNullRes &= !oObj.wasNull() ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getByte()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getShort() {
+ boolean result = true ;
+ int col = findColumnOfType(Short.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ short getVal = oObj.getShort(col) ;
+ //result &= ((Short)data.get(col - 1)).shortValue() == getVal ;
+ //notNullRes &= !oObj.wasNull() ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getShort()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getInt() {
+ boolean result = true ;
+ int col = findColumnOfType(Integer.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ int getVal = oObj.getInt(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getInt()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getLong() {
+ boolean result = true ;
+ int col = findColumnOfType(Long.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ long getVal = oObj.getLong(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getLong()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getFloat() {
+ boolean result = true ;
+ int col = findColumnOfType(Float.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ float getVal = oObj.getFloat(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getFloat()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getDouble() {
+ boolean result = true ;
+ int col = findColumnOfType(Double.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ double getVal = oObj.getDouble(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getDouble()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getBytes() {
+ boolean result = true ;
+ int col = findColumnOfType(byte[].class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ byte[] getVal = oObj.getBytes(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getBytes()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getDate() {
+ boolean result = true ;
+ int col = findColumnOfType(Date.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ Date getVal = oObj.getDate(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getDate()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getTime() {
+ boolean result = true ;
+ int col = findColumnOfType(Time.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ Time getVal = oObj.getTime(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getTime()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getTimestamp() {
+ boolean result = true ;
+ int col = findColumnOfType(DateTime.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ DateTime getVal = oObj.getTimestamp(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getTimestamp()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getBinaryStream() {
+ boolean result = true ;
+ int col = findColumnOfType(XDataInputStream.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ XInputStream getVal = oObj.getBinaryStream(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getBinaryStream()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getCharacterStream() {
+ boolean result = true ;
+ int col = findColumnOfType(XTextInputStream.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ XInputStream getVal = oObj.getCharacterStream(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getCharacterStream()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getObject() {
+ boolean result = true ;
+ int col = findColumnOfType(Object[].class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ Object getVal = oObj.getObject(col, null) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getObject()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getRef() {
+ boolean result = true ;
+ int col = findColumnOfType(XRef.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ XRef getVal = oObj.getRef(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getRef()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getBlob() {
+ boolean result = true ;
+ int col = findColumnOfType(XBlob.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ XBlob getVal = oObj.getBlob(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getBlob()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getClob() {
+ boolean result = true ;
+ int col = findColumnOfType(XClob.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ XClob getVal = oObj.getClob(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getClob()", result) ;
+ }
+
+ /**
+ * Has <b>OK</b> status if no exceptions occured in method call.
+ */
+ public void _getArray() {
+ boolean result = true ;
+ int col = findColumnOfType(XArray.class) ;
+ if (col < 0) log.println("Type not found in relation: not tested");
+ else {
+ try {
+ XArray getVal = oObj.getArray(col) ;
+ } catch (SQLException e) {
+ log.println("Unexpected SQL exception:") ;
+ log.println(e) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("getArray()", result) ;
+ }
+
+ /**
+ * Finds in relation vector index of column of the appropriate
+ * type.
+ */
+ protected int findColumnOfType(Class clz) {
+
+ for (int i = 0; i < data.size(); i++)
+ if (clz.isInstance(data.get(i))) return i + 1 ;
+ return -1 ;
+ }
+} // finish class _XRow
+
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XRowSet.java b/qadevOOo/tests/java/ifc/sdbc/_XRowSet.java
new file mode 100644
index 000000000000..26e01821185b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XRowSet.java
@@ -0,0 +1,226 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRowSet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XRowSet;
+import com.sun.star.sdbc.XRowSetListener;
+import ifc.sdb._XRowSetApproveBroadcaster;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sdbc.XRowSet</code>
+* interface methods :
+* <ul>
+* <li><code> execute()</code></li>
+* <li><code> addRowSetListener()</code></li>
+* <li><code> removeRowSetListener()</code></li>
+* </ul> <p>
+* Required object relations :
+* <ul>
+* <li> <code>'XRowSetApproveBroadcaster.ApproveChecker'</code>:
+* implementation of inner interface
+* <code>ifs.sdb._XRowSetApproveBroadcaster.RowSetApproveChecker</code>
+* which can move cursor within a rowset, change row, and change the
+* whole rowset. </li>
+* </ul> <p>
+* It is better to recreate the object after test, because of unknown
+* actions made by <code>RowSetApproveChecker</code> interface implementation.
+* @see com.sun.star.sdbc.XRowSet
+* @see ifc.sdb._XRowSetApproveBroadcaster
+*/
+public class _XRowSet extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XRowSet oObj = null ;
+ private _XRowSetApproveBroadcaster.RowSetApproveChecker checker = null ;
+ private TestListener listener = new TestListener() ;
+
+ private class TestListener implements XRowSetListener {
+ public boolean cursorMoved = false ;
+ public boolean rowChanged = false ;
+ public boolean rowSetChanged = false ;
+
+ public void reset() {
+ cursorMoved = false ;
+ rowChanged = false ;
+ rowSetChanged = false ;
+ }
+ public void cursorMoved(EventObject ev) {
+ cursorMoved = true ;
+ }
+ public void rowChanged(EventObject ev) {
+ rowChanged = true ;
+ }
+ public void rowSetChanged(EventObject ev) {
+ rowSetChanged = true ;
+ }
+ public void disposing(EventObject ev) {}
+ }
+
+ /**
+ * Retrieves relation.
+ * @throw StatusException If relation not found.
+ */
+ public void before() throws StatusException {
+ checker = (_XRowSetApproveBroadcaster.RowSetApproveChecker)
+ tEnv.getObjRelation("XRowSetApproveBroadcaster.ApproveChecker") ;
+
+ if (checker == null) {
+ log.println("Required relation not found !!!") ;
+ throw new StatusException("Required relation not found !!!",
+ new NullPointerException()) ;
+ }
+ }
+
+ /**
+ * Reexecutes the RowSet and checks that listener was called. <p>
+ * Has OK status if no exceptions were rised and listener was called.
+ */
+ public void _execute() {
+ requiredMethod("addRowSetListener()");
+ listener.reset();
+ boolean result = true ;
+
+ try {
+ oObj.execute() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("execute()", listener.rowSetChanged);
+ }
+
+ /**
+ * Adds listener and calls methods moveCursor, changeRow,
+ * changeRowSet of the relation and then checks if appropriate
+ * methods of the listener were called. <p>
+ * Has OK status if all listener methods were called.
+ */
+ public void _addRowSetListener() {
+ boolean result = true ;
+
+ oObj.addRowSetListener(listener) ;
+
+ checker.moveCursor() ;
+ result &= listener.cursorMoved ;
+ if (!listener.cursorMoved)
+ log.println("cursorMoved event wasn't called") ;
+ listener.reset() ;
+
+ checker.changeRow() ;
+ result &= listener.rowChanged ;
+ if (!listener.rowChanged)
+ log.println("rowChanged event wasn't called") ;
+ listener.reset() ;
+
+ checker.changeRowSet() ;
+ result &= listener.rowSetChanged ;
+ if (!listener.rowSetChanged)
+ log.println("rowSetChanged event wasn't called") ;
+ listener.reset() ;
+
+ tRes.tested("addRowSetListener()", result) ;
+ }
+
+ /*
+ * Removes listener added before, and checks for no listener
+ * methods were called on response to rowSet manipulations. <p>
+ * Methods to be successfully completed before :
+ * <ul>
+ * <li> <code>addRowSetListener()</code> </li>
+ * </ul> <p>
+ * Has OK status if no listeners methods were called.
+ */
+ public void _removeRowSetListener() {
+ requiredMethod("addRowSetListener()") ;
+
+ boolean result = true ;
+
+ oObj.removeRowSetListener(listener) ;
+
+ checker.moveCursor() ;
+ result &= !listener.cursorMoved ;
+ listener.reset() ;
+
+ checker.changeRow() ;
+ result &= !listener.rowChanged ;
+ listener.reset() ;
+
+ checker.changeRowSet() ;
+ result &= !listener.rowSetChanged ;
+
+ tRes.tested("removeRowSetListener()", result) ;
+ }
+
+ /**
+ * Disposes test environment.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+
+} // finish class _XRowSet
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java b/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java
new file mode 100644
index 000000000000..ef4921b0ea57
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java
@@ -0,0 +1,726 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRowUpdate.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.io.XDataInputStream;
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XTextInputStream;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XRow;
+import com.sun.star.sdbc.XRowUpdate;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.Date;
+import com.sun.star.util.DateTime;
+import com.sun.star.util.Time;
+import java.util.Vector;
+import lib.MultiMethodTest;
+import lib.Status;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.sdbc.XRowUpdate</code>
+* interface methods :
+* <ul>
+* <li><code> updateNull()</code></li>
+* <li><code> updateBoolean()</code></li>
+* <li><code> updateByte()</code></li>
+* <li><code> updateShort()</code></li>
+* <li><code> updateInt()</code></li>
+* <li><code> updateLong()</code></li>
+* <li><code> updateFloat()</code></li>
+* <li><code> updateDouble()</code></li>
+* <li><code> updateString()</code></li>
+* <li><code> updateBytes()</code></li>
+* <li><code> updateDate()</code></li>
+* <li><code> updateTime()</code></li>
+* <li><code> updateTimestamp()</code></li>
+* <li><code> updateBinaryStream()</code></li>
+* <li><code> updateCharacterStream()</code></li>
+* <li><code> updateObject()</code></li>
+* <li><code> updateNumericObject()</code></li>
+* </ul> <p>
+* Object relations required :
+* <ul>
+* <li> <code>'CurrentRowData'</code> : (may be used in other
+* interface tests) is a <code>java.util.Vector</code> object
+* that contains column types and values in current row. Each
+* element of vector corresponds to appropriate column (element
+* with index 0 to column 1, 1 -> 2, etc.). <p>
+* The following <code>XRowUpdate</code> methods correspond to classes
+* in Vector :
+* <ul>
+* <li> <code>setBinaryStream</code> -
+* <code>com.sun.star.io.XDataInputStream</code> class. </li>
+* <li> <code>setCharacterStream</code> -
+* <code>com.sun.star.io.XTextInputStream</code> class. </li>
+* <li> <code>setObject</code> -
+* <code>java.lang.Object[]</code> class, the element with
+* index 0 must be used. </li>
+* </ul>
+* Other methods uses types they return (i.e. <code>java.lang.String</code>
+* for <code>setString</code> method, <code>com.sun.star.sdbc.XRef</code>
+* for <code>setRef</code> method).
+* </li>
+* <li> <code>'XRowUpdate.XRow'</code> : implementation of <code>
+* com.sun.star.sdbc.XRow</code> interface for checking updated data.
+* </li>
+* </ul> <p>
+* The test <b>damages</b> the object, so it is recreated finally.
+* @see com.sun.star.sdbc.XRowUpdate
+* @see com.sun.star.sdbc.XRow
+*/
+public class _XRowUpdate extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XRowUpdate oObj = null ;
+
+ private Vector rowData = null ;
+ private XRow row = null ;
+
+ /**
+ * Gets relations.
+ */
+ public void before() {
+ rowData = (Vector) tEnv.getObjRelation("CurrentRowData") ;
+ if (rowData == null) {
+ log.println("!!! 'CurrentRowData' relation not found !!!") ;
+ }
+ row = (XRow) tEnv.getObjRelation("XRowUpdate.XRow") ;
+ if (rowData == null) {
+ log.println("!!! 'XRowUpdate.XRow' relation not found !!!") ;
+ }
+ }
+
+ /**
+ * Try to set NULL value for each column. Then using <code>XRow</code>
+ * relation check if NULL was really set. <p>
+ * Has OK status if for every column NULL value was successfully set.
+ * @see com.sun.star.sdbc.XRow
+ */
+ public void _updateNull() {
+ boolean result = true ;
+ for (int i = 0; i < rowData.size(); i++) {
+ if (rowData.get(i) == null) continue ;
+ log.print(" Setting NULL at column #" + (i+1) + " ...") ;
+ try {
+ oObj.updateNull(i + 1) ;
+
+ if (rowData.get(i) instanceof String) row.getString(i + 1) ;
+ if (rowData.get(i) instanceof Boolean) row.getBoolean(i + 1) ;
+ if (rowData.get(i) instanceof Byte) row.getByte(i + 1) ;
+ if (rowData.get(i) instanceof Short) row.getShort(i + 1) ;
+ if (rowData.get(i) instanceof Integer) row.getInt(i + 1) ;
+ if (rowData.get(i) instanceof Long) row.getLong(i + 1) ;
+ if (rowData.get(i) instanceof Float) row.getFloat(i + 1) ;
+ if (rowData.get(i) instanceof Double) row.getDouble(i + 1) ;
+ if (rowData.get(i) instanceof byte[]) row.getBytes(i + 1) ;
+ if (rowData.get(i) instanceof Date) row.getDate(i + 1) ;
+ if (rowData.get(i) instanceof Time) row.getTime(i + 1) ;
+ if (rowData.get(i) instanceof DateTime)
+ row.getTimestamp(i + 1) ;
+ if (rowData.get(i) instanceof XDataInputStream)
+ row.getBinaryStream(i + 1) ;
+ if (rowData.get(i) instanceof XTextInputStream)
+ row.getCharacterStream(i + 1) ;
+ //if (rowData.get(i) instanceof Object[]) row.getObject(i) ;
+
+ if (!row.wasNull()) {
+ log.println("FAILED") ;
+ log.println("Not NULL was returned !!!") ;
+ result = false ;
+ } else {
+ log.println("OK") ;
+ }
+ } catch (SQLException e) {
+ log.println("FAILED") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("updateNull()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateBoolean() {
+ boolean result = true ;
+ int idx = findColumnOfType(Boolean.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateBoolean()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ boolean newVal = !row.getBoolean(idx) ;
+ oObj.updateBoolean(idx, newVal) ;
+ boolean getVal = row.getBoolean(idx) ;
+ result = newVal == getVal ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateBoolean()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateByte() {
+ boolean result = true ;
+ int idx = findColumnOfType(Byte.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateByte()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ byte newVal = (byte) (row.getByte(idx) + 1) ;
+ oObj.updateByte(idx, newVal) ;
+ byte getVal = row.getByte(idx) ;
+ result = newVal == getVal ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateByte()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateShort() {
+ boolean result = true ;
+ int idx = findColumnOfType(Short.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateShort()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ short newVal = (short) (row.getShort(idx) + 1) ;
+ oObj.updateShort(idx, newVal) ;
+ short getVal = row.getShort(idx) ;
+ result = newVal == getVal ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateShort()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateInt() {
+ boolean result = true ;
+ int idx = findColumnOfType(Integer.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateInt()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ int newVal = 1 + row.getInt(idx) ;
+ oObj.updateInt(idx, newVal) ;
+ int getVal = row.getInt(idx) ;
+ result = newVal == getVal ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateInt()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateLong() {
+ boolean result = true ;
+ int idx = findColumnOfType(Long.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateLong()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ long newVal = 1 + row.getLong(idx) ;
+ oObj.updateLong(idx, newVal) ;
+ long getVal = row.getLong(idx) ;
+ result = newVal == getVal ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateLong()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateFloat() {
+ boolean result = true ;
+ int idx = findColumnOfType(Float.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateFloat()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ float newVal = (float) (1.1 + row.getFloat(idx));
+ oObj.updateFloat(idx, newVal) ;
+ float getVal = row.getFloat(idx) ;
+ result = newVal == getVal ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateFloat()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateDouble() {
+ boolean result = true ;
+ int idx = findColumnOfType(Double.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateDouble()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ double newVal = 1.1 + row.getDouble(idx) ;
+ oObj.updateDouble(idx, newVal) ;
+ double getVal = row.getDouble(idx) ;
+ result = newVal == getVal ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateDouble()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateString() {
+ boolean result = true ;
+ int idx = findColumnOfType(String.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateString()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ String newVal = "_" + row.getString(idx) ;
+ oObj.updateString(idx, newVal) ;
+ String getVal = row.getString(idx) ;
+ result = newVal.equals(getVal) ;
+ log.println("New value = '" + newVal + "', get value = '"
+ + getVal + "'") ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateString()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateBytes() {
+ boolean result = true ;
+ int idx = findColumnOfType(byte[].class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateBytes()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ byte[] newVal = row.getBytes(idx) ;
+ if (newVal == null || newVal.length == 0) {
+ newVal = new byte[] {34, 111, 98} ;
+ } else {
+ newVal = new byte[] {(byte) (newVal[0] + 1), 111, 98} ;
+ }
+ oObj.updateBytes(idx, newVal) ;
+ byte[] getVal = row.getBytes(idx) ;
+ result = ValueComparer.equalValue(newVal, getVal) ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateBytes()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateDate() {
+ boolean result = true ;
+ int idx = findColumnOfType(Date.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateDate()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ Date newVal = row.getDate(idx) ;
+ newVal.Year ++ ;
+ oObj.updateDate(idx, newVal) ;
+ Date getVal = row.getDate(idx) ;
+ result = ValueComparer.equalValue(newVal, getVal) ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateDate()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateTime() {
+ boolean result = true ;
+ int idx = findColumnOfType(Time.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateTime()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ Time newVal = row.getTime(idx) ;
+ newVal.Seconds ++ ;
+ oObj.updateTime(idx, newVal) ;
+ Time getVal = row.getTime(idx) ;
+ result = ValueComparer.equalValue(newVal, getVal) ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateTime()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateTimestamp() {
+ boolean result = true ;
+ int idx = findColumnOfType(DateTime.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateTimestamp()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ DateTime newVal = row.getTimestamp(idx) ;
+ newVal.Year ++ ;
+ oObj.updateTimestamp(idx, newVal) ;
+ DateTime getVal = row.getTimestamp(idx) ;
+ result = ValueComparer.equalValue(newVal, getVal) ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateTimestamp()", result) ;
+ }
+
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateBinaryStream() {
+ boolean result = true ;
+ int idx = findColumnOfType(XDataInputStream.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateBinaryStream()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ Object oStream = tParam.getMSF().createInstance
+ ("com.sun.star.io.DataInputStream") ;
+ XInputStream newVal = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oStream);
+
+ oObj.updateBinaryStream(idx, newVal, 0) ;
+ XInputStream getVal = row.getBinaryStream(idx) ;
+ result = UnoRuntime.areSame(newVal, getVal) ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception:") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateBinaryStream()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateCharacterStream() {
+ boolean result = true ;
+ int idx = findColumnOfType(XTextInputStream.class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateCharacterStream()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ Object oStream = tParam.getMSF().createInstance
+ ("com.sun.star.io.TextInputStream") ;
+ XInputStream newVal = (XInputStream) UnoRuntime.queryInterface
+ (XInputStream.class, oStream);
+
+ oObj.updateCharacterStream(idx, newVal, 0) ;
+ XInputStream getVal = row.getCharacterStream(idx) ;
+ result = UnoRuntime.areSame(newVal, getVal) ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception:") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateCharacterStream()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateObject() {
+ boolean result = true ;
+ int idx = findColumnOfType(Object[].class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateObject()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ Object newVal = tParam.getMSF().createInstance
+ ("com.sun.star.io.Pipe") ;
+
+ //oObj.updateObject(idx, newVal) ;
+ //Object getVal = row.getObject(idx) ;
+ //result = UnoRuntime.areSame(newVal, getVal) ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception:") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateObject()", result) ;
+ }
+
+ /**
+ * Updates column with the appropriate type (if exists) and then
+ * checks result with interface <code>XRow</code>.<p>
+ * Has OK status if column successfully updated, ahd the same
+ * result returned.
+ */
+ public void _updateNumericObject() {
+ boolean result = true ;
+ int idx = findColumnOfType(Object[].class) ;
+
+ if (idx < 0) {
+ log.println("Required type not found") ;
+ tRes.tested("updateNumericObject()", Status.skipped(true)) ;
+ return ;
+ }
+
+ try {
+ Object newVal = tParam.getMSF().createInstance
+ ("com.sun.star.io.Pipe") ;
+
+ oObj.updateNumericObject(idx, newVal, 0) ;
+ //Object getVal = row.getObject(idx) ;
+ //result = UnoRuntime.areSame(newVal, getVal) ;
+ } catch (SQLException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Unexpected exception:") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("updateNumericObject()", result) ;
+ }
+
+ /**
+ * Finds in relation vector index of column of the appropriate
+ * type.
+ */
+ protected int findColumnOfType(Class clz) {
+
+ for (int i = 0; i < rowData.size(); i++)
+ if (clz.isInstance(rowData.get(i))) return i + 1 ;
+ return -1 ;
+ }
+
+ /**
+ * Disposes environment.
+ */
+ public void after() {
+ //disposeEnvironment() ;
+ }
+
+} // finish class _XRow
+
+
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XWarningsSupplier.java b/qadevOOo/tests/java/ifc/sdbc/_XWarningsSupplier.java
new file mode 100644
index 000000000000..f46311b69273
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbc/_XWarningsSupplier.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XWarningsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:11:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbc;
+
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XWarningsSupplier;
+import lib.MultiMethodTest;
+import com.sun.star.sdbc.XRowUpdate;
+import com.sun.star.sdbc.XResultSetUpdate;
+import com.sun.star.sdbc.XRow;
+import util.DBTools;
+import util.utils;
+import com.sun.star.uno.UnoRuntime;
+import lib.StatusException;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.sdbc.XWarningsSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getWarnings()</code></li>
+* <li><code> clearWarnings()</code></li>
+* </ul> <p>
+* @see com.sun.star.sdbc.XWarningsSupplier
+*/
+public class _XWarningsSupplier extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XWarningsSupplier oObj = null ;
+
+ /**
+ * Updates value of int column by value '9999999999999999'.
+ * Calls method and checks returned value. <p>
+ * Has OK status if the method return not empty value.
+ */
+ public void _getWarnings() {
+ final XRowUpdate xRowUpdate = (XRowUpdate)
+ UnoRuntime.queryInterface(XRowUpdate.class, oObj);
+ final XResultSetUpdate xResSetUpdate = (XResultSetUpdate)
+ UnoRuntime.queryInterface(XResultSetUpdate.class, oObj);
+ final XRow xRow = (XRow)
+ UnoRuntime.queryInterface(XRow.class, oObj);
+ if (xRowUpdate == null || xResSetUpdate == null || xRow == null) {
+ throw new StatusException(Status.failed("Test must be modified"));
+ }
+ int oldVal = 0, newVal = 0;
+ String valToSet = "9999999999999999";
+ try {
+ oldVal = xRow.getInt(DBTools.TST_INT);
+ xRowUpdate.updateString(DBTools.TST_INT, valToSet);
+ xResSetUpdate.updateRow();
+ newVal = xRow.getInt(DBTools.TST_INT);
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Unexpected SQL exception");
+ e.printStackTrace(log);
+ tRes.tested("getWarnings()", false);
+ return;
+ }
+
+ log.println("Old INT value: " + oldVal);
+ log.println("Value that was set: " + valToSet);
+ log.println("New INT value: " + newVal);
+
+ boolean res = false;
+
+ try {
+ Object warns = oObj.getWarnings();
+ res = (!utils.isVoid(warns));
+ } catch (SQLException e) {
+ log.println("Exception occured :");
+ e.printStackTrace(log);
+ tRes.tested("getWarnings()", res);
+ return;
+ }
+
+ tRes.tested("getWarnings()", res);
+ }
+
+ /**
+ * Calls method and checks value returned by the method
+ * <code>getWarnings()</code>. <p>
+ * Has OK status if the method <code>getWarnings()</code> return void value.
+ */
+ public void _clearWarnings() {
+ executeMethod("getWarnings()");
+ boolean res = false;
+
+ try {
+ oObj.clearWarnings();
+ Object warns = oObj.getWarnings();
+ res = (utils.isVoid(warns));
+ } catch (SQLException e) {
+ log.println("Exception occured :");
+ e.printStackTrace(log);
+ tRes.tested("clearWarnings()", res);
+ return;
+ }
+
+ tRes.tested("clearWarnings()", res);
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/sdbcx/_ResultSet.java b/qadevOOo/tests/java/ifc/sdbcx/_ResultSet.java
new file mode 100644
index 000000000000..2ec35cb9cb7c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbcx/_ResultSet.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ResultSet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbcx;
+
+import java.io.PrintWriter;
+
+import com.sun.star.uno.XInterface;
+import com.sun.star.lang.XServiceInfo;
+
+import com.sun.star.uno.UnoRuntime;
+
+import util.*;
+import lib.*;
+
+import com.sun.star.beans.XPropertySet;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.FunctionArgument;
+import com.sun.star.beans.UnknownPropertyException ;
+import com.sun.star.beans.PropertyVetoException ;
+
+/**
+* Testing <code>com.sun.star.sdbcx.ResultSet</code>
+* service properties :
+* <ul>
+* <li><code> IsBookmarkable</code></li>
+* <li><code> CanUpdateInsertedRows</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sdbcx.ResultSet
+*/
+public class _ResultSet extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/sdbcx/_XColumnsSupplier.java b/qadevOOo/tests/java/ifc/sdbcx/_XColumnsSupplier.java
new file mode 100644
index 000000000000..240fa78be55e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbcx/_XColumnsSupplier.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XColumnsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbcx;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdbcx.XColumnsSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sdbcx.XColumnsSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getColumns()</code></li>
+* </ul> <p>
+* @see com.sun.star.sdbcx.XColumnsSupplier
+*/
+public class _XColumnsSupplier extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XColumnsSupplier oObj = null ;
+
+ /**
+ * Has OK status if method returns not null
+ * <code>XNameAccess</code> object, FAILED otherwise.
+ */
+ public void _getColumns() {
+ boolean result = true ;
+
+ XNameAccess cols = oObj.getColumns() ;
+
+ /*
+ String[] colNames = cols.getElementNames() ;
+
+ log.println("Column names:") ;
+ for (int i =0 ; i < colNames.length; i++) {
+ log.println(" " + colNames[i]) ;
+ }
+
+ XServiceInfo info = null ;
+ try {
+ info = (XServiceInfo) UnoRuntime.queryInterface
+ (XServiceInfo.class, cols.getByName("colNames[0]")) ;
+ } catch (com.sun.star.uno.Exception e) {}
+
+ log.println("Support : " +
+ info.supportsService("com.sun.star.sdbcx.Column")) ;
+ */
+
+ tRes.tested("getColumns()", cols != null) ;
+ }
+
+} // finish class _XColumnsSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/sdbcx/_XCreateCatalog.java b/qadevOOo/tests/java/ifc/sdbcx/_XCreateCatalog.java
new file mode 100644
index 000000000000..02ff3dd79dc3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbcx/_XCreateCatalog.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCreateCatalog.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbcx;
+
+import lib.MultiMethodTest;
+import com.sun.star.sdbcx.XCreateCatalog;
+
+/**
+* Testing <code>com.sun.star.sdbcx.XCreateCatalog</code>
+* interface methods :
+* <ul>
+* <li><code>createCatalog()</code></li>
+* </ul> <p>
+* @see com.sun.star.sdbcx.XCreateCatalog
+*/
+public class _XCreateCatalog extends MultiMethodTest {
+ // oObj filled by MultiMethodTest
+ public XCreateCatalog oObj = null;
+
+ public void _createCatalog() {
+ tRes.tested("createCatalog()", tRes.skipped(false));
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/sdbcx/_XDataDefinitionSupplier.java b/qadevOOo/tests/java/ifc/sdbcx/_XDataDefinitionSupplier.java
new file mode 100644
index 000000000000..013bf6a3fe66
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbcx/_XDataDefinitionSupplier.java
@@ -0,0 +1,211 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataDefinitionSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:12:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbcx;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XDriver;
+import com.sun.star.sdbcx.XDataDefinitionSupplier;
+import com.sun.star.sdbcx.XTablesSupplier;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sdbcx.XDataDefinitionSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getDataDefinitionByConnection()</code></li>
+* <li><code> getDataDefinitionByURL()</code></li>
+* </ul> <p>
+* Required object relations :
+* <ul>
+* <li> <code>'XDriver.URL'</code>:
+* is the URL of the database to which to connect</code></li>
+* <li><code>'XDriver.UNSUITABLE_URL'</code>:
+* the wrong kind of URL to connect using given driver</li>
+* <li><code>'XDriver.INFO'</code>:
+* a list of arbitrary string tag/value pairs as connection arguments</li>
+* </ul> <p>
+* @see com.sun.star.sdbcx.XDataDefinitionSupplier
+*/
+public class _XDataDefinitionSupplier extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XDataDefinitionSupplier oObj = null ;
+
+ String url = null;
+ String wrongUrl = null;
+ PropertyValue[] info = null;
+
+ /**
+ * Retrieves relations.
+ * @throw StatusException If any relation not found.
+ */
+ protected void before() {
+ url = (String)tEnv.getObjRelation("XDriver.URL");
+ if (url == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XDriver.URL'"));
+ }
+ wrongUrl = (String)tEnv.getObjRelation("XDriver.UNSUITABLE_URL");
+ if (wrongUrl == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XDriver.WRONG_URL'"));
+ }
+ info = (PropertyValue[])tEnv.getObjRelation("XDriver.INFO");
+ if (info == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'XDriver.INFO'"));
+ }
+ }
+
+ XConnection connection = null;
+
+ /**
+ * Obtains the connection to url(relation <code>'XDriver.URL'</code>)
+ * with info(relation <code>'XDriver.INFO'</code>).
+ * Calls the method with obtained connection and checks that returned value
+ * isn't null.
+ */
+ public void _getDataDefinitionByConnection() {
+ boolean bRes = true;
+ XDriver xDriver = (XDriver)
+ UnoRuntime.queryInterface(XDriver.class, oObj);
+ if (xDriver == null) {
+ log.println("The XDriver interface isn't supported");
+ tRes.tested("getDataDefinitionByConnection()",
+ Status.skipped(false));
+ return;
+ }
+ try {
+ connection = xDriver.connect(url, info);
+ } catch(com.sun.star.sdbc.SQLException e) {
+ e.printStackTrace(log);
+ bRes = false;
+ }
+ if (connection == null) {
+ log.println("Couldn't get connection to specified url using " +
+ "specified info");
+ tRes.tested("getDataDefinitionByConnection()",
+ Status.skipped(false));
+ return;
+ }
+ XTablesSupplier xTS = null;
+ try {
+ log.println("getDataDefinitionByConnection(connection)");
+ xTS = oObj.getDataDefinitionByConnection(connection);
+ bRes = xTS != null;
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Unexpected exception: " + e);
+ bRes = false;
+ }
+
+ try {
+ log.println("getDataDefinitionByConnection(null)");
+ xTS = oObj.getDataDefinitionByConnection(null);
+ bRes = xTS == null;
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Exception: " + e);
+ bRes = true;
+ }
+
+ tRes.tested("getDataDefinitionByConnection()", bRes);
+ }
+
+ /**
+ * Calls the method with url and info obtained from the relations
+ * <code>XDriver.URL</code> and <code>XDriver.INFO</code>.
+ * Checks that retuned value isn't null.
+ * Then calls the method with the unsuitable url obtained from the relation
+ * <code>XDriver.UNSUITABLE_URL</code> and checks that SQLException
+ * exception was thrown.
+ */
+ public void _getDataDefinitionByURL() {
+ boolean bRes = false;
+
+ try {
+ log.println("getDataDefinitionByURL('" + url + "')");
+ XTablesSupplier xTS = oObj.getDataDefinitionByURL(url, info);
+ bRes = xTS != null;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("Unexpected exception: " + e);
+ bRes = false;
+ }
+
+ try {
+ log.println("getDataDefinitionByURL('" + wrongUrl + "')");
+ XTablesSupplier xTS = oObj.getDataDefinitionByURL(wrongUrl, info);
+ log.println("Exception was expected");
+ bRes = false;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("Expected exception");
+ bRes &= true;
+ }
+
+ tRes.tested("getDataDefinitionByURL()", true);
+
+ }
+} // finish class _XDataDefinitionSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/sdbcx/_XDeleteRows.java b/qadevOOo/tests/java/ifc/sdbcx/_XDeleteRows.java
new file mode 100644
index 000000000000..4113384de609
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbcx/_XDeleteRows.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDeleteRows.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbcx;
+
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.sdbcx.XDeleteRows;
+import com.sun.star.sdbcx.XRowLocate;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sdbcx.XDeleteRows</code>
+* interface methods :
+* <ul>
+* <li><code> deleteRows()</code></li>
+* </ul> <p>
+* @see com.sun.star.sdbcx.XDeleteRows
+*/
+public class _XDeleteRows extends MultiMethodTest {
+ // oObj filled by MultiMethodTest
+ public XDeleteRows oObj = null ;
+
+ /**
+ * Retrieves bookmark using XRowLocate and deletes
+ * row pointed by this bookmark. <p>
+ * Has OK status if number of rows after deleting is less than before
+ * and no exception rizes while method call, FAILED otherwise. <p>
+ */
+ public void _deleteRows() {
+ XRowLocate xRowLocate = (XRowLocate)
+ UnoRuntime.queryInterface(XRowLocate.class, oObj);
+ XResultSet xResultSet = (XResultSet)
+ UnoRuntime.queryInterface(XResultSet.class, oObj);
+ if (xRowLocate == null || xResultSet == null) {
+ log.println("The test must be modified according to "+
+ "component testcase");
+ throw new StatusException(Status.failed(
+ "The component doesn't support one of the "+
+ "required interfaces"));
+ }
+
+ int rowsBefore = 0, rowsAfter = 0;
+ Object bkmrk = null;
+ try {
+ xResultSet.last();
+ rowsBefore = xResultSet.getRow();
+ xResultSet.first();
+ bkmrk = xRowLocate.getBookmark();
+ oObj.deleteRows(new Object[] {bkmrk});
+ xResultSet.last();
+ rowsAfter = xResultSet.getRow();
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("SQLException:" + e);
+ tRes.tested("deleteRows()", false);
+ return;
+ }
+
+ log.println("Rows before: " + rowsBefore + ", after: " + rowsAfter);
+ tRes.tested("deleteRows()", rowsBefore - 1 == rowsAfter);
+ }
+
+ protected void after() {
+ disposeEnvironment();
+ }
+} // finish class _XDeleteRows
+
diff --git a/qadevOOo/tests/java/ifc/sdbcx/_XDropCatalog.java b/qadevOOo/tests/java/ifc/sdbcx/_XDropCatalog.java
new file mode 100644
index 000000000000..5913813153de
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbcx/_XDropCatalog.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDropCatalog.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbcx;
+
+import lib.MultiMethodTest;
+import com.sun.star.sdbcx.XDropCatalog;
+
+/**
+* Testing <code>com.sun.star.sdbcx.XDropCatalog</code>
+* interface methods :
+* <ul>
+* <li><code>dropCatalog()</code></li>
+* </ul> <p>
+* @see com.sun.star.sdbcx.XDropCatalog
+*/
+public class _XDropCatalog extends MultiMethodTest {
+ // oObj filled by MultiMethodTest
+ public XDropCatalog oObj = null;
+
+ public void _dropCatalog() {
+ tRes.tested("dropCatalog()", tRes.skipped(false));
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/sdbcx/_XRowLocate.java b/qadevOOo/tests/java/ifc/sdbcx/_XRowLocate.java
new file mode 100644
index 000000000000..8b5020555a8f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sdbcx/_XRowLocate.java
@@ -0,0 +1,269 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRowLocate.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sdbcx;
+
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbcx.XRowLocate;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sdbcx.XRowLocate</code>
+* interface methods :
+* <ul>
+* <li><code> getBookmark()</code></li>
+* <li><code> moveToBookmark()</code></li>
+* <li><code> moveRelativeToBookmark()</code></li>
+* <li><code> compareBookmarks()</code></li>
+* <li><code> hasOrderedBookmarks()</code></li>
+* <li><code> hashBookmark()</code></li>
+* </ul> <p>
+* Object relations needed :
+* <ul>
+* <li> <code>XRowLocate.HasOrderedBookmarks</code> <b>(optional)</b>:
+* <code>Boolean</code> type. If information about bookmark ordering
+* of object tested exists it placed in this relation.</li>
+* </ul> <p>
+* @see com.sun.star.sdbcx.XRowLocate
+*/
+public class _XRowLocate extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XRowLocate oObj = null ;
+
+ private Object bookmark1 = null, bookmark2 = null ;
+
+ /**
+ * Gets the bookmark of the current cursor position and
+ * stores it for other methods use.
+ * Has OK status if method returns not null
+ * <code>XNameAccess</code> object, FAILED otherwise.
+ */
+ public void _getBookmark() {
+ boolean result = true ;
+
+ try {
+ bookmark1 = oObj.getBookmark() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("getBookmark()", bookmark1 != null) ;
+ }
+
+ /**
+ * Moves to bookmark previously created by method <code>_getBookmark</code>
+ * then creates new bookmark and compare it to the first one. The
+ * row difference must be equal to 0. <p>
+ * Method tests to be completed successfully before :
+ * <ul>
+ * <li> <code>getBookmark()</code> : to have a bookmark to move to.</li>
+ * </ul>
+ * Method tests to be executed before :
+ * <ul>
+ * <li> <code>moveRelativeToBookmark()</code> : to move the cursor from
+ * the initial position, to check if it returns back.</li>
+ * </ul> <p>
+ * Has OK status difference between positions of bookmarks (where
+ * cursor was moved to and created new one) equals to 0 and no
+ * exceptions occured, FAILED otherwise.
+ */
+ public void _moveToBookmark() {
+ requiredMethod("getBookmark()") ;
+ executeMethod("moveRelativeToBookmark()") ;
+
+ int comparison = -1 ;
+ Object tmpBookmark = null ;
+ try {
+ synchronized(oObj) {
+ oObj.moveToBookmark(bookmark1) ;
+ tmpBookmark = oObj.getBookmark() ;
+ }
+ comparison = oObj.compareBookmarks(bookmark1, tmpBookmark) ;
+ } catch (SQLException e) {
+ log.println("Exception occured :" + e) ;
+ }
+
+ tRes.tested("moveToBookmark()", comparison == 0) ;
+ }
+
+ /**
+ * Moves the cursor to the position with offset 2 from the
+ * bookmark created by <code>_getBookmark()</code> method and
+ * then creates a bookmark of new position. <p>
+ * Method tests to be completed successfully before :
+ * <ul>
+ * <li> <code>getBookmark()</code> : to have a bookmark to move to.</li>
+ * </ul> <p>
+ * Has OK status if no exceptions occured while method call.
+ */
+ public void _moveRelativeToBookmark() {
+ requiredMethod("getBookmark()") ;
+
+ boolean result = true ;
+ try {
+ synchronized (oObj) {
+ oObj.moveRelativeToBookmark(bookmark1, 1) ;
+ bookmark2 = oObj.getBookmark() ;
+ }
+ } catch (SQLException e) {
+ log.println("Exception occured :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("moveRelativeToBookmark()", result) ;
+ }
+
+ /**
+ * Compares bookmarks created in <code>getBookmark()</code> and
+ * <code>moveRelativeToBokkmark()</code> methods.
+ * Method tests to be completed successfully before :
+ * <ul>
+ * <li> <code>getBookmark()</code> : to have first bookmark to compare.</li>
+ * <li> <code>moveRelativeToBookmark()</code> : to have second
+ * bookmark to compare.</li>
+ * </ul> <p>
+ * Has OK status if difference in bookmark positions equals to 2.
+ */
+ public void _compareBookmarks() {
+ requiredMethod("getBookmark()") ;
+ requiredMethod("moveRelativeToBookmark()") ;
+
+ int comparison = 0 ;
+ int comparison1 = 0 ;
+ try {
+ comparison = oObj.compareBookmarks(bookmark1, bookmark2) ;
+ comparison1 = oObj.compareBookmarks(bookmark1, bookmark1) ;
+ } catch (SQLException e) {
+ log.println("Exception occured :" + e) ;
+ }
+
+ if (comparison != -1) {
+ log.println("! Wrong compare number :" + comparison) ;
+ }
+
+ tRes.tested("compareBookmarks()", comparison == -1 && comparison1 == 0) ;
+ }
+
+ /**
+ * Calls method. If relation is not found, returned result is not
+ * checked. <p>
+ * Has OK status if method returned right value (in case if relation
+ * and value to compare to exist), or just successfully returned
+ * (in case of no relation).
+ */
+ public void _hasOrderedBookmarks() {
+ boolean result = true ;
+ boolean res = true ;
+
+ // Optional relation
+ Boolean has = (Boolean) tEnv.getObjRelation
+ ("XRowLocate.HasOrderedBookmarks") ;
+
+ try {
+ res = oObj.hasOrderedBookmarks() ;
+ } catch (SQLException e) {
+ log.println("Exception occured :" + e) ;
+ result = false ;
+ }
+
+ if (has == null) {
+ log.println("Optional relation not found - result not checked") ;
+ } else {
+ result &= res == has.booleanValue() ;
+ }
+
+ tRes.tested("hasOrderedBookmarks()", result) ;
+ }
+
+ /**
+ * Gets hash values of two previously created bookmarks of different
+ * cursor positions and compares them. <p>
+ * Method tests to be completed successfully before :
+ * <ul>
+ * <li> <code>getBookmark()</code> : to have first bookmark.</li>
+ * <li> <code>moveRelativeToBookmark()</code> : to have second
+ * bookmark.</li>
+ * </ul> <p>
+ * Has OK status if hash values of two bookmarks are different.
+ */
+ public void _hashBookmark() {
+ requiredMethod("getBookmark()") ;
+ requiredMethod("moveRelativeToBookmark()") ;
+
+ boolean result = true ;
+ try {
+ int hash1 = oObj.hashBookmark(bookmark1) ;
+ int hash2 = oObj.hashBookmark(bookmark2) ;
+ log.println("1st hash = " + hash1 + ", 2nd = " + hash2) ;
+
+ result = hash1 != hash2 ;
+ } catch (SQLException e) {
+ log.println("Exception occured :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("hashBookmark()", result) ;
+ }
+
+} // finish class _XRowLocate
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_CellAreaLink.java b/qadevOOo/tests/java/ifc/sheet/_CellAreaLink.java
new file mode 100644
index 000000000000..ef4d34d4d376
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_CellAreaLink.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CellAreaLink.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.CellAreaLink</code>
+* service properties :
+* <ul>
+* <li><code> Url</code></li>
+* <li><code> Filter</code></li>
+* <li><code> FilterOptions</code></li>
+* <li><code> RefreshDelay</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.CellAreaLink
+*/
+public class _CellAreaLink extends MultiPropertyTest {
+
+} // finish class _CellAreaLink
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_DataPilotField.java b/qadevOOo/tests/java/ifc/sheet/_DataPilotField.java
new file mode 100644
index 000000000000..51b99c7a51e9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_DataPilotField.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DataPilotField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.DataPilotField</code>
+* service properties :
+* <ul>
+* <li><code> Orientation</code></li>
+* <li><code> Function</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.DataPilotField
+*/
+public class _DataPilotField extends MultiPropertyTest {
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_DatabaseRange.java b/qadevOOo/tests/java/ifc/sheet/_DatabaseRange.java
new file mode 100644
index 000000000000..7ae8b7c256cf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_DatabaseRange.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DatabaseRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.DatabaseRange</code>
+* service properties :
+* <ul>
+* <li><code> MoveCells</code></li>
+* <li><code> KeepFormats</code></li>
+* <li><code> StripData</code></li>
+* <li><code> AutoFilter</code></li>
+* <li><code> UseFilerCriteriaSource</code></li>
+* <li><code> FilerCriteriaSource</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.DatabaseRange
+*/
+public class _DatabaseRange extends MultiPropertyTest {
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_GlobalSheetSettings.java b/qadevOOo/tests/java/ifc/sheet/_GlobalSheetSettings.java
new file mode 100644
index 000000000000..2afe2a15033d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_GlobalSheetSettings.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: _GlobalSheetSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.GlobalSheetSettings</code>
+* service properties :
+* <ul>
+* <li><code> MoveSelection</code></li>
+* <li><code> MoveDirection</code></li>
+* <li><code> EnterEdit</code></li>
+* <li><code> ExtendFormat</code></li>
+* <li><code> RangeFinder</code></li>
+* <li><code> ExpandReferences</code></li>
+* <li><code> MarkHeader</code></li>
+* <li><code> UseTabCol</code></li>
+* <li><code> Metric</code></li>
+* <li><code> Scale</code></li>
+* <li><code> DoAutoComplete</code></li>
+* <li><code> StatusBarFunction</code></li>
+* <li><code> UserLists</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.GlobalSheetSettings
+*/
+public class _GlobalSheetSettings extends MultiPropertyTest {
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_SheetCell.java b/qadevOOo/tests/java/ifc/sheet/_SheetCell.java
new file mode 100644
index 000000000000..2cde761bd0e5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_SheetCell.java
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SheetCell.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+
+public class _SheetCell extends MultiPropertyTest {
+
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_SheetCellRange.java b/qadevOOo/tests/java/ifc/sheet/_SheetCellRange.java
new file mode 100644
index 000000000000..5aac441063c9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_SheetCellRange.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SheetCellRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.SheetCellRange</code>
+* service properties :
+* <ul>
+* <li><code> Position</code></li>
+* <li><code> Size</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.SheetCellRange
+*/
+public class _SheetCellRange extends MultiPropertyTest {
+} // finisch class _SheetCellRange
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_SheetCellRanges.java b/qadevOOo/tests/java/ifc/sheet/_SheetCellRanges.java
new file mode 100644
index 000000000000..20ef04de3b4c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_SheetCellRanges.java
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SheetCellRanges.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+public class _SheetCellRanges extends MultiPropertyTest {
+
+}
diff --git a/qadevOOo/tests/java/ifc/sheet/_SheetFilterDescriptor.java b/qadevOOo/tests/java/ifc/sheet/_SheetFilterDescriptor.java
new file mode 100644
index 000000000000..f3f584680001
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_SheetFilterDescriptor.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SheetFilterDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.SheetFilterDescriptor</code>
+* service properties :
+* <ul>
+* <li><code> IsCaseSensitive</code></li>
+* <li><code> SkipDuplicates</code></li>
+* <li><code> UseRegularExpressions</code></li>
+* <li><code> SaveOutputPosition</code></li>
+* <li><code> Orientation</code></li>
+* <li><code> ContainsHeader</code></li>
+* <li><code> CopyOutputData</code></li>
+* <li><code> OutputPosition</code></li>
+* <li><code> MaxFieldCount</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.SheetFilterDescriptor
+*/
+public class _SheetFilterDescriptor extends MultiPropertyTest {
+} // finish class _SheetFilterDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_SheetLink.java b/qadevOOo/tests/java/ifc/sheet/_SheetLink.java
new file mode 100644
index 000000000000..91f0aeb27408
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_SheetLink.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SheetLink.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.ValueChanger;
+
+/**
+* Testing <code>com.sun.star.sheet.SheetLink</code>
+* service properties :
+* <ul>
+* <li><code> Url</code></li>
+* <li><code> Filter</code></li>
+* <li><code> FilterOptions</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.SheetLink
+*/
+public class _SheetLink extends MultiPropertyTest {
+
+ /**
+ *This class is destined to custom test of property <code>Url</code>.
+ */
+ protected PropertyTester UrlTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ String newValue = (String) ValueChanger.changePValue(oldValue);
+ if ( !newValue.startsWith("file://") ) {
+ newValue = "file://" + newValue;
+ }
+
+ return newValue;
+ }
+ };
+
+ /**
+ * Test property <code>Url</code> using custom <code>PropertyTest</code>.
+ */
+ public void _Url() {
+ testProperty("Url", UrlTester);
+ }
+
+ /**
+ *This class is destined to custom test of property <code>Filter</code>.
+ */
+ protected PropertyTester FilterTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return "StarCalc 4.0";
+ }
+ };
+
+ /**
+ * Test property <code>Filter</code> using custom <code>PropertyTest</code>.
+ */
+ public void _Filter() {
+ testProperty("Filter", FilterTester);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_Spreadsheet.java b/qadevOOo/tests/java/ifc/sheet/_Spreadsheet.java
new file mode 100644
index 000000000000..626843cb6fb0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_Spreadsheet.java
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Spreadsheet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.sheet.Spreadsheet</code>
+* service properties :
+* <ul>
+* <li><code> IsVisible</code></li>
+* <li><code> PageStyle</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.Spreadsheet
+*/
+public class _Spreadsheet extends MultiPropertyTest {
+
+ /**
+ *This class is destined to custom test of property <code>PageStyle</code>.
+ */
+ protected PropertyTester styleTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ String str = "Default";
+ String str2= "Report";
+ return str.equals(oldValue) ? str2 : str;
+ }
+ };
+
+ /**
+ * Test property <code>PageStyle</code> using custom <code>PropertyTest</code>.
+ */
+ public void _PageStyle() {
+ testProperty("PageStyle", styleTester);
+ }
+} // finish class _Spreadsheet
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocument.java b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocument.java
new file mode 100644
index 000000000000..a0645856e895
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocument.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SpreadsheetDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.SpreadsheetDocument</code>
+* service properties :
+* <ul>
+* <li><code> NamedRanges</code></li>
+* <li><code> DatabaseRanges</code></li>
+* <li><code> ColumnLabelRanges</code></li>
+* <li><code> RowLabelRanges</code></li>
+* <li><code> SheetLinks</code></li>
+* <li><code> AreaLinks</code></li>
+* <li><code> DDELinks</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.SpreadsheetDocument
+*/
+public class _SpreadsheetDocument extends MultiPropertyTest {
+} // finish class _SpreadsheetDocument
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java
new file mode 100644
index 000000000000..c7d9eae6cfdc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SpreadsheetDocumentSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.i18n.ForbiddenCharacters;
+import com.sun.star.i18n.XForbiddenCharacters;
+import com.sun.star.lang.Locale;
+import com.sun.star.util.Date;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.sheet.SpreadsheetDocumentSettings</code>
+* service properties :
+* <ul>
+* <li><code> IsIterationEnabled</code></li>
+* <li><code> IterationCount</code></li>
+* <li><code> IterationEpsilon</code></li>
+* <li><code> StandardDecimals</code></li>
+* <li><code> NullDate</code></li>
+* <li><code> DefaultTabStop</code></li>
+* <li><code> IgnoreCase</code></li>
+* <li><code> CalcAsShown</code></li>
+* <li><code> MatchWholeCell</code></li>
+* <li><code> SpellOnline</code></li>
+* <li><code> LookUpLabels</code></li>
+* <li><code> RegularExpressions</code></li>
+* <li><code> ForbiddenCharacters</code></li>
+* <li><code> HasDrawPages</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.SpreadsheetDocumentSettings
+*/
+public class _SpreadsheetDocumentSettings extends MultiPropertyTest {
+
+ /**
+ *This class is destined to custom test of property <code>NullDate</code>.
+ */
+ protected PropertyTester DateTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ Date date = (Date) oldValue;
+ Date newDate = new Date( (short)(date.Day - 1), date.Month, date.Year);
+ return newDate;
+ }
+ };
+
+ /**
+ * Test property <code>NullDate</code> using custom <code>PropertyTest</code>.
+ */
+ public void _NullDate() {
+ testProperty("NullDate", DateTester);
+ }
+
+ /**
+ * Class implements interface <code>XForbiddenCharacters</code>.
+ * It's destined to custom test of property <code>ForbiddenCharacters</code>.
+ * Feature of the class that it supports forbidden characters
+ * for russian locale.
+ * @see com.sun.star.i18n.XForbiddenCharacters
+ */
+ protected class ForbiddenChrTest implements XForbiddenCharacters {
+ protected Locale locale = new Locale("ru", "RU", "");
+ protected ForbiddenCharacters chrs = new ForbiddenCharacters("q", "w");
+ public ForbiddenCharacters getForbiddenCharacters(Locale rLocale)
+ throws com.sun.star.container.NoSuchElementException {
+ if ( rLocale.Country.equals(locale.Country) &&
+ rLocale.Language.equals(locale.Language) &&
+ rLocale.Variant.equals(locale.Variant) ) {
+ return chrs;
+ }
+
+ throw new com.sun.star.container.NoSuchElementException();
+ }
+
+ public void setForbiddenCharacters (
+ Locale rLocale, ForbiddenCharacters rForbiddenCharacters ) {
+ }
+
+ public void removeForbiddenCharacters (Locale rLocale) {
+ }
+
+ public boolean hasForbiddenCharacters (Locale rLocale) {
+ if ( rLocale.Country.equals(locale.Country) &&
+ rLocale.Language.equals(locale.Language) &&
+ rLocale.Variant.equals(locale.Variant) ) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ *This class is destined to custom test of property <code>ForbiddenCharacters</code>.
+ */
+ protected PropertyTester ChrTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return new ForbiddenChrTest();
+ }
+
+ protected boolean compare(Object obj1, Object obj2) {
+ Locale loc = new Locale("ru", "RU", "");
+ boolean has1 = ((XForbiddenCharacters)obj1).hasForbiddenCharacters(loc);
+ boolean has2 = ((XForbiddenCharacters)obj2).hasForbiddenCharacters(loc);
+ return has1 == has2;
+ }
+ };
+
+ /**
+ * Test property <code>ForbiddenCharacters</code> using custom <code>PropertyTest</code>.
+ */
+ public void _ForbiddenCharacters() {
+ testProperty("ForbiddenCharacters", ChrTester);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_SpreadsheetViewSettings.java b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetViewSettings.java
new file mode 100644
index 000000000000..ccd8b010caaf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetViewSettings.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SpreadsheetViewSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+import com.sun.star.view.DocumentZoomType;
+
+/**
+* Testing <code>com.sun.star.sheet.SpreadsheetViewSettings</code>
+* service properties :
+* <ul>
+* <li><code> ShowFormulas</code></li>
+* <li><code> ShowZeroValues</code></li>
+* <li><code> IsValueHighlightingEnabled</code></li>
+* <li><code> ShowNotes</code></li>
+* <li><code> HasVerticalScrollBar</code></li>
+* <li><code> HasHorizontalScrollBar</code></li>
+* <li><code> HasSheetTabs</code></li>
+* <li><code> IsOutlineSymbolsSet</code></li>
+* <li><code> HasColumnRowHeaders</code></li>
+* <li><code> ShowGrid</code></li>
+* <li><code> GridColor</code></li>
+* <li><code> ShowHelpLines</code></li>
+* <li><code> ShowAnchor</code></li>
+* <li><code> ShowPageBreaks</code></li>
+* <li><code> SolidHandles</code></li>
+* <li><code> ShowObjects</code></li>
+* <li><code> ShowCharts</code></li>
+* <li><code> ShowDrawing</code></li>
+* <li><code> HideSpellMarks</code></li>
+* <li><code> ZoomType</code></li>
+* <li><code> ZoomValue</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.SpreadsheetViewSettings
+*/
+public class _SpreadsheetViewSettings extends MultiPropertyTest {
+
+ public void _ZoomType() {
+ testProperty("ZoomType",
+ new Short(DocumentZoomType.PAGE_WIDTH),
+ new Short(DocumentZoomType.BY_VALUE));
+ }
+
+} // finish class _SpreadsheetViewSettings
+
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_SubTotalDescriptor.java b/qadevOOo/tests/java/ifc/sheet/_SubTotalDescriptor.java
new file mode 100644
index 000000000000..50c084be1fce
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_SubTotalDescriptor.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SubTotalDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.SubTotalDescriptor</code>
+* service properties :
+* <ul>
+* <li><code> InsertPageBreaks</code></li>
+* <li><code> IsCaseSensitive</code></li>
+* <li><code> EnableUserSortList</code></li>
+* <li><code> UserSortListIndex</code></li>
+* <li><code> BindFormatsToContent</code></li>
+* <li><code> SortAscending</code></li>
+* <li><code> MaxFieldCount</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.SubTotalDescriptor
+*/
+public class _SubTotalDescriptor extends MultiPropertyTest {
+} // finish class _SubTotalDescriptor
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_TableAutoFormat.java b/qadevOOo/tests/java/ifc/sheet/_TableAutoFormat.java
new file mode 100644
index 000000000000..bdd11ffc4a87
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_TableAutoFormat.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TableAutoFormat.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.TableAutoFormat</code>
+* service properties :
+* <ul>
+* <li><code> IncludeFont</code></li>
+* <li><code> IncludeJustify</code></li>
+* <li><code> IncludeBorder</code></li>
+* <li><code> IncludeBackground</code></li>
+* <li><code> IncludeNumberFormat</code></li>
+* <li><code> IncludeWidthAndHeight</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.TableAutoFormat
+*/
+public class _TableAutoFormat extends MultiPropertyTest {
+} // finish class _TableAutoFormat
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_TableAutoFormatField.java b/qadevOOo/tests/java/ifc/sheet/_TableAutoFormatField.java
new file mode 100644
index 000000000000..0254fe002d1c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_TableAutoFormatField.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TableAutoFormatField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.lang.Locale;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.sheet.TableAutoFormatField</code>
+* service properties :
+* <ul>
+* <li><code> CharFontName</code></li>
+* <li><code> CharHeight</code></li>
+* <li><code> CharWeight</code></li>
+* <li><code> CharPosture</code></li>
+* <li><code> CharUnderline</code></li>
+* <li><code> CharCrossedOut</code></li>
+* <li><code> CharContoured</code></li>
+* <li><code> CharShadowed</code></li>
+* <li><code> CharColor</code></li>
+* <li><code> CharLocale</code></li>
+* <li><code> CellBackColor</code></li>
+* <li><code> IsCellBackgroundTransparent</code></li>
+* <li><code> ShadowFormat</code></li>
+* <li><code> ParaRightMargin </code></li>
+* <li><code> ParaLeftMargin </code></li>
+* <li><code> ParaBottomMargin </code></li>
+* <li><code> ParaTopMargin </code></li>
+* <li><code> RotateReference </code></li>
+* <li><code> RotateAngle </code></li>
+* <li><code> Orientation </code></li>
+* <li><code> IsTextWrapped </code></li>
+* <li><code> VertJustify </code></li>
+* <li><code> HoriJustify </code></li>
+* <li><code> CharPostureComplex </code></li>
+* <li><code> CharPostureAsian </code></li>
+* <li><code> CharWeightComplex </code></li>
+* <li><code> CharWeightAsian </code></li>
+* <li><code> CharHeightComplex </code></li>
+* <li><code> CharHeightAsian </code></li>
+* <li><code> CharFontPitchComplex </code></li>
+* <li><code> CharFontPitchAsian </code></li>
+* <li><code> CharFontPitch </code></li>
+* <li><code> CharFontFamilyComplex </code></li>
+* <li><code> CharFontFamilyAsian </code></li>
+* <li><code> CharFontFamily </code></li>
+* <li><code> CharFontCharSetComplex </code></li>
+* <li><code> CharFontCharSetAsian </code></li>
+* <li><code> CharFontCharSet </code></li>
+* <li><code> CharFontStyleNameComplex </code></li>
+* <li><code> CharFontStyleNameAsian </code></li>
+* <li><code> CharFontStyleName </code></li>
+* <li><code> CharFontNameComplex </code></li>
+* <li><code> CharFontNameAsian </code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.TableAutoFormatField
+*/
+public class _TableAutoFormatField extends MultiPropertyTest {
+
+ /**
+ * Only some values can be used (which identify font name).
+ * In this property value is changed from 'Times New Roman'
+ * to 'Courier' and vise versa.
+ */
+ public void _CharFontName() {
+ testProperty("CharFontName", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return "Courier".equals(old) ? "Times New Roman" : "Courier" ;
+ }
+ }) ;
+ }
+
+ /**
+ * Locale values are predefined and can't be chaged arbitrary.
+ * In this property value is changed from ('de', 'DE', '')
+ * to ('es', 'ES', '') and vise versa.
+ */
+ public void _CharLocale() {
+ testProperty("CharLocale", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return old == null || ((Locale)old).Language == "de" ?
+ new Locale("es", "ES", "") : new Locale("de", "DE", "") ;
+ }
+ }) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _ShadowFormat() {
+ testProperty("ShadowFormat", new PropertyTester() {
+ protected Object getNewValue(String p, Object old) {
+ return old == null ? new com.sun.star.table.ShadowFormat() :
+ super.getNewValue(p, old) ;
+ }
+ }) ;
+ }
+
+} //finish class _TableAutoFormatField
+
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_TableValidation.java b/qadevOOo/tests/java/ifc/sheet/_TableValidation.java
new file mode 100644
index 000000000000..db5db1c3bda4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_TableValidation.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TableValidation.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.sheet.TableValidation</code>
+* service properties :
+* <ul>
+* <li><code> Type</code></li>
+* <li><code> ShowInputMessage</code></li>
+* <li><code> InputTitle</code></li>
+* <li><code> InputMessage</code></li>
+* <li><code> ShowErrorMessage</code></li>
+* <li><code> ErrorTitle</code></li>
+* <li><code> ErrorMessage</code></li>
+* <li><code> IgnoreBlankCells</code></li>
+* <li><code> ErrorAlertStyle</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.sheet.TableValidation
+*/
+public class _TableValidation extends MultiPropertyTest {
+} // finish class _TableValidation
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XAreaLink.java b/qadevOOo/tests/java/ifc/sheet/_XAreaLink.java
new file mode 100644
index 000000000000..d108bd354fb5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XAreaLink.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAreaLink.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XAreaLink;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XAreaLink</code>
+* interface methods :
+* <ul>
+* <li><code> getSourceArea()</code></li>
+* <li><code> setSourceArea()</code></li>
+* <li><code> getDestArea()</code></li>
+* <li><code> setDestArea()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.sheet.XAreaLink
+*/
+public class _XAreaLink extends MultiMethodTest {
+
+ public XAreaLink oObj = null;
+ CellRangeAddress oORAdd, oNRAdd, oCRAdd = null;
+
+ /**
+ * Just calls the method and checks the value returned.
+ * (More complicated testing done in <code>setDestArea</code>)<p>
+ * Has <b>OK</b> status if not null value returned.
+ */
+ public void _getDestArea(){
+ log.println("testing getDestArea()");
+ boolean bResult = false;
+ oORAdd = oObj.getDestArea();
+ if (!(oORAdd == null)){ bResult = true; }
+ tRes.tested("getDestArea()", bResult) ;
+ }
+
+ /**
+ * Just calls the method and checks the value returned.
+ * (More complicated testing done in <code>setSourceArea</code>)<p>
+ * Has <b>OK</b> status if not null value returned.
+ */
+ public void _getSourceArea(){
+ log.println("testing getSourceArea()");
+ boolean bResult = false;
+ String src = null;
+ src = oObj.getSourceArea() ;
+ if (!(src == null)){ bResult = true; }
+ tRes.tested("getSourceArea()", bResult) ;
+ }
+
+ /**
+ * Creates a new desination CellRange address and sets it for
+ * the link object. <p>
+ * After setting the DestArea, the link is refreshed and the area is
+ * adjusted to the size of the source data.
+ * Therefore EndCol and EndRow will change after setting. <p>
+ * Has <b>OK</b> status if Sheet, Starting Column and Row
+ * of the destination range is changed correctly.
+ */
+ public void _setDestArea(){
+ log.println("testing setDestArea()");
+ boolean bResult = false;
+ int newStartCol = 3, newStartRow = 4, newEndCol = 5, newEndRow = 8 ;
+ oORAdd = oObj.getDestArea();
+ log.print("Getting: ");
+ log.println(getCRA(oORAdd));
+ oNRAdd = new CellRangeAddress ((short) 2, newStartCol, newStartRow,
+ newEndCol, newEndRow) ;
+ oObj.setDestArea(oNRAdd) ;
+ log.print("Setting: ");
+ log.println(getCRA(oNRAdd));
+ oCRAdd = oObj.getDestArea();
+ log.print("Getting: ");
+ log.println(getCRA(oCRAdd));
+ // After setting the DestArea, the link is refreshed and the area is
+ // adjusted to the size of the source data.
+ // Therefore EndCol and EndRow will change after setting.
+ log.println("After setting the DestArea, the link is refreshed "+
+ "and the area is");
+ log.println("adjusted to the size of the source data.");
+ log.println("Therefore only 'Sheet', 'StartCol' and 'StartRow' "+
+ "are compared.");
+ if ((oCRAdd.StartColumn == oNRAdd.StartColumn) &&
+ (oCRAdd.Sheet == oNRAdd.Sheet) &&
+ (oCRAdd.StartRow == oNRAdd.StartRow)){
+ bResult = true;
+ oObj.setDestArea(oORAdd);
+ }
+ tRes.tested("setDestArea()", bResult) ;
+ }
+
+ /**
+ * Sets a new source area for the link and then check
+ * it using <code>getSourceArea</code> method. <p>
+ * Has <b>OK</b> status if areas set and get are equal.
+ */
+ public void _setSourceArea(){
+ log.println("testing setSourceArea()");
+ boolean bResult = false;
+ String oSrc = oObj.getSourceArea() ;
+ String nSrc = "a1:b2";
+ oObj.setSourceArea(nSrc);
+ String cSrc = oObj.getSourceArea();
+ if( nSrc.equals(cSrc)){
+ bResult = true;
+ oObj.setSourceArea(oSrc);
+ }
+ tRes.tested("setSourceArea()", bResult) ;
+ }
+
+ /**
+ * Prints cell range structure to LOG
+ */
+ public String getCRA ( CellRangeAddress oCRA ) {
+ String res = "( Sheet: ";
+ res += oCRA.Sheet;
+ res += ";StartColumn: ";
+ res += oCRA.StartColumn;
+ res += ";StartRow: ";
+ res += oCRA.StartRow;
+ res += ";EndColumn: ";
+ res += oCRA.EndColumn;
+ res += ";EndRow: ";
+ res += oCRA.EndRow;
+ res += " )";
+ return res;
+ }
+
+} // EOC _XAreaLink
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XAreaLinks.java b/qadevOOo/tests/java/ifc/sheet/_XAreaLinks.java
new file mode 100644
index 000000000000..9a212ab2ba70
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XAreaLinks.java
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAreaLinks.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XAreaLinks;
+import com.sun.star.table.CellAddress;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XAreaLinks</code>
+* interface methods :
+* <ul>
+* <li><code> insertAtPosition()</code></li>
+* <li><code> removeByIndex()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.sheet.XAreaLinks
+*/
+public class _XAreaLinks extends MultiMethodTest {
+
+ public XAreaLinks oObj = null;
+
+ /**
+ * Inserts a new link into collection. Checks number of links
+ * before and after method call. <p>
+ * Has <b>OK</b> status if after method call number of
+ * links increased by 1.
+ */
+ public void _insertAtPosition(){
+ boolean bResult = true ;
+ int cnt = 0;
+
+ cnt = oObj.getCount() ;
+ CellAddress addr = new CellAddress ((short) 1,2,3) ;
+ oObj.insertAtPosition (addr, "", "a2:b5", "", "") ;
+
+ if (bResult) {
+ int new_cnt = oObj.getCount() ;
+
+ if (cnt + 1 != new_cnt) {
+ bResult = false ;
+ log.println("Number of links before insertAtPosition() call was " + cnt +
+ ", after call is " + new_cnt) ;
+ }
+ }
+
+ tRes.tested("insertAtPosition()", bResult) ;
+ }
+
+
+ /**
+ * Removes a link from collection. Checks number of links
+ * before and after method call. <p>
+ * Has <b>OK</b> status if after method call number of
+ * links decreases by 1. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertAtPosition </code> : to have at least one link. </li>
+ * </ul>
+ */
+ public void _removeByIndex(){
+ requiredMethod("insertAtPosition()") ;
+
+ boolean bResult = true ;
+ int lcnt = 0;
+
+ lcnt = oObj.getCount() ;
+ oObj.removeByIndex(0) ;
+
+ int new_lcnt = oObj.getCount() ;
+ if (lcnt - 1 != new_lcnt) {
+ bResult = false ;
+ log.println(" # Number of links before removeByIndex() call was " +
+ lcnt + ", after call is " + new_lcnt) ;
+ }
+ tRes.tested("removeByIndex()", bResult) ;
+ }
+
+} //EOC _XAreaLinks
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XArrayFormulaRange.java b/qadevOOo/tests/java/ifc/sheet/_XArrayFormulaRange.java
new file mode 100644
index 000000000000..fd74e9e5f67b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XArrayFormulaRange.java
@@ -0,0 +1,210 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XArrayFormulaRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XArrayFormulaRange;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XArrayFormulaRange</code>
+* interface methods :
+* <ul>
+* <li><code> getArrayFormula()</code></li>
+* <li><code> setArrayFormula()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'SHEET'</code> (of type <code>XSpreadsheet</code>):
+* to check contents of spreadsheet </li>
+* <li> <code>'noArray'</code> (of type <code>Object</code>):
+* if the relation is null then given component doesn't really support
+* this interface </li>
+* <ul> <p>
+* Test object must implements interface <code>XCellRangeAddressable</code> also.
+* @see com.sun.star.sheet.XArrayFormulaRange
+* @see com.sun.star.sheet.XSpreadsheet
+* @see com.sun.star.sheet.XCellRangeAddressable
+*/
+public class _XArrayFormulaRange extends MultiMethodTest {
+
+ public XArrayFormulaRange oObj = null;
+ String formula = "=1 + 2 * 5";
+
+ /**
+ * Test calls the method and then checks content sof spreadsheet using
+ * object relation <code>'SHEET'</code>. <p>
+ * Has <b> OK </b> status if values in cells of spreadsheet are equal to 11
+ * or ArrayFormula not supported.<p>
+ */
+ public void _setArrayFormula() {
+ Object noArray = tEnv.getObjRelation("noArray");
+ if (noArray != null) {
+ log.println("Component " + noArray.toString() +
+ " doesn't really support this Interface");
+ log.println("It doesn't make sense to set an ArrayFormula over"
+ + " the whole sheet");
+ tRes.tested("setArrayFormula()", true);
+ return;
+ }
+
+ boolean result = true;
+ boolean loc_result = true;
+ double dresult = 11;
+
+ log.println("setArrayFormula() ...");
+ String old_formula = oObj.getArrayFormula();
+
+ oObj.setArrayFormula(formula);
+
+ log.println("checking that formula was set correctly...");
+ XCellRangeAddressable crAddr =
+ (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj);
+ CellRangeAddress addr = crAddr.getRangeAddress() ;
+ XSpreadsheet oSheet = (XSpreadsheet)tEnv.getObjRelation("SHEET");
+ if (oSheet == null) throw new StatusException(Status.failed
+ ("Relation 'SHEET' not found"));
+
+ XCell oCell = null;
+ double value;
+
+ for (int i = addr.StartColumn; i <= addr.EndColumn; i++)
+ for (int j = addr.StartRow; j <= addr.EndRow; j++) {
+ try {
+ oCell = oSheet.getCellByPosition(i, j);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ result = false;
+ break;
+ }
+
+ value = oCell.getValue();
+ result &= (value == dresult);
+ }
+
+ tRes.tested("setArrayFormula()", result) ;
+
+ } // end setArrayFormula()
+
+ /**
+ * Test calls the method and compare formula that set by method
+ * <code>setArrayFormula</code> with returned value ignoring spaces. <p>
+ *
+ * Has <b> OK </b> status if values are equal or
+ * ArrayFormula not supported. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setArrayFormula </code> : to set formula </li>
+ * </ul>
+ */
+ public void _getArrayFormula() {
+
+ Object noArray = tEnv.getObjRelation("noArray");
+ if (noArray != null) {
+ log.println("Component "+noArray.toString()+" doesn't really support this Interface");
+ log.println("It doesn't make sense to set an ArrayFormula over the whole sheet");
+ log.println("and therefore 'getArrayFormula()' won't work");
+ tRes.tested("getArrayFormula()",true);
+ return;
+ }
+
+ requiredMethod("setArrayFormula()");
+ boolean result = true;
+ log.println("Testing getArrayFormula() ...");
+ String gFormula = oObj.getArrayFormula() ;
+ result &= equalIgnoreSpaces("{" + formula + "}", gFormula);
+ if (!result)
+ log.println("Method returned : '" + oObj.getArrayFormula() + "'") ;
+ tRes.tested("getArrayFormula()", result) ;
+
+ } // end getArrayFormula()
+
+ /**
+ * Method compares two string ignoring spaces.
+ * @return <code>true</code> if the argument
+ * is not null and the Strings are equal,
+ * ignoring spaces; <code>false</code> otherwise.
+ */
+ private boolean equalIgnoreSpaces(String s1, String s2) {
+ int p1 = 0, p2 = 0 ;
+ s1 = s1.trim() ;
+ s2 = s2.trim() ;
+ while (p1 < s1.length() && p2 < s2.length()) {
+ while (s1.charAt(p1) == ' ') p1 ++ ;
+ while (s2.charAt(p2) == ' ') p2 ++ ;
+ if (s1.charAt(p1) != s2.charAt(p2)) return false ;
+ p1 ++ ;
+ p2 ++ ;
+ }
+
+ return p1 == s1.length() && p2 == s2.length() ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellAddressable.java b/qadevOOo/tests/java/ifc/sheet/_XCellAddressable.java
new file mode 100644
index 000000000000..7941f574acf1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XCellAddressable.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCellAddressable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XCellAddressable;
+import com.sun.star.table.CellAddress;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XCellAddressable</code>
+* interface methods :
+* <ul>
+* <li><code> getCellAddress()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XCellAddressable
+*/
+public class _XCellAddressable extends MultiMethodTest {
+
+ public XCellAddressable oObj = null;
+ CellAddress sAddr = null;
+
+ /**
+ * Test calls the method and checks returned value.
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getCellAddress(){
+ sAddr = oObj.getCellAddress() ;
+ tRes.tested("getCellAddress()", sAddr != null) ;
+ }
+
+
+} //EOC _XCellAddressable
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeAddressable.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeAddressable.java
new file mode 100644
index 000000000000..de3792937855
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeAddressable.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCellRangeAddressable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XCellRangeAddressable</code>
+* interface methods :
+* <ul>
+* <li><code> getRangeAddress()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XCellRangeAddressable
+*/
+public class _XCellRangeAddressable extends MultiMethodTest {
+
+ public XCellRangeAddressable oObj = null;
+
+ /**
+ * Test calls the method and checks returned value.
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getRangeAddress() {
+ CellRangeAddress oAddr = oObj.getRangeAddress();
+ tRes.tested("getRangeAddress()", oAddr != null);
+ }
+
+} // EOC _XCellRangeAddressable
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeData.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeData.java
new file mode 100644
index 000000000000..9519cac53f0a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeData.java
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCellRangeData.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XCellRangeData;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+public class _XCellRangeData extends MultiMethodTest {
+
+ public XCellRangeData oObj = null;
+
+ /**
+ * Test calls the method
+ * state is OK if the resulting Object array
+ * isn't empty
+ */
+ public void _getDataArray() {
+ Object[] CRData = oObj.getDataArray();
+ boolean bResult = (CRData.length > 0);
+ tRes.tested("getDataArray()", bResult);
+ }
+
+ /**
+ * Test creates an Array and calls the method
+ * with this Array as argument
+ * Then the method getDataArray is called
+ * and the resulting Array is compared with the
+ * one formerly set.
+ */
+ public void _setDataArray() {
+ Object[][] NewData = (Object[][]) tEnv.getObjRelation("NewData");
+ if (NewData != null) {
+ oObj.setDataArray(NewData);
+ } else {
+ NewData = new Object[2][];
+ NewData[0] = new Double[]{new Double(2.5),new Double(5)};
+ NewData[1] = new Double[]{new Double(4),new Double(9)};
+ oObj.setDataArray(NewData);
+ }
+ Object[][] CRData = oObj.getDataArray();
+ boolean res = ValueComparer.equalValue(CRData[0][0],NewData[0][0]);
+ res &= ValueComparer.equalValue(CRData[0][1],NewData[0][1]);
+ res &= ValueComparer.equalValue(CRData[1][0],NewData[1][0]);
+ res &= ValueComparer.equalValue(CRData[1][1],NewData[1][1]);
+ tRes.tested("setDataArray()", res);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeFormula.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeFormula.java
new file mode 100644
index 000000000000..39ae7ad8bd67
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeFormula.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCellRangeFormula.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XCellRangeFormula;
+
+public class _XCellRangeFormula extends lib.MultiMethodTest {
+
+ public XCellRangeFormula oObj = null;
+
+ public String[][] orgValue = null;
+
+ public void _getFormulaArray() {
+ Object noArray = tEnv.getObjRelation("noArray");
+ if (noArray != null) {
+ log.println("Component " + noArray.toString() +
+ " doesn't really support this Interface");
+ log.println("It doesn't make sense to get an FormulaArray from"
+ + " the whole sheet");
+ tRes.tested("getFormulaArray()", true);
+ return;
+ }
+ orgValue = oObj.getFormulaArray();
+ String[][] newValue = oObj.getFormulaArray();
+ newValue[0][0] = "inserted";
+ oObj.setFormulaArray(newValue);
+ boolean res = oObj.getFormulaArray()[0][0].equals(newValue[0][0]);
+ tRes.tested("getFormulaArray()",res);
+ }
+
+ public void _setFormulaArray() {
+ requiredMethod("getFormulaArray()");
+ Object noArray = tEnv.getObjRelation("noArray");
+ if (noArray != null) {
+ log.println("Component " + noArray.toString() +
+ " doesn't really support this Interface");
+ log.println("It doesn't make sense to set an FormulaArray over"
+ + " the whole sheet");
+ tRes.tested("setFormulaArray()", true);
+ return;
+ }
+ oObj.setFormulaArray(orgValue);
+ boolean res = oObj.getFormulaArray()[0][0].equals(orgValue[0][0]);
+ tRes.tested("setFormulaArray()",res);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java
new file mode 100644
index 000000000000..083a0fa49a0f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java
@@ -0,0 +1,279 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCellRangeMovement.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.CellDeleteMode;
+import com.sun.star.sheet.CellInsertMode;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XCellRangeMovement;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.table.XTableRows;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XCellRangeMovement</code>
+* interface methods :
+* <ul>
+* <li><code> insertCells()</code></li>
+* <li><code> removeRange()</code></li>
+* <li><code> moveRange()</code></li>
+* <li><code> copyRange()</code></li>
+* </ul> <p>
+* Test object must implements interfaces <code>XCellRangeAddressable</code>
+* and <code>XSpreadsheet</code> also. <p>
+* @see com.sun.star.sheet.XCellRangeMovement
+* @see com.sun.star.sheet.XSpreadsheet
+* @see com.sun.star.sheet.XCellRangeAddressable
+*/
+public class _XCellRangeMovement extends MultiMethodTest {
+
+ public XCellRangeMovement oObj = null;
+
+ /**
+ * Test sets specific values to cells in the range, copies this cell range
+ * to another position in document and checks cell's values in new position.<p>
+ * Has <b> OK </b> status if cell's values in source range are equal to
+ * cell's values in destination range and no exceptions were thrown. <p>
+ */
+ public void _copyRange(){
+ log.println("Prepare cells before test methods.");
+ XSpreadsheet oSheet = (XSpreadsheet)
+ UnoRuntime.queryInterface(XSpreadsheet.class, oObj);
+ try {
+ oSheet.getCellByPosition(1,1).setValue(100);
+ oSheet.getCellByPosition(1,2).setValue(200);
+ oSheet.getCellByPosition(2,1).setValue(300);
+ oSheet.getCellByPosition(2,2).setValue(400);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ tRes.tested("copyRange()", false);
+ }
+
+ XCellRangeAddressable oAddr =
+ (XCellRangeAddressable)
+ UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj);
+ short iSheet = oAddr.getRangeAddress().Sheet;
+ CellAddress sDest;
+ CellRangeAddress sSrc;
+
+ sSrc = new CellRangeAddress(iSheet, 1, 1, 2, 2);
+ sDest = new CellAddress(iSheet, 1, 10);
+ boolean result = true;
+ boolean loc_result = true;
+
+ oObj.copyRange(sDest, sSrc);
+ try {
+ loc_result = (oSheet.getCellByPosition(1, 10).getValue() == 100);
+ loc_result &= (oSheet.getCellByPosition(1, 11).getValue() == 200);
+ loc_result &= (oSheet.getCellByPosition(2, 10).getValue() == 300);
+ loc_result &= (oSheet.getCellByPosition(2, 11).getValue() == 400);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ tRes.tested("copyRange()", false);
+ }
+
+ result &= loc_result;
+ tRes.tested("copyRange()", result);
+ }
+
+ /**
+ * Test sets specific values to cells in the two contiguous rows, inserts
+ * new empty row between them and checks value in
+ * one cell of the inserted row. <p>
+ * Has <b> OK </b> status if value of cell in the inserted row is zero
+ * and no exceptions were thrown. <p>
+ */
+ public void _insertCells(){
+ boolean result = false;
+
+ XSpreadsheet oSheet = (XSpreadsheet)
+ UnoRuntime.queryInterface(XSpreadsheet.class, oObj);
+ XCellRangeAddressable oAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj);
+ short iSheet = oAddr.getRangeAddress().Sheet;
+ try {
+ oSheet.getCellByPosition(0,20).setValue(100);
+ oSheet.getCellByPosition(1,20).setValue(100);
+ oSheet.getCellByPosition(2,20).setValue(100);
+ oSheet.getCellByPosition(3,20).setValue(100);
+ oSheet.getCellByPosition(0,21).setValue(200);
+ oSheet.getCellByPosition(1,21).setValue(200);
+ oSheet.getCellByPosition(2,21).setValue(200);
+ oSheet.getCellByPosition(3,21).setValue(200);
+
+ // catch some sleight of hand threads
+ if (oSheet.getCellByPosition(1,21).getValue() == 200){
+ //log.println("Rows closed.");
+ }
+ else{
+ log.println("Cells were already inserted. "+
+ "Delete old cells now");
+ XColumnRowRange oColumnRowRange = (XColumnRowRange)
+ UnoRuntime.queryInterface(XColumnRowRange.class, oSheet);
+
+ XTableRows oRows = (XTableRows) oColumnRowRange.getRows();
+ oRows.removeByIndex(21,1);
+ }
+ CellRangeAddress sSrc = new CellRangeAddress(iSheet, 0, 21, 5, 21);
+ oObj.insertCells (sSrc, CellInsertMode.DOWN) ;
+
+ // check the result
+ double res = oSheet.getCellByPosition(1, 21).getValue();
+ if (res == 0.0) {
+ result = true;
+ }
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("insertCells()", result);
+ }
+
+ /**
+ * Test sets specific values to cells in the range, moves this cell range
+ * to another position in document and checks cell's values in new position.
+ * <p>Has <b>OK</b> status if sum of values in source range is equal to sum
+ * of values in destination range and no exceptions were thrown. <p>
+ */
+ public void _moveRange(){
+ boolean result = false;
+
+ XSpreadsheet oSheet = (XSpreadsheet)
+ UnoRuntime.queryInterface(XSpreadsheet.class, oObj);
+
+ XCellRangeAddressable oAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj);
+
+ short iSheet = oAddr.getRangeAddress().Sheet;
+ //prepare source range
+ try {
+ oSheet.getCellByPosition(4,0).setValue(111);
+ oSheet.getCellByPosition(4,1).setValue(222);
+
+ CellRangeAddress sSrc = new CellRangeAddress(iSheet, 4, 0, 4, 1);
+ CellAddress sDest = new CellAddress(iSheet, 4, 4);
+ oObj.moveRange(sDest, sSrc);
+
+ double cntA = 0;
+ double cntB = 0;
+ cntA = oSheet.getCellByPosition(4, 4).getValue();
+ cntB = oSheet.getCellByPosition(4, 5).getValue();
+ if (cntA + cntB == 333.0){ result = true; }
+ //clean up
+ oSheet.getCellByPosition(4,4).setValue(0);
+ oSheet.getCellByPosition(4,5).setValue(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("moveRange()", result);
+ }
+
+
+ /**
+ * Test sets specific values to cells in the range, deletes this cell range
+ * from document and checks values of cells in position
+ * of the deleted range.
+ * <p>Has <b>OK</b> status if sum of cell values in position of the deleted
+ * range is equal to zero and no exceptions were thrown. <p>
+ */
+ public void _removeRange(){
+ boolean result = false;
+
+ XSpreadsheet oSheet = (XSpreadsheet)
+ UnoRuntime.queryInterface(XSpreadsheet.class, oObj);
+ XCellRangeAddressable oAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj);
+ short iSheet = oAddr.getRangeAddress().Sheet;
+ try {
+ //prepare source range
+ oSheet.getCellByPosition(5, 0).setValue(333);
+ oSheet.getCellByPosition(5, 1).setValue(444);
+
+ CellRangeAddress sSrc = new CellRangeAddress(iSheet, 5, 0, 5, 1);
+ oObj.removeRange(sSrc, CellDeleteMode.UP);
+
+ double cntA = 0;
+ double cntB = 0;
+ cntA = oSheet.getCellByPosition(5, 0).getValue();
+ cntB = oSheet.getCellByPosition(5, 1).getValue();
+ if (cntA + cntB == 0.0){ result = true; }
+
+ //clean up
+ oSheet.getCellByPosition(5, 0).setValue(0);
+ oSheet.getCellByPosition(5, 1).setValue(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("removeRange()", result);
+ }
+
+} // EOC _XCellRangeMovement
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java
new file mode 100644
index 000000000000..046b3ef137d1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCellRangeReferrer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XCellRangeReferrer;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XCellRangeReferrer</code>
+* interface methods :
+* <ul>
+* <li><code> getReferredCells() </code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DATAAREA'</code> (of type <code>CellRangeAddress</code>):
+* to have cell range address </li>
+* <ul> <p>
+* @see com.sun.star.sheet.XCellRangeReferrer
+* @see com.sun.star.table.CellRangeAddress
+*/
+public class _XCellRangeReferrer extends MultiMethodTest {
+
+ public XCellRangeReferrer oObj = null;
+
+ /**
+ * Test calls the method and compares cell range address of returned cell range
+ * with cell range address gotten by relation <code>'DATAAREA'</code>. <p>
+ * Has <b> OK </b> status if all fields of cell range addresses are equal. <p>
+ */
+ public void _getReferredCells() {
+ boolean bResult = true;
+
+ CellRangeAddress oldCRA = (CellRangeAddress)
+ tEnv.getObjRelation("DATAAREA");
+ if (oldCRA == null) throw new StatusException(Status.failed
+ ("Relation 'DATAAREA' not found"));
+
+ XCellRange cr = oObj.getReferredCells();
+ log.println(cr.toString());
+
+ if (cr == null) {
+ log.println("getReferredCells returned NULL.");
+ tRes.tested("getReferredCells()", false);
+ return;
+ }
+
+ XCellRangeAddressable xCRA = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, cr);
+
+ CellRangeAddress objCRA = xCRA.getRangeAddress();
+
+ log.println("The named range was 'ANamedRange A1:B2'");
+ log.println("Expected CellRangeAddress: (" + oldCRA.Sheet +
+ "," + oldCRA.StartColumn + "," + oldCRA.StartRow + "," +
+ oldCRA.EndColumn + "," + objCRA.EndRow + ")");
+ log.println("CellRangeAddress gotten: (" + objCRA.Sheet + ","
+ + objCRA.StartColumn + "," + objCRA.StartRow + "," +
+ objCRA.EndColumn + "," + objCRA.EndRow + ")");
+
+ bResult &= objCRA.EndColumn == oldCRA.EndColumn;
+ bResult &= objCRA.EndRow == oldCRA.EndRow;
+ bResult &= objCRA.Sheet == oldCRA.Sheet;
+ bResult &= objCRA.StartColumn == oldCRA.StartColumn;
+ bResult &= objCRA.StartRow == oldCRA.StartRow;
+
+ tRes.tested("getReferredCells()", bResult);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XConsolidationDescriptor.java b/qadevOOo/tests/java/ifc/sheet/_XConsolidationDescriptor.java
new file mode 100644
index 000000000000..d4a36b0971ff
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XConsolidationDescriptor.java
@@ -0,0 +1,297 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XConsolidationDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.GeneralFunction;
+import com.sun.star.sheet.XConsolidationDescriptor;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.sheet.XConsolidationDescriptor</code>
+* interface methods :
+* <ul>
+* <li><code> getFunction()</code></li>
+* <li><code> setFunction()</code></li>
+* <li><code> getSources()</code></li>
+* <li><code> setSources()</code></li>
+* <li><code> getStartOutputPosition()</code></li>
+* <li><code> setStartOutputPosition()</code></li>
+* <li><code> getUseColumnHeaders()</code></li>
+* <li><code> setUseColumnHeaders()</code></li>
+* <li><code> getUseRowHeaders()</code></li>
+* <li><code> setUseRowHeaders()</code></li>
+* <li><code> getInsertLinks()</code></li>
+* <li><code> setInsertLinks()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XConsolidationDescriptor
+*/
+public class _XConsolidationDescriptor extends MultiMethodTest {
+
+ public XConsolidationDescriptor oObj = null;
+ public GeneralFunction aFunction = null;
+ public boolean insertLinks = false;
+ public boolean useColumnHeaders = false;
+ public boolean useRowHeaders = false;
+ public CellRangeAddress[] CRaddr = null;
+ public CellAddress addr = null;
+
+ /**
+ * Test calls the method, stores and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getFunction() {
+ aFunction = oObj.getFunction();
+ tRes.tested("getFunction()", aFunction != null );
+ }
+
+ /**
+ * Test calls the method and stores returned value. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _getInsertLinks() {
+ insertLinks = oObj.getInsertLinks();
+ tRes.tested("getInsertLinks()", true);
+ }
+
+ /**
+ * Test calls the method and stores returned value. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _getSources() {
+ CRaddr = oObj.getSources();
+ int wiev = CRaddr.length;
+ tRes.tested("getSources()", true);
+ }
+
+ /**
+ * Test calls the method and stores returned value. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _getStartOutputPosition() {
+ addr = oObj.getStartOutputPosition();
+ tRes.tested("getStartOutputPosition()", true);
+ }
+
+ /**
+ * Test calls the method and stores returned value. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _getUseColumnHeaders() {
+ useColumnHeaders = oObj.getUseColumnHeaders();
+ tRes.tested("getUseColumnHeaders()", true);
+ }
+
+ /**
+ * Test calls the method and stores returned value. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _getUseRowHeaders() {
+ useRowHeaders = oObj.getUseRowHeaders();
+ tRes.tested("getUseRowHeaders()", true);
+ }
+
+ /**
+ * Test sets the new current function, gets current function
+ * and compare function gotten by method <code>getFunction()</code> with
+ * function that was set. <p>
+ * Has <b> OK </b> status if the functions aren't equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFunction() </code> : to have current value of
+ * the function by which the ranges are consolidated </li>
+ * </ul>
+ */
+ public void _setFunction() {
+ requiredMethod("getFunction()");
+ GeneralFunction aFunction2 = null;
+ if (aFunction.equals(GeneralFunction.SUM)) {
+ aFunction2 = GeneralFunction.COUNT;
+ }
+ else {
+ aFunction2 = GeneralFunction.SUM;
+ }
+ oObj.setFunction(aFunction2);
+ aFunction2 = oObj.getFunction();
+ tRes.tested("setFunction()", !aFunction.equals(aFunction2));
+ }
+
+ /**
+ * Test sets property to value that negative to the current value
+ * and compares returned value with value that was set. <p>
+ * Has <b> OK </b> status if returned value isn't equal to value that was
+ * stored by method <code>getInsertLinks()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getInsertLinks() </code> : to have current value of
+ * this property </li>
+ * </ul>
+ */
+ public void _setInsertLinks() {
+ requiredMethod("getInsertLinks()");
+ oObj.setInsertLinks( !insertLinks );
+ boolean insertLinks2 = oObj.getInsertLinks();
+ tRes.tested("setInsertLinks()", insertLinks != insertLinks2);
+ }
+
+ /**
+ * Test sets new cell ranges and compares cell ranges gotten by method
+ * <code>getSources()</code> with the cell range that was set. <p>
+ * Has <b> OK </b> status if returned value isn't equal to value that was
+ * stored by method <code>getSources()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSources() </code> : to have the cell ranges which
+ * are consolidated </li>
+ * </ul>
+ */
+ public void _setSources() {
+ requiredMethod("getSources()");
+ oObj.setSources(newCRaddr(CRaddr));
+ CellRangeAddress[] CRaddr2 = oObj.getSources();
+ tRes.tested("setSources()",!ValueComparer.equalValue(CRaddr, CRaddr2));
+ }
+
+ /**
+ * Test sets new cell address for start output position and compares
+ * cell address gotten by method <code>getStartOutputPosition()</code>
+ * with the cell address that was set. <p>
+ * Has <b> OK </b> status if returned value isn't equal to value that was
+ * stored by method <code>getStartOutputPosition()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getStartOutputPosition() </code> : to have the cell address
+ * of start output position </li>
+ * </ul>
+ */
+ public void _setStartOutputPosition() {
+ requiredMethod("getStartOutputPosition()");
+ CellAddress addr2 = new CellAddress();
+ addr2.Column = addr.Column + 1;
+ addr2.Row = addr.Row + 1;
+ oObj.setStartOutputPosition(addr2);
+ tRes.tested("setStartOutputPosition()",
+ !ValueComparer.equalValue(addr, addr2));
+ }
+
+ /**
+ * Test sets property to value that negative to the current value
+ * and compares returned value with value that was set. <p>
+ * Has <b> OK </b> status if returned value isn't equal to value that was
+ * stored by method <code>getUseColumnHeaders()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getUseColumnHeaders() </code> : to have current value of
+ * this property </li>
+ * </ul>
+ */
+ public void _setUseColumnHeaders() {
+ requiredMethod("getUseColumnHeaders()");
+ oObj.setUseColumnHeaders( !useColumnHeaders );
+ boolean uCH = oObj.getUseColumnHeaders();
+ tRes.tested("setUseColumnHeaders()", useColumnHeaders != uCH);
+ }
+
+ /**
+ * Test sets property to value that negative to the current value
+ * and compares returned value with value that was set. <p>
+ * Has <b> OK </b> status if returned value isn't equal to value that was
+ * stored by method <code>getUseRowHeaders()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getUseRowHeaders() </code> : to have current value of
+ * this property </li>
+ * </ul>
+ */
+ public void _setUseRowHeaders() {
+ requiredMethod("getUseRowHeaders()");
+ oObj.setUseRowHeaders(!useRowHeaders);
+ boolean uRH = oObj.getUseRowHeaders();
+ tRes.tested("setUseRowHeaders()", useRowHeaders != uRH );
+ }
+
+ /**
+ * Constructs new cell range addresses using old cell range addresses.
+ * @param CRaddr old cell range addresses
+ * @return new cell range addresses
+ */
+ public CellRangeAddress[] newCRaddr(CellRangeAddress[] CRaddr) {
+
+ CellRangeAddress[] back = new CellRangeAddress[1];
+
+ CellRangeAddress cra1 = new CellRangeAddress();
+ cra1.EndColumn=5;
+ cra1.EndRow=5;
+ cra1.Sheet=(short)0;
+ cra1.StartColumn=1;
+ cra1.StartRow=1;
+ back[0]=cra1;
+
+ return back;
+ }
+
+
+} // finish class _XConsolidationDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XDDELink.java b/qadevOOo/tests/java/ifc/sheet/_XDDELink.java
new file mode 100644
index 000000000000..6bd9d41d9158
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XDDELink.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDDELink.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XDDELink;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XDDELink</code>
+* interface methods :
+* <ul>
+* <li><code> getApplication()</code></li>
+* <li><code> getTopic()</code></li>
+* <li><code> getItem()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'APPLICATION'</code> (of type <code>String</code>):
+* to have application name </li>
+* <li> <code>'ITEM'</code> (of type <code>String</code>):
+* to have DDE item </li>
+* <li> <code>'TOPIC'</code> (of type <code>String</code>):
+* to have DDE topic </li>
+* <ul> <p>
+* @see com.sun.star.sheet.XDDELink
+*/
+public class _XDDELink extends MultiMethodTest {
+ public XDDELink oObj = null;
+
+ /**
+ * Test calls the method and compares returned value to value obtained by
+ * relation <code>'APPLICATION'</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ */
+ public void _getApplication(){
+ log.println("testing getApplication()");
+ boolean bResult = false;
+
+ String oAppl = (String)tEnv.getObjRelation("APPLICATION");
+ if (oAppl == null) throw new StatusException(Status.failed
+ ("Relation 'APPLICATION' not found"));
+
+ bResult = oAppl.equals(oObj.getApplication());
+ tRes.tested("getApplication()", bResult) ;
+ }
+
+ /**
+ * Test calls the method and compares returned value to value obtained by
+ * relation <code>'ITEM'</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ */
+ public void _getItem(){
+ log.println("testing getItem()");
+ boolean bResult = false;
+ String sItem = oObj.getItem();
+
+ String oItem = (String)tEnv.getObjRelation("ITEM");
+ if (oItem == null) throw new StatusException(Status.failed
+ ("Relation 'ITEM' not found"));
+
+ bResult = oItem.equals(sItem);
+ tRes.tested("getItem()", bResult) ;
+ }
+
+ /**
+ * Test calls the method and compares returned value to value obtained by
+ * relation <code>'TOPIC'</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ */
+ public void _getTopic(){
+ log.println("testing getTopic()");
+ boolean bResult = false;
+ String sTopic = oObj.getTopic();
+
+ String oTopic = (String)tEnv.getObjRelation("TOPIC");
+ if (oTopic == null) throw new StatusException(Status.failed
+ ("Relation 'TOPIC' not found"));
+
+ bResult = oTopic.equals(sTopic);
+ tRes.tested("getTopic()", bResult) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java
new file mode 100644
index 000000000000..450689c126b2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java
@@ -0,0 +1,462 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataPilotDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.sheet.DataPilotFieldOrientation;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XDataPilotDescriptor</code>
+* interface methods :
+* <ul>
+* <li><code> getTag()</code></li>
+* <li><code> setTag()</code></li>
+* <li><code> getSourceRange()</code></li>
+* <li><code> setSourceRange()</code></li>
+* <li><code> getFilterDescriptor()</code></li>
+* <li><code> getDataPilotFields()</code></li>
+* <li><code> getColumnFields()</code></li>
+* <li><code> getRowFields()</code></li>
+* <li><code> getPageFields()</code></li>
+* <li><code> getDataFields()</code></li>
+* <li><code> getHiddenFields()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'FIELDSAMOUNT'</code> (of type <code>Integer</code>):
+* to have number of fields </li>
+* <ul> <p>
+* @see com.sun.star.sheet.XDataPilotDescriptor
+*/
+public class _XDataPilotDescriptor extends MultiMethodTest {
+
+ public XDataPilotDescriptor oObj = null;
+ CellRangeAddress CRA = new CellRangeAddress((short)1, 1, 1, 5, 5);
+ CellRangeAddress oldCRA = null ;
+ String sTag = new String ("XDataPilotDescriptor_Tag");
+ String fieldsNames[];
+ int fieldsAmount = 0;
+ int tEnvFieldsAmount = 0;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ protected void before() {
+ Integer amount = (Integer)tEnv.getObjRelation("FIELDSAMOUNT");
+ if (amount == null) throw new StatusException(Status.failed
+ ("Relation 'FIELDSAMOUNT' not found"));
+ tEnvFieldsAmount = amount.intValue();
+ }
+
+ /**
+ * Test calls the method and compares returned value with value that was set
+ * in method <code>setSourceRange()</code>. <p>
+ * Has <b> OK </b> status if all fields of cell range addresses are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setSourceRange() </code> : to have current source range </li>
+ * </ul>
+ */
+ public void _getSourceRange(){
+ requiredMethod("setSourceRange()");
+ boolean bResult = true;
+
+ CellRangeAddress objRA = oObj.getSourceRange();
+ bResult &= objRA.Sheet == CRA.Sheet;
+ bResult &= objRA.StartRow == CRA.StartRow;
+ bResult &= objRA.StartColumn == CRA.StartColumn;
+ bResult &= objRA.EndRow == CRA.EndRow;
+ bResult &= objRA.EndColumn == CRA.EndColumn;
+
+ tRes.tested("getSourceRange()", bResult);
+ }
+
+ /**
+ * Test gets the current source range, stores it and sets new source range.<p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getColumnFields() </code> </li>
+ * <li> <code> getRowFields() </code> </li>
+ * <li> <code> getDataFields() </code> </li>
+ * <li> <code> getHiddenFields() </code> </li>
+ * <li> <code> getPageFields() </code> </li>
+ * </ul>
+ */
+ public void _setSourceRange(){
+ executeMethod("getColumnFields()") ;
+ executeMethod("getRowFields()") ;
+ executeMethod("getDataFields()") ;
+ executeMethod("getHiddenFields()") ;
+ executeMethod("getPageFields()") ;
+
+ oldCRA = oObj.getSourceRange() ;
+ oObj.setSourceRange(CRA);
+
+ tRes.tested("setSourceRange()", true);
+ }
+
+ /**
+ * Test calls the method and checks returned value with value that was set
+ * by method <code>setTag()</code>. <p>
+ * Has <b> OK </b> status if returned value is equal to value that was set
+ * by method <code>setTag()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTag() </code> : to have current tag </li>
+ * </ul>
+ */
+ public void _getTag(){
+ requiredMethod("setTag()");
+ boolean bResult = true;
+
+ String objTag = oObj.getTag();
+ bResult &= objTag.equals(sTag);
+
+ tRes.tested("getTag()", bResult);
+ }
+
+ /**
+ * Test just calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setTag(){
+ oObj.setTag(sTag);
+ tRes.tested("setTag()", true);
+ }
+
+ /**
+ * Test calls the method , checks returned value, compares
+ * number of fields goten from returned value and obtained by object
+ * relation <code>'FIELDSAMOUNT'</code> and set property
+ * <code>Orientation</code> to one of DataPilotFieldOrientation values. <p>
+ * Has <b> OK </b> status if returned value isn't null, number of fields
+ * goten from returned value is less than number of fields obtained by relation
+ * and no exceptions were thrown. <p>
+ */
+ public void _getDataPilotFields(){
+ boolean bResult = true;
+ XIndexAccess IA = null;
+
+ IA = oObj.getDataPilotFields();
+ if (IA == null) {
+ log.println("Returned value is null.");
+ tRes.tested("getDataPilotFields()", false);
+ return;
+ } else {log.println("getDataPilotFields returned not Null value -- OK");}
+
+ fieldsAmount = IA.getCount();
+ if (fieldsAmount < tEnvFieldsAmount) {
+ log.println("Number of fields is less than number goten by relation.");
+ tRes.tested("getDataPilotFields()", false);
+ return;
+ } else {log.println("count of returned fields -- OK");}
+
+ fieldsNames = new String[tEnvFieldsAmount];
+ 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);
+ tRes.tested("getDataPilotFields()", false);
+ return;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ tRes.tested("getDataPilotFields()", false);
+ return;
+ }
+
+ XNamed named = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class, field);
+ String name = named.getName();
+
+ log.print("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);
+ tRes.tested("getDataPilotFields()", false);
+ return;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ tRes.tested("getDataPilotFields()", false);
+ return;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ tRes.tested("getDataPilotFields()", false);
+ return;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ tRes.tested("getDataPilotFields()", false);
+ return;
+ }
+ if (++cnt > 4) break;
+ } else {
+ tRes.tested("getDataPilotFields()", false);
+ return;
+ }
+ }
+
+ tRes.tested("getDataPilotFields()", bResult);
+ }
+
+ /**
+ * Test calls the method and checks returned collection using the method
+ * <code>CheckNames()</code>. <p>
+ * Has <b> OK </b> status if the method <code>CheckNames()</code> returns true
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public void _getColumnFields(){
+ requiredMethod("getDataPilotFields()");
+ XIndexAccess IA = oObj.getColumnFields();
+ boolean bResult = CheckNames(IA, 0);
+ tRes.tested("getColumnFields()", bResult);
+ }
+
+ /**
+ * Test calls the method and checks returned collection using the method
+ * <code>CheckNames()</code>. <p>
+ * Has <b> OK </b> status if the method <code>CheckNames()</code> returned true
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public void _getDataFields(){
+ requiredMethod("getDataPilotFields()");
+ XIndexAccess IA = oObj.getDataFields();
+ boolean bResult = CheckNames(IA, 2);
+ tRes.tested("getDataFields()", bResult);
+ }
+
+ /**
+ * Test calls the method and checks returned collection using the method
+ * <code>CheckNames()</code>. <p>
+ * Has <b> OK </b> status if the method <code>CheckNames()</code> returned true
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public void _getHiddenFields(){
+ requiredMethod("getDataPilotFields()");
+ XIndexAccess IA = oObj.getHiddenFields();
+ boolean bResult = CheckNames(IA, 3);
+ tRes.tested("getHiddenFields()", bResult);
+ }
+
+ /**
+ * Test calls the method and checks returned collection using the method
+ * <code>CheckNames()</code>. <p>
+ * Has <b> OK </b> status if the method <code>CheckNames()</code> returned true
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public void _getRowFields(){
+ requiredMethod("getDataPilotFields()");
+ XIndexAccess IA = oObj.getRowFields();
+ boolean bResult = CheckNames(IA, 1);
+ tRes.tested("getRowFields()", bResult);
+ }
+
+ /**
+ * setting of PageFields isn't supported by StarOffice Calc
+ * Has <b> OK </b> status if the returned IndexAccess
+ * isn't NULL. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public void _getPageFields(){
+ requiredMethod("getDataPilotFields()");
+ XIndexAccess IA = oObj.getPageFields();
+ boolean bResult = (IA != null);
+ // boolean bResult = CheckNames(IA, 4);
+ tRes.tested("getPageFields()", bResult);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null
+ * and no exceptions were thrown. <p>
+ */
+ public void _getFilterDescriptor(){
+ boolean bResult = oObj.getFilterDescriptor() != null;
+ tRes.tested("getFilterDescriptor()", bResult);
+ }
+
+ /**
+ * Method checks that the field with index <code>rem</code> exists
+ * in the array <code>IA</code>.
+ * @param IA collection of elements that support interface <code>XNamed</code>
+ * @param rem index of field in the array of field names that was stored in
+ * the method <code>getDataPilotFields()</code>
+ * @return true if required field name exists in passed collection;
+ * false otherwise
+ * @see com.sun.star.container.XNamed
+ */
+ boolean CheckNames(XIndexAccess IA, int rem) {
+ String name = null;
+
+ if (IA == null) {
+ log.println("Null retruned.") ;
+ return false ;
+ }
+
+ if (fieldsNames[rem] == null) {
+ log.println("No fields were set to this orientation - cann't check result") ;
+ return true ;
+ }
+
+ if (IA.getCount() == 0) {
+ log.println("No fields found. Must be at least '"
+ + fieldsNames[rem] + "'") ;
+ return false ;
+ }
+
+ try {
+ log.print("Fields returned ") ;
+ for (int i = 0; i < IA.getCount(); i++) {
+ Object field = IA.getByIndex(i);
+ XNamed named = (XNamed)UnoRuntime.queryInterface
+ (XNamed.class, field);
+ name = named.getName();
+ log.print(" " + name) ;
+ if (fieldsNames[rem].equals(name)) {
+ log.println(" - OK") ;
+ return true ;
+ }
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ return false ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log) ;
+ return false ;
+ }
+ log.println(" - FAILED (field " + fieldsNames[rem] + " was not found.") ;
+ return false ;
+ }
+
+ /**
+ * Recreates object(to back old orientations of the fields).
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable.java
new file mode 100644
index 000000000000..c0c0f0fc0916
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataPilotTable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XDataPilotTable;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XDataPilotTable</code>
+* interface methods :
+* <ul>
+* <li><code> getOutputRange()</code></li>
+* <li><code> refresh()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'OUTPUTRANGE'</code> (of type <code>CellAddress</code>):
+* to check value returned by method <code>getOutputRange()</code> </li>
+* <li> <code>'CELLFORCHANGE'</code> (of type <code>XCell</code>):
+* to check the method refresh(value of this cell will be changed)</li>
+* <li> <code>'CELLFORCHECK'</code> (of type <code>XCell</code>):
+* to check the method refresh (value of this cell must be changed after refresh
+* call) </li><ul> <p>
+* @see com.sun.star.sheet.XDataPilotTable
+* @see com.sun.star.table.CellAddress
+*/
+public class _XDataPilotTable extends MultiMethodTest {
+
+ public XDataPilotTable oObj = null;
+ XCell xCellForChange = null;
+ XCell xCellForCheck = null;
+ CellAddress OutputRange = null;
+
+ protected void before() {
+ xCellForChange = (XCell)tEnv.getObjRelation("CELLFORCHANGE");
+ xCellForCheck = (XCell)tEnv.getObjRelation("CELLFORCHECK");
+ OutputRange = (CellAddress)tEnv.getObjRelation("OUTPUTRANGE");
+ if (xCellForChange == null || OutputRange == null ||
+ xCellForCheck == null) {
+ throw new StatusException(Status.failed("Relation not found"));
+ }
+ }
+ /**
+ * Test calls the method and checks returned value using value obtained by
+ * object relation <code>'OUTPUTRANGE'</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ */
+ public void _getOutputRange(){
+ boolean bResult = true;
+ CellRangeAddress objRange = oObj.getOutputRange();
+ bResult &= OutputRange.Sheet == objRange.Sheet;
+ bResult &= OutputRange.Row == objRange.StartRow;
+ bResult &= OutputRange.Column == objRange.StartColumn;
+ tRes.tested("getOutputRange()", bResult);
+ }
+
+ /**
+ * Test sets new value of the cell obtained by object relation
+ * 'CELLFORCHANGE', and checks value of the cell obtained by object
+ * relation 'CELLFORCHECK'.<p>
+ * Has <b>OK</b> status if value of the cell obtained by object relation
+ * 'CELLFORCHECK' is changed. <p>
+ */
+ public void _refresh(){
+ xCellForChange.setValue(5);
+ double oldData = xCellForCheck.getValue();
+ oObj.refresh();
+ double newData = xCellForCheck.getValue();
+ log.println("Old data:" + oldData + "; new data:" + newData);
+
+ tRes.tested("refresh()", oldData != newData);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotTables.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTables.java
new file mode 100644
index 000000000000..b95abdd07cb6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTables.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataPilotTables.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.CellAddress;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XDataPilotTables</code>
+* interface methods :
+* <ul>
+* <li><code> createDataPilotDescriptor()</code></li>
+* <li><code> insertNewByName()</code></li>
+* <li><code> removeByName()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'SHEET'</code> (of type <code>XSpreadsheet</code>):
+* to have a spreadsheet document for document content checking</li>
+* <ul> <p>
+* @see com.sun.star.sheet.XDataPilotTables
+*/
+public class _XDataPilotTables extends MultiMethodTest {
+
+ public XDataPilotTables oObj = null;
+ XDataPilotDescriptor DPDscr = null;
+ String name = "XDataPilotTables";
+ CellAddress CA = new CellAddress((short)0, 9, 8);
+ XSpreadsheet oSheet = null;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ protected void before() {
+ oSheet = (XSpreadsheet)tEnv.getObjRelation("SHEET");
+ if (oSheet == null) throw new StatusException(Status.failed
+ ("Relation 'SHEET' not found"));
+ }
+
+ /**
+ * Test calls the method, stores returned value and checks returned value.
+ * <p>Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _createDataPilotDescriptor(){
+ DPDscr = oObj.createDataPilotDescriptor();
+ tRes.tested("createDataPilotDescriptor()", DPDscr != null);
+ }
+
+ /**
+ * Test calls the method inserting new table with new name and then calls
+ * the method inserting table with existent name. <p>
+ * Has <b> OK </b> status if the cell content where table was inserted is
+ * equal to 'Filter' after first call and exception was thrown during
+ * second call. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createDataPilotDescriptor() </code> : to have
+ * <code>XDataPilotDescriptor</code> created by this method</li>
+ * </ul>
+ */
+ public void _insertNewByName(){
+ requiredMethod("createDataPilotDescriptor()");
+ boolean bResult = true;
+ log.println("Inserting new Table \"" + name + "\"");
+ try {
+ oObj.insertNewByName(name, CA, DPDscr);
+ bResult &= oSheet.getCellByPosition
+ (CA.Column, CA.Row).getFormula().equals("Filter");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception occured! " + e);
+ bResult = false;
+ }
+
+ log.println(bResult ? "OK" : "FAILED");
+ log.println("Trying to insert element with existent name");
+
+ try {
+ oObj.insertNewByName(name,new CellAddress((short)0, 7, 7), DPDscr);
+ log.println("No exception! - FAILED");
+ bResult = false;
+ } catch (com.sun.star.uno.RuntimeException e) {
+ log.println("Expected exception - OK " + e);
+ }
+
+ log.println("Inserting new table " + (bResult ? "OK" : "FAILED"));
+ tRes.tested("insertNewByName()", bResult);
+ }
+
+ /**
+ * Test calls the method for existent table and for unexistent table. <p>
+ * Has <b> OK </b> status if the cell where table was removed from is empty
+ * after first call and exception was thrown during second call. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>insertNewByName()</code>: to have name of existent table</li>
+ * </ul>
+ */
+ public void _removeByName(){
+ requiredMethod("insertNewByName()");
+ boolean bResult = true;
+ log.println("Remove table with name " + name);
+ try {
+ oObj.removeByName(name);
+ bResult &= oSheet.getCellByPosition
+ (CA.Column, CA.Row).getFormula().equals("");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception occured ! " + e);
+ bResult = false;
+ }
+ log.println(bResult ? "OK" : "FAILED");
+ log.println("Removing unexistent element");
+ try {
+ oObj.removeByName(name);
+ log.println("No exception! - FAILED");
+ bResult = false;
+ } catch (com.sun.star.uno.RuntimeException e) {
+ log.println("Expected exception - OK " + e);
+ }
+
+ log.println("Removing a table " + (bResult ? "OK" : "FAILED"));
+ tRes.tested("removeByName()", bResult);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotTablesSupplier.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTablesSupplier.java
new file mode 100644
index 000000000000..98ce4f6649be
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTablesSupplier.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataPilotTablesSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XDataPilotTablesSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getDataPilotTables()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XDataPilotTablesSupplier
+*/
+public class _XDataPilotTablesSupplier extends MultiMethodTest {
+
+ public XDataPilotTablesSupplier oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null
+ * and no exceptions were thrown. <p>
+ */
+ public void _getDataPilotTables() {
+ XDataPilotTables DPTables = oObj.getDataPilotTables();
+ tRes.tested("getDataPilotTables()", DPTables != null);
+ }
+
+
+} // EOC _XDataPilotTablesSupplier
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XDatabaseRange.java b/qadevOOo/tests/java/ifc/sheet/_XDatabaseRange.java
new file mode 100644
index 000000000000..40bea5c45694
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XDatabaseRange.java
@@ -0,0 +1,277 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDatabaseRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.sheet.SubTotalColumn;
+import com.sun.star.sheet.XDatabaseRange;
+import com.sun.star.sheet.XSheetFilterDescriptor;
+import com.sun.star.sheet.XSubTotalDescriptor;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XDatabaseRange</code>
+* interface methods :
+* <ul>
+* <li><code> getDataArea()</code></li>
+* <li><code> setDataArea()</code></li>
+* <li><code> getSortDescriptor()</code></li>
+* <li><code> getFilterDescriptor()</code></li>
+* <li><code> getSubTotalDescriptor()</code></li>
+* <li><code> getImportDescriptor()</code></li>
+* <li><code> refresh()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DATAAREA'</code> (of type <code>CellRangeAddress</code>):
+* to have cell range address for test of method <code>getDataArea()</code></li>
+* <li> <code>'XCELLRANGE'</code> (of type <code>XCellRange</code>):
+* cell range of the spreadsheet with database range,
+* to get values of cell</li>
+* <ul> <p>
+* @see com.sun.star.sheet.XDatabaseRange
+* @see com.sun.star.table.CellRangeAddress
+*/
+public class _XDatabaseRange extends MultiMethodTest {
+
+ public XDatabaseRange oObj = null;
+ CellRangeAddress oldCRA = null;
+ XCellRange xCellRange = null;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ protected void before() {
+ oldCRA = (CellRangeAddress)tEnv.getObjRelation("DATAAREA");
+ if (oldCRA == null) {
+ throw new StatusException(Status.failed
+ ("Relation 'DATAAREA' not found"));
+ }
+ xCellRange = (XCellRange)tEnv.getObjRelation("XCELLRANGE");
+ if (xCellRange == null) {
+ throw new StatusException(Status.failed
+ ("Relation 'XCELLRANGE' not found"));
+ }
+ }
+
+ /**
+ * Test calls the method and compares returned cell range address with
+ * cell range address obtained by object relation <code>'DATAAREA'</code>.<p>
+ * Has <b> OK </b> status if all fields of cell range addresses are equal. <p>
+ */
+ public void _getDataArea() {
+ boolean bResult = true;
+ CellRangeAddress objCRA = oObj.getDataArea();
+ bResult &= objCRA.EndColumn == oldCRA.EndColumn;
+ bResult &= objCRA.EndRow == oldCRA.EndRow;
+ bResult &= objCRA.Sheet == oldCRA.Sheet;
+ bResult &= objCRA.StartColumn == oldCRA.StartColumn;
+ bResult &= objCRA.StartRow == oldCRA.StartRow;
+ tRes.tested("getDataArea()", bResult);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getFilterDescriptor() {
+ XSheetFilterDescriptor FD = oObj.getFilterDescriptor();
+ tRes.tested("getFilterDescriptor()", FD != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getImportDescriptor() {
+ PropertyValue[] pva = oObj.getImportDescriptor();
+ tRes.tested("getImportDescriptor()", pva != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getSortDescriptor() {
+ PropertyValue[] pva = oObj.getSortDescriptor();
+ tRes.tested("getSortDescriptor()", pva != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getSubTotalDescriptor() {
+ STD = oObj.getSubTotalDescriptor();
+ tRes.tested("getSubTotalDescriptor()", STD != null);
+ }
+
+ XSubTotalDescriptor STD = null;
+
+ /**
+ * Test adds new SubTotalDescriptor and checks value of cell with
+ * subtotal sum after refresh() call. <p>
+ * Has <b> OK </b> if value of cell with subtotal sum was changed
+ * after refresh() call.<p>
+ */
+ public void _refresh() {
+ requiredMethod("getSubTotalDescriptor()");
+ requiredMethod("setDataArea()");
+
+ for(int i = STARTROW; i < ENDROW; i++) {
+ try {
+ XCell cell = xCellRange.getCellByPosition(COL, i);
+ cell.setValue(i);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ tRes.tested("refresh()", false);
+ }
+ }
+
+ SubTotalColumn[] STC = new SubTotalColumn[1];
+ STC[0] = new SubTotalColumn();
+ STC[0].Column = COL;
+ STC[0].Function = com.sun.star.sheet.GeneralFunction.SUM;
+
+ double oldVal = 0;
+ try {
+ XCell checkCell = xCellRange.getCellByPosition(COL, ENDROW);
+ oldVal = checkCell.getValue();
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ tRes.tested("refresh()", false);
+ }
+ log.println("Value of the cell (" + COL + ", " + ENDROW +
+ ") : " + oldVal );
+
+ log.println("Set new SubTotal descriptor...");
+
+ STD.clear();
+ STD.addNew(STC, 1);
+
+ double valBeforeRefresh = 0;
+ try {
+ XCell checkCell = xCellRange.getCellByPosition(COL, ENDROW);
+ valBeforeRefresh = checkCell.getValue();
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ tRes.tested("refresh()", false);
+ }
+ log.println("Value of the cell (" + COL + ", " + ENDROW +
+ ") : " + valBeforeRefresh );
+
+ log.println("Now call refresh()...");
+ oObj.refresh();
+
+ double valAfterRefresh = 0;
+ try {
+ XCell checkCell = xCellRange.getCellByPosition(COL, ENDROW);
+ valAfterRefresh = checkCell.getValue();
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Unexpected exception");
+ e.printStackTrace(log);
+ tRes.tested("refresh()", false);
+ }
+ log.println("Value of the cell (" + COL + ", " + ENDROW +
+ ") : " + valAfterRefresh );
+
+ tRes.tested("refresh()", oldVal != valAfterRefresh &&
+ oldVal == valBeforeRefresh);
+ }
+
+ final short COL = 0;
+ final short STARTROW = 0;
+ final short ENDROW = 5;
+
+ /**
+ * Test creates new cell range address and calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setDataArea() {
+ executeMethod("getDataArea()");
+ CellRangeAddress newCRA = new CellRangeAddress();
+ newCRA.Sheet = oldCRA.Sheet;
+ newCRA.StartColumn = COL;
+ newCRA.EndColumn = COL;
+ newCRA.StartRow = STARTROW;
+ newCRA.EndRow = ENDROW;
+
+ oObj.setDataArea(newCRA);
+
+ tRes.tested("setDataArea()", true);
+ }
+
+ protected void after() {
+ disposeEnvironment();
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XDatabaseRanges.java b/qadevOOo/tests/java/ifc/sheet/_XDatabaseRanges.java
new file mode 100644
index 000000000000..6cad76719026
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XDatabaseRanges.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDatabaseRanges.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XDatabaseRanges;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XDatabaseRanges</code>
+* interface methods :
+* <ul>
+* <li><code> addNewByName()</code></li>
+* <li><code> removeByName()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XDatabaseRanges
+*/
+public class _XDatabaseRanges extends MultiMethodTest {
+
+ public XDatabaseRanges oObj = null;
+ CellRangeAddress CRA = null;
+ String name = null;
+
+ /**
+ * Test adds a new database range to the collection, checks that range with
+ * this name exist in collection and then tries to add range with the same
+ * name. <p>
+ * Has <b> OK </b> status if the added range exists in collection and
+ * exception was thrown when trying to add range with name that is same as name
+ * of existent range. <p>
+ */
+ public void _addNewByName() {
+ boolean bResult = true;
+ log.println("Trying to add range with proper name.");
+
+ CRA = new CellRangeAddress((short)0, 1, 2, 3, 4);
+ name = "_XDatabaseRanges_addNewByRange";
+
+ oObj.addNewByName(name, CRA);
+
+ bResult &= oObj.hasByName(name);
+
+ if (bResult) log.println("Ok");
+ log.println("Trying to add existing element.");
+
+ try {
+ oObj.addNewByName(name, CRA);
+ log.println("Exception expected... Test failed.");
+ bResult = false;
+ } catch(com.sun.star.uno.RuntimeException e) {
+ log.println("Exception occured while testing addNewByName() : " + e);
+ bResult = true;
+ }
+
+ tRes.tested("addNewByName()", bResult);
+ }
+
+ /**
+ * Test removes the database range with name that exist exactly and then
+ * tries to remove the range with name that doesn't exist exactly. <p>
+ * Has <b> OK </b> status if first range was succesfully removed and
+ * exception was thrown when trying to remove non-existent database range.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addNewByName() </code> : to have definitely existed database
+ * range </li>
+ * </ul>
+ */
+ public void _removeByName(){
+ boolean bResult = true;
+ requiredMethod("addNewByName()");
+
+ log.println("Remove inserted element.");
+
+ try {
+ oObj.removeByName(name);
+ bResult &= !oObj.hasByName(name);
+ } catch (com.sun.star.uno.RuntimeException e) {
+ log.println("Exception occured while testing removeByName() : " + e);
+ bResult = false;
+ }
+
+ log.println("OK.\nTrying to remove unexistant element.");
+
+ try {
+ oObj.removeByName(name);
+ log.println("Exception expected... - FAILED");
+ bResult = false;
+ } catch (com.sun.star.uno.RuntimeException e) {
+ log.println("Expected exception. - OK : " + e);
+ }
+ tRes.tested("removeByName()", bResult);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XFunctionDescriptions.java b/qadevOOo/tests/java/ifc/sheet/_XFunctionDescriptions.java
new file mode 100644
index 000000000000..bf2e3d1ff022
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XFunctionDescriptions.java
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFunctionDescriptions.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.sheet.XFunctionDescriptions;
+import java.util.Random;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XFunctionDescriptions</code>
+* interface methods :
+* <ul>
+* <li><code> getById()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XFunctionDescriptions
+*/
+public class _XFunctionDescriptions extends MultiMethodTest {
+
+ public XFunctionDescriptions oObj = null;
+
+ /**
+ * Test finds available id, calls method using this id, checks returned
+ * value and then tries to get description with wrong id. <p>
+ * Has <b>OK</b> status if returned value is equal to value obtained by the
+ * method <code>getByIndex()</code> in first call and exception
+ * <code>IllegalArgumentException</code> was thrown in second call.<p>
+ * @see com.sun.star.lang.IllegalArgumentException
+ */
+ public void _getById() {
+ boolean bResult = true;
+ // Finding available id...
+
+ int count = oObj.getCount();
+ if (count > 0) {
+ Random rnd = new Random();
+ int nr = rnd.nextInt(count);
+
+ PropertyValue[] PVals = null;
+ try {
+ PVals = (PropertyValue[])oObj.getByIndex(nr);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ tRes.tested("getById()", false);
+ return;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ tRes.tested("getById()", false);
+ return;
+ }
+
+ String FName = null;
+ Integer FId = null;
+
+ for (int i = 0; i < PVals.length; i++) {
+ if (PVals[i].Name.equals("Name"))
+ FName = (String)PVals[i].Value;
+ if (PVals[i].Name.equals("Id"))
+ FId = (Integer)PVals[i].Value;
+ }
+
+ log.println("The id of function '" + FName + "' is " + FId);
+
+ PropertyValue[] PVals2 = null;
+ try {
+ PVals2 = oObj.getById(FId.intValue());
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ tRes.tested("getById()", false);
+ return;
+ }
+
+ String objFName = null;
+ Integer objFId = null;
+ for (int i = 0; i < PVals2.length; i++) {
+ if (PVals2[i].Name.equals("Name"))
+ objFName = (String)PVals[i].Value;
+ if (PVals2[i].Name.equals("Id"))
+ objFId = (Integer)PVals[i].Value;
+ }
+
+ log.println("The id of returned function '" +
+ objFName + "' is " + objFId);
+
+ bResult &= FName.equals(objFName);
+ bResult &= FId.equals(objFId);
+ }
+
+ log.println("OK.");
+
+ try {
+ log.println("Now trying to get description with wrong id ... ");
+ oObj.getById(-1);
+ bResult = false;
+ log.println("Exception expected! - FAILED");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Expected exception " + e + " - OK!");
+ }
+
+ tRes.tested("getById()", bResult);
+ }
+} // finish class _XFunctionDescriptions
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XHeaderFooterContent.java b/qadevOOo/tests/java/ifc/sheet/_XHeaderFooterContent.java
new file mode 100644
index 000000000000..3e09f9deed4f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XHeaderFooterContent.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XHeaderFooterContent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XHeaderFooterContent;
+import com.sun.star.text.XText;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.sheet.XHeaderFooterContent</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getLeftText()</code></li>
+ * <li><code> getCenterText()</code></li>
+ * <li><code> getRightText()</code></li>
+ * </ul> <p>
+ *
+ * @see com.sun.star.sheet.XHeaderFooterContent
+ */
+public class _XHeaderFooterContent extends MultiMethodTest {
+
+ public XHeaderFooterContent oObj = null;
+
+ /**
+ * Test calls the method and checks string obtained from returned value. <p>
+ * Has <b>OK</b> status if obtained string is equal to <code>"LEFT"</code>.
+ * <p>
+ */
+ public void _getLeftText() {
+ XText left = oObj.getLeftText();
+ tRes.tested("getLeftText()",left.getString().equals("LEFT"));
+ }
+
+ /**
+ * Test calls the method and checks string obtained from returned value. <p>
+ * Has <b>OK</b> status if obtained string is equal to <code>"RIGHT"</code>.
+ * <p>
+ */
+ public void _getRightText() {
+ XText right = oObj.getRightText();
+ tRes.tested("getRightText()",right.getString().equals("RIGHT"));
+ }
+
+ /**
+ * Test calls the method and checks string obtained from returned value. <p>
+ * Has <b>OK</b> status if obtained string is equal to <code>"CENTER"</code>.
+ * <p>
+ */
+ public void _getCenterText() {
+ XText center = oObj.getCenterText();
+ tRes.tested("getCenterText()",center.getString().equals("CENTER"));
+ }
+
+} // finish class _XHeaderFooterContent
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XLabelRange.java b/qadevOOo/tests/java/ifc/sheet/_XLabelRange.java
new file mode 100644
index 000000000000..93f55a527fe2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XLabelRange.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLabelRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XLabelRange;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.sheet.XLabelRange</code>
+* interface methods :
+* <ul>
+* <li><code> getLabelArea()</code></li>
+* <li><code> setLabelArea()</code></li>
+* <li><code> getDataArea()</code></li>
+* <li><code> setDataArea()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XLabelRange
+*/
+public class _XLabelRange extends MultiMethodTest {
+
+ public XLabelRange oObj = null;
+ public CellRangeAddress setDAddress = null;
+ public CellRangeAddress setLAddress = null;
+
+ /**
+ * Test creates and stores <code>CellRangeAddress</code>, calls the method.
+ * <p>Has <b> OK </b> status if the method successfully returns. <p>
+ * @see com.sun.star.table.CellRangeAddress
+ */
+ public void _setDataArea() {
+ int nr = Thread.activeCount();
+ setDAddress = new CellRangeAddress((short)1, nr, 1, nr, 8);
+ oObj.setDataArea(setDAddress);
+ tRes.tested("setDataArea()", true);
+ }
+
+ /**
+ * Test creates and stores <code>CellRangeAddress</code>, calls the method.
+ * <p>Has <b> OK </b> status if the method successfully returns. <p>
+ * @see com.sun.star.table.CellRangeAddress
+ */
+ public void _setLabelArea() {
+ int nr = Thread.activeCount();
+ setLAddress = new CellRangeAddress((short)1, nr, 0, nr, 0);
+ oObj.setLabelArea(setLAddress);
+ tRes.tested("setLabelArea()", true);
+ }
+
+ /**
+ * Test calls the method and compares returned value with value that was set.
+ * <p>Has <b> OK </b> status if values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setDataArea() </code> : to have address of the cell range for
+ * which the labels are valid</li>
+ * </ul>
+ */
+ public void _getDataArea() {
+ requiredMethod("setDataArea()");
+ CellRangeAddress gA = oObj.getDataArea();
+ tRes.tested("getDataArea()", ValueComparer.equalValue(gA, setDAddress));
+ }
+
+ /**
+ * Test calls the method and compares returned value with value set before.
+ * <p>Has <b> OK </b> status if if values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setLabelArea() </code>: to have the cell range that contains
+ * the labels</li>
+ * </ul>
+ */
+ public void _getLabelArea() {
+ requiredMethod("setLabelArea()");
+ CellRangeAddress gA1 = oObj.getLabelArea();
+ tRes.tested("getLabelArea()",
+ ValueComparer.equalValue(gA1, setLAddress));
+ }
+} // finish class _XLabelRange
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XLabelRanges.java b/qadevOOo/tests/java/ifc/sheet/_XLabelRanges.java
new file mode 100644
index 000000000000..5604f57a8c0a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XLabelRanges.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLabelRanges.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XLabelRanges;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XLabelRanges</code>
+* interface methods :
+* <ul>
+* <li><code> addNew()</code></li>
+* <li><code> removeByIndex()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XLabelRanges
+*/
+public class _XLabelRanges extends MultiMethodTest {
+
+ public XLabelRanges oObj = null;
+
+ /**
+ * Test calls the method and compares number of label range before method
+ * call and after. <p>
+ * Has <b>OK</b> status if number of label range before method call is less
+ * than after and no exceptions were thrown. <p>
+ */
+ public void _addNew() {
+ int anz = oObj.getCount();
+ oObj.addNew(
+ new CellRangeAddress((short)0, 1, 0, 1, 0),
+ new CellRangeAddress((short)0, 1, 1, 1, 6) );
+ tRes.tested("addNew()", anz < oObj.getCount());
+ }
+
+ /**
+ * Test removes an existent label range first and tries to remove
+ * non-existent label range. <p>
+ * Has <b> OK </b> status if number of range decreased by one after first
+ * call and exception was thrown in second. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addNew() </code> : to have one label range at least </li>
+ * </ul>
+ */
+ public void _removeByIndex() {
+ requiredMethod("addNew()");
+ int anz = oObj.getCount();
+ log.println("First remove an existent LabelRange");
+
+ oObj.removeByIndex(anz - 1);
+ boolean result = (anz - 1 == oObj.getCount());
+
+ log.println("Remove a nonexistent LabelRange");
+ try {
+ oObj.removeByIndex(anz);
+ log.println("No Exception thrown while removing nonexisting "+
+ "LabelRange");
+ result &= false;
+ } catch (com.sun.star.uno.RuntimeException e) {
+ log.println("Expected exception thrown while removing "+
+ "nonexisting LabelRange: "+e);
+ result &= true;
+ }
+
+ tRes.tested("removeByIndex()", result);
+ }
+
+} // finish class _XLabelRanges
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XNamedRange.java b/qadevOOo/tests/java/ifc/sheet/_XNamedRange.java
new file mode 100644
index 000000000000..dd144ba9f517
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XNamedRange.java
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNamedRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.NamedRangeFlag;
+import com.sun.star.sheet.XNamedRange;
+import com.sun.star.table.CellAddress;
+import java.util.Random;
+import java.util.StringTokenizer;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XNamedRange</code>
+* interface methods :
+* <ul>
+* <li><code> getContent()</code></li>
+* <li><code> setContent()</code></li>
+* <li><code> getReferencePosition()</code></li>
+* <li><code> setReferencePosition()</code></li>
+* <li><code> getType()</code></li>
+* <li><code> setType()</code></li>
+* </ul> <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.sheet.XNamedRange
+*/
+public class _XNamedRange extends MultiMethodTest {
+
+ public XNamedRange oObj = null;
+ String sContent = "";
+ int type = 0;
+ CellAddress CA = null;
+
+ /**
+ * Test calls the method and compares returned value to value that was set
+ * by method <code>setContent()</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setContent() </code> : to have current content </li>
+ * </ul>
+ */
+ public void _getContent() {
+ requiredMethod("setContent()");
+ String content = oObj.getContent();
+ log.println("Returned content is \"" + content + "\"");
+ boolean bResult = content.equals(sContent);
+ tRes.tested("getContent()", bResult);
+ }
+
+ /**
+ * Test creates and stores random content and calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setContent() {
+ sContent = getRandomContent("A1;A4:C5;=B2");
+ log.println("Set content to \"" + sContent + "\"");
+ oObj.setContent(sContent);
+
+ tRes.tested("setContent()", true);
+ }
+
+ /**
+ * Test calls the method and compares returned value to value that was set
+ * by method <code>setType()</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setType() </code> : to have current type </li>
+ * </ul>
+ */
+ public void _getType() {
+ requiredMethod("setType()");
+
+ int rtype = oObj.getType();
+ log.println("Returned type is " + rtype);
+
+ tRes.tested("getType()", type == rtype);
+ }
+
+ /**
+ * Test sets random type and stores it. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setType() {
+ /*
+ * The type must be 0 or a combination of the NamedRangeFlag
+ * constants and controls if the named range is listed in
+ * dialogs prompting for special ranges
+ *
+ * NamedRangeFlag: COLUMN_HEADER
+ * FILTER_CRITERIA
+ * PRINT_AREA
+ * ROW_HEADER
+ *
+ */
+ boolean bResult = true;
+ int types[] = { 0,
+ NamedRangeFlag.COLUMN_HEADER,
+ NamedRangeFlag.FILTER_CRITERIA,
+ NamedRangeFlag.PRINT_AREA,
+ NamedRangeFlag.ROW_HEADER
+ };
+
+ Random rnd = new Random();
+ type = types[rnd.nextInt(5)];
+
+ oObj.setType(type);
+ log.println("The type was set to " + type);
+
+ tRes.tested("setType()", bResult);
+ }
+
+ /**
+ * Test calls the method and compares returned value to value that was set
+ * by method <code>setReferencePosition()</code>. <p>
+ * Has <b> OK </b> status if all fields of values are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setReferencePosition() </code> : to have current reference
+ * position </li>
+ * </ul>
+ */
+ public void _getReferencePosition() {
+ requiredMethod("setReferencePosition()");
+
+ CellAddress rCA = oObj.getReferencePosition();
+ log.println("getReferencePosition returned (" +
+ rCA.Sheet + ", " +
+ rCA.Column + ", " + rCA.Row + ")" );
+
+ boolean bResult = rCA.Sheet == CA.Sheet;
+ bResult &= rCA.Column == CA.Column;
+ bResult &= rCA.Row == CA.Row;
+
+ tRes.tested("getReferencePosition()", bResult);
+ }
+
+ /**
+ * Test creates and stores cell address and calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setReferencePosition() {
+ CA = new CellAddress((short)0, 2, 3);
+ oObj.setReferencePosition(CA);
+ log.println("ReferencePosition was set to (" +
+ CA.Sheet + ", " +
+ CA.Column + ", " + CA.Row + ")");
+
+ tRes.tested("setReferencePosition()", true);
+ }
+
+
+ /**
+ * Method make string of random content.
+ * @return string of random content
+ */
+ String getRandomContent(String str) {
+
+ String gRS = "none";
+ Random rnd = new Random();
+
+ StringTokenizer ST = new StringTokenizer(str, ";");
+ int nr = rnd.nextInt(ST.countTokens());
+ if (nr < 1) nr++;
+
+ for (int i = 1; i < nr + 1; i++)
+ gRS = ST.nextToken();
+
+ return gRS;
+
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java b/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java
new file mode 100644
index 000000000000..8cba36d6161c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java
@@ -0,0 +1,359 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNamedRanges.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.sheet.Border;
+import com.sun.star.sheet.NamedRangeFlag;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XCellRangeReferrer;
+import com.sun.star.sheet.XNamedRanges;
+import com.sun.star.sheet.XSpreadsheet;
+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.text.XTextRange;
+import com.sun.star.uno.UnoRuntime;
+import java.util.Random;
+import java.util.StringTokenizer;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XNamedRanges</code>
+* interface methods :
+* <ul>
+* <li><code> addNewByName()</code></li>
+* <li><code> addNewFromTitles()</code></li>
+* <li><code> removeByName()</code></li>
+* <li><code> outputList()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'SHEET'</code> (of type <code>XSpreadsheet</code>):
+* to have a spreadsheet </li>
+* <ul> <p>
+* @see com.sun.star.sheet.XNamedRanges
+* @see com.sun.star.sheet.XSpreadsheet
+*/
+public class _XNamedRanges extends MultiMethodTest {
+
+ public XNamedRanges oObj = null;
+ String name = "_XNamedRanges";
+ XSpreadsheet oSheet = null;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ protected void before() {
+ oSheet = (XSpreadsheet)tEnv.getObjRelation("SHEET");
+ if (oSheet == null) throw new StatusException(Status.failed
+ ("Relation 'SHEET' not found"));
+ }
+
+ /**
+ * Test creates and stores random content and random type, calls the method
+ * and checks that new range exists in collection using method
+ * <code>hasByName()</code>. <p>
+ * Has <b> OK </b> status if new range exists in collection
+ * and no exceptions were thrown. <p>
+ */
+ public void _addNewByName() {
+ boolean bResult = true;
+ CellAddress aPosition = new CellAddress((short)0, 2, 2);
+ int nType = getRandomType();
+ String sContent = getRandomContent("D3;A6:B9;=F12");
+ name += sContent;
+ log.println("Adding new range with name=\"" + name +
+ "\", sContent = \"" + sContent +
+ "\", aPosition = (" + aPosition.Sheet + ", "
+ + aPosition.Column + ", "
+ + aPosition.Row +
+ "), Type = " + nType + ".");
+
+ oObj.addNewByName(name, sContent, aPosition, nType);
+
+ //inserted for a bug
+ CellAddress listOutputPosition = new CellAddress((short)0, 1, 1);
+ oObj.outputList(listOutputPosition);
+ String s = null;
+ String s1 = null;
+ try {
+ s = oSheet.getCellByPosition(1, 1).getFormula();
+ s1 = oSheet.getCellByPosition(2, 1).getFormula();
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Can't get cell by position: " + e);
+ bResult = false;
+ }
+ log.println("Outputlist returns: " + s + " " + s1);
+ //end of insertion
+
+ bResult &= oObj.hasByName(name);
+
+ tRes.tested("addNewByName()", bResult);
+ }
+
+ /**
+ * Test creates a table with left and top titles, creates new ranges from
+ * top titles and left titles, checks all new title ranges. <p>
+ * Has <b> OK </b> status if all required title ranges are present
+ * in collection, if each of them have valid size and position and
+ * no exceptions were thrown. <p>
+ */
+ public void _addNewFromTitles() {
+ boolean bResult = true;
+
+ // First, create a small table.
+ log.println("Creating a small table.");
+ try {
+ XCell cell = null;
+ XTextRange textrange = null;
+
+ for (int i = 1; i < 4; i++) {
+ cell = oSheet.getCellByPosition(0, i);
+ textrange = (XTextRange)UnoRuntime.
+ queryInterface(XTextRange.class, cell);
+ textrange.setString("Row" + i);
+
+ cell = oSheet.getCellByPosition(i, 0);
+ textrange = (XTextRange)UnoRuntime.
+ queryInterface(XTextRange.class, cell);
+ textrange.setString("Column" + i);
+ }
+
+ for (int i = 1; i < 4; i++)
+ for (int j = 1; j < 4; j++) {
+ cell = oSheet.getCellByPosition(i, j);
+ textrange = (XTextRange)UnoRuntime.
+ queryInterface(XTextRange.class, cell);
+ textrange.setString("Val" + ((j - 1) * 3 + i));
+ }
+ log.println("Finished creating table.");
+ log.println("Creating new ranges from titles");
+
+ CellRangeAddress CRA = new CellRangeAddress((short)0, 0, 0, 3, 3);
+ Border border = Border.TOP;
+ oObj.addNewFromTitles(CRA, border);
+ for (int i = 1; i < 4; i++) {
+ bResult &= oObj.hasByName("Column" + i);
+
+ Object range = oObj.getByName("Column" + i);
+ XCellRangeReferrer CRR = (XCellRangeReferrer)UnoRuntime.
+ queryInterface(XCellRangeReferrer.class,range);
+
+ XCellRange CR = CRR.getReferredCells();
+ XCellRangeAddressable xCRA = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, CR);
+
+ CellRangeAddress objCRA = xCRA.getRangeAddress();
+
+ bResult &= (objCRA.EndColumn == i && objCRA.StartColumn == i);
+ bResult &= objCRA.StartRow == 1;
+ bResult &= objCRA.EndRow == 3;
+ bResult &= objCRA.Sheet == 0;
+ }
+
+ border = Border.LEFT;
+ oObj.addNewFromTitles(CRA, border);
+ for (int i = 1; i < 4; i++) {
+ bResult &= oObj.hasByName("Row" + i);
+
+ Object range = oObj.getByName("Row" + i);
+ XCellRangeReferrer CRR = (XCellRangeReferrer)UnoRuntime.
+ queryInterface(XCellRangeReferrer.class,range);
+
+ XCellRange CR = CRR.getReferredCells();
+ XCellRangeAddressable xCRA = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, CR);
+
+ CellRangeAddress objCRA = xCRA.getRangeAddress();
+
+ bResult &= (objCRA.EndRow == i && objCRA.StartRow == i);
+ bResult &= objCRA.StartColumn == 1;
+ bResult &= objCRA.EndColumn == 3;
+ bResult &= objCRA.Sheet == 0;
+ }
+
+ oObj.outputList(new CellAddress((short)0, 5, 5));
+
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ bResult = false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ bResult = false;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ bResult = false;
+ }
+
+ tRes.tested("addNewFromTitles()", bResult);
+ }
+
+ /**
+ * Test calls the method and checks existing of named ranges obtained
+ * by relation <code>'SHEET'</code>. <p>
+ * Has <b> OK </b> status if all output named ranges exist
+ * and no exceptions were thrown. <p>
+ */
+ public void _outputList() {
+ boolean bResult = true;
+ CellAddress CA = new CellAddress((short)0, 0, 0);
+
+ XIndexAccess IA = (XIndexAccess)UnoRuntime.
+ queryInterface(XIndexAccess.class, oObj);
+
+ int elementsCount = IA.getCount();
+
+ oObj.outputList(CA);
+
+ try {
+ for (int i = 0; i < elementsCount; i++) {
+ XCell cell = oSheet.getCellByPosition(0, i);
+ XTextRange textrange = (XTextRange)
+ UnoRuntime.queryInterface(XTextRange.class, cell);
+ String str = textrange.getString();
+ bResult &= oObj.hasByName(str);
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ bResult = false;
+ }
+
+ tRes.tested("outputList()", bResult);
+ }
+
+ /**
+ * Test calls the method for existing range, checks number of ranges in
+ * collection after method call, calls method for non-existent named range.
+ * <p>Has <b> OK </b> status if number of named ranges is less by one than
+ * before method call and exception was thrown during second call. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addNewByName() </code> : to have name of existent
+ * named range </li>
+ * </ul>
+ */
+ public void _removeByName() {
+ requiredMethod("addNewByName()");
+ boolean bResult = true;
+ XIndexAccess IA = (XIndexAccess)UnoRuntime.
+ queryInterface(XIndexAccess.class, oObj);
+
+ int elementsCount = IA.getCount();
+
+ // Removing existent element
+ oObj.removeByName(name);
+ bResult = elementsCount == IA.getCount() + 1;
+
+ try {
+ // Removing unexistent element.
+ oObj.removeByName(name);
+ log.println("Exception expected when removed unexistent element!");
+ bResult = false;
+ } catch (com.sun.star.uno.RuntimeException e) {
+ log.println("Expected exception occured while testing" +
+ "removeByName() when removed unexistent element.");
+
+ }
+
+ tRes.tested("removeByName()", bResult);
+ }
+
+ /**
+ * Method make string of random content.
+ * @return string of random content
+ */
+ String getRandomContent(String str) {
+ String gRS = "none";
+ Random rnd = new Random();
+
+ StringTokenizer ST = new StringTokenizer(str, ";");
+ int nr = rnd.nextInt(ST.countTokens());
+ if (nr < 1)
+ nr++;
+
+ for (int i=1; i < nr + 1; i++)
+ gRS = ST.nextToken();
+
+ return gRS;
+ }
+
+ /**
+ * Returns random value of named range flag.
+ */
+ int getRandomType(){
+ int types[] = { 0,
+ NamedRangeFlag.COLUMN_HEADER,
+ NamedRangeFlag.FILTER_CRITERIA,
+ NamedRangeFlag.PRINT_AREA,
+ NamedRangeFlag.ROW_HEADER
+ };
+
+ Random rnd = new Random();
+ return types[rnd.nextInt(5)];
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java b/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java
new file mode 100644
index 000000000000..1446a67d8035
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XRecentFunctions.java
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRecentFunctions.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sheet.XRecentFunctions;
+import java.util.Random;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XRecentFunctions</code>
+* interface methods :
+* <ul>
+* <li><code> getRecentFunctionIds()</code></li>
+* <li><code> setRecentFunctionIds()</code></li>
+* <li><code> getMaxRecentFunctions()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'FUNCTIONLIST'</code> (of type <code>XNameAccess</code>):
+* to have the set of available functions </li>
+* <ul> <p>
+* @see com.sun.star.sheet.XRecentFunctions
+*/
+public class _XRecentFunctions extends MultiMethodTest {
+
+ public XRecentFunctions oObj = null;
+ int iMaxNumber = 0;
+
+ /**
+ * Test calls the method, checks returned value and stores it. <p>
+ * Has <b> OK </b> status if returned value isn't equal to zero. <p>
+ */
+ public void _getMaxRecentFunctions() {
+ boolean bResult = true;
+
+ iMaxNumber = oObj.getMaxRecentFunctions();
+ log.println("Maximum recent functions : " + iMaxNumber);
+
+ tRes.tested("getMaxRecentFunctions()", iMaxNumber != 0);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null, if length of returned
+ * array is equal or less to the maximum number of functions and obtained
+ * array doesn't contain equal functions. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMaxRecentFunctions() </code> : to have the maximum number
+ * of recent functions </li>
+ * </ul>
+ */
+ public void _getRecentFunctionIds() {
+ requiredMethod("getMaxRecentFunctions()");
+
+ boolean bResult = true;
+ int[] IDs = null;
+ int iNumber = 0;
+
+ IDs = oObj.getRecentFunctionIds();
+ iNumber = IDs.length;
+ bResult &= (iNumber <= iMaxNumber);
+ log.println("Now there are " + iNumber + " recent functions");
+ bResult &= (IDs != null);
+ if (bResult) {
+ for (int i = 0; i < iNumber - 1; i++)
+ for (int j = i + 1; j < iNumber; j++) {
+ bResult &= (IDs[i] != IDs[j]);
+ }
+ }
+
+ tRes.tested("getRecentFunctionIds()", bResult);
+ }
+
+ /**
+ * Test gets the set of available functions, sets empty list of recent
+ * functions, sets list of maximum size. <p>
+ * Has <b> OK </b> status if length of recent function list is equal to zero
+ * after list was set to empty, if length of list is equal to maximum size
+ * after list was set to it's maximum size and no exception were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMaxRecentFunctions() </code> : to have the maximum number
+ * of recent functions </li>
+ * </ul>
+ */
+ public void _setRecentFunctionIds() {
+ requiredMethod("getMaxRecentFunctions()");
+
+ boolean bResult = true;
+ int[] IDs = new int[0];
+ int iNumber = 0;
+ XNameAccess functionList = null;
+
+ log.println("First, get the set of available functions.");
+ functionList = (XNameAccess)tEnv.getObjRelation("FUNCTIONLIST");
+ if (functionList == null) throw new StatusException(Status.failed
+ ("Relation 'FUNCTIONLIST' not found"));
+
+ log.println("Now trying to set empty list.");
+ oObj.setRecentFunctionIds(IDs);
+ bResult &= (oObj.getRecentFunctionIds().length == 0);
+
+ log.println("Now trying to set list of maximum size.");
+ String[] names = functionList.getElementNames();
+ Random rnd = new Random();
+
+ IDs = new int[iMaxNumber];
+ int startIdx = rnd.nextInt(names.length - iMaxNumber - 1) + 1;
+
+ try {
+ for (int i = startIdx; i < startIdx + iMaxNumber; i++) {
+ PropertyValue[] propVals = (PropertyValue[])
+ functionList.getByName(names[i]);
+ for (int j = 0; j < propVals.length; j++) {
+ String propName = (String)propVals[j].Name;
+ if (propName.equals("Id")) {
+ IDs[i - startIdx] =
+ ((Integer)propVals[j].Value).intValue();
+ break;
+ }
+ }
+ }
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ bResult = false;
+ } catch(com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ bResult = false;
+ }
+
+ oObj.setRecentFunctionIds(IDs);
+ bResult &= (oObj.getRecentFunctionIds().length == iMaxNumber);
+
+ tRes.tested("setRecentFunctionIds()", bResult);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XScenarios.java b/qadevOOo/tests/java/ifc/sheet/_XScenarios.java
new file mode 100644
index 000000000000..0e78dfa5d757
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XScenarios.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XScenarios.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XScenarios;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XScenarios</code>
+* interface methods :
+* <ul>
+* <li><code> addNewByName()</code></li>
+* <li><code> removeByName()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'ADDR'</code> (of type <code>CellRangeAddress[]</code>):
+* the array of cell range addresses for adding new scenario </li>
+* <ul> <p>
+* @see com.sun.star.sheet.XScenarios
+*/
+public class _XScenarios extends MultiMethodTest {
+
+ public XScenarios oObj = null;
+
+ /**
+ * Test adds new scenario, stores name of this scenario and checks that
+ * scenario with this name is present in collection. <p>
+ * Has <b> OK </b> status if the new scenario is present in collection. <p>
+ */
+ public void _addNewByName() {
+ CellRangeAddress[] oAddr = (CellRangeAddress[])
+ tEnv.getObjRelation("ADDR");
+ if (oAddr == null) throw new StatusException(Status.failed
+ ("Relation 'ADDR' not found"));
+
+ oObj.addNewByName("XScenarios", oAddr, "new");
+ tRes.tested("addNewByName()",oObj.hasByName("XScenarios"));
+ }
+
+ /**
+ * Test removes the scenario with stored name and checks that scenario
+ * with this name isn't present in collection. <p>
+ * Has <b> OK </b> status if the scenario with stored name isn't present in
+ * collection after it was removed. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addNewByName() </code> : to have name of the scenario </li>
+ * </ul>
+ */
+ public void _removeByName() {
+ requiredMethod("addNewByName()");
+ oObj.removeByName("XScenarios");
+ tRes.tested("removeByName()",!oObj.hasByName("XScenarios"));
+ }
+
+
+} // EOC _XScenarios
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XScenariosSupplier.java b/qadevOOo/tests/java/ifc/sheet/_XScenariosSupplier.java
new file mode 100644
index 000000000000..64639ed67f9e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XScenariosSupplier.java
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XScenariosSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XScenarios;
+import com.sun.star.sheet.XScenariosSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetAnnotationsSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getAnnotations()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetAnnotationsSupplier
+*/
+public class _XScenariosSupplier extends MultiMethodTest {
+ public XScenariosSupplier oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getScenarios(){
+ XScenarios oSc = oObj.getScenarios();
+ tRes.tested("getScenarios()", oSc != null);
+ }
+
+} // EOC _XScenariosSupplier
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java
new file mode 100644
index 000000000000..d1579b85e546
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetAnnotation.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSheetAnnotation;
+import com.sun.star.table.CellAddress;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetAnnotation</code>
+* interface methods :
+* <ul>
+* <li><code> getPosition()</code></li>
+* <li><code> getAuthor()</code></li>
+* <li><code> getDate()</code></li>
+* <li><code> getIsVisible()</code></li>
+* <li><code> setIsVisible()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CELLPOS'</code> (of type
+* <code>com.sun.star.table.CellAddress</code>):
+* The position of cell with annotation. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.sheet.XSheetAnnotation
+*/
+public class _XSheetAnnotation extends MultiMethodTest {
+
+ public XSheetAnnotation oObj = null;
+
+ /**
+ * Gets the author of annotation. <p>
+ * Has <b>OK</b> status if not null value returned.
+ */
+ public void _getAuthor() {
+ String author = oObj.getAuthor();
+ tRes.tested("getAuthor()", author != null);
+ }
+
+ /**
+ * Gets the modification date of annotation. <p>
+ * Has <b>OK</b> status if not null value returned.
+ */
+ public void _getDate() {
+ String date = oObj.getDate();
+ tRes.tested("getDate()", date != null);
+ }
+
+ /**
+ * Sets the string of annotation, then makes it visible and
+ * checks the value returned by <code>getIsVisible</code> method. <p>
+ * Has <b>OK</b> status if the method returns <code>true</code>.
+ */
+ public void _getIsVisible() {
+ XSimpleText oText = (XSimpleText)
+ UnoRuntime.queryInterface(XSimpleText.class, oObj);
+ oText.setString("XSheetAnnotation");
+ oObj.setIsVisible(true);
+ boolean bVis = oObj.getIsVisible();
+ tRes.tested("getIsVisible()", bVis);
+ }
+
+ /**
+ * Gets the position of annotated cell and compares it to
+ * the position passed as relation. <p>
+ * Has <b>OK</b> status if these positions are equal and not
+ * null.
+ */
+ public void _getPosition() {
+ boolean bResult = false;
+ CellAddress sCAddr = (CellAddress) tEnv.getObjRelation("CELLPOS") ;
+ if (sCAddr == null) throw new StatusException(Status.failed
+ ("Relation 'CELLPOS' not found"));
+
+ CellAddress oCAddr = oObj.getPosition();
+
+ bResult = (oCAddr != null) && (sCAddr != null) &&
+ ValueComparer.equalValue(oCAddr, sCAddr) ;
+
+ tRes.tested("getPosition()", bResult);
+ }
+
+ /**
+ * Sets the string of annotation, makes it hidden and then
+ * visible. Visibility is checked in both cases. <p>
+ * Has <b>OK</b> status if the <code>getIsVisible</code> method
+ * returns <code>flase</code> in the first case and <code>true</code>
+ * in the second.
+ */
+ public void _setIsVisible() {
+ boolean bResult = true;
+ XSimpleText oText = (XSimpleText)
+ UnoRuntime.queryInterface(XSimpleText.class, oObj);
+ oText.setString("XSheetAnnotation");
+ oObj.setIsVisible(false);
+ boolean bVis = oObj.getIsVisible();
+ if (!bVis) {
+ oObj.setIsVisible(true);
+ bVis = oObj.getIsVisible();
+ if (bVis) {
+ bResult = true;
+ }
+ }
+
+ tRes.tested("setIsVisible()", bResult);
+ }
+
+} // EOC _XSheetAnnotation
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor.java
new file mode 100644
index 000000000000..2d04908287a1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetAnnotationAnchor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.table.CellAddress;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.sheet.XSheetAnnotation;
+import com.sun.star.sheet.XSheetAnnotationAnchor;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetAnnotationAnchor</code>
+* interface methods :
+* <ul>
+* <li><code> getAnnotation()</code></li>
+* </ul>
+* @see com.sun.star.sheet.XSheetAnnotationAnchor
+*/
+public class _XSheetAnnotationAnchor extends MultiMethodTest {
+
+ public XSheetAnnotationAnchor oObj = null;
+ protected XSheetAnnotation anno = null;
+
+ public void _getAnnotation() {
+ anno = oObj.getAnnotation();
+ tRes.tested("getAnnotation()",checkAnnotation());
+ }
+
+ protected boolean checkAnnotation() {
+ boolean res = true;
+ res &= check_getAuthor();
+ res &= check_getDate();
+ res &= check_getIsVisible();
+ res &= check_getPosition();
+ res &= check_setIsVisible();
+ return res;
+ }
+
+ /**
+ * Gets the author of annotation. <p>
+ * Returns <b>true</b> if not null value returned.
+ */
+ protected boolean check_getAuthor() {
+ String author = anno.getAuthor();
+ return (author != null);
+ }
+
+ /**
+ * Gets the modification date of annotation. <p>
+ * Returns <b>true</b> if not null value returned.
+ */
+ protected boolean check_getDate() {
+ String date = anno.getDate();
+ return (date != null);
+ }
+
+ /**
+ * Sets the string of annotation, then makes it visible and
+ * checks the value returned by <code>getIsVisible</code> method. <p>
+ * Returns <b>true</b> if the method returns <code>true</code>.
+ */
+ protected boolean check_getIsVisible() {
+ XSimpleText oText = (XSimpleText)
+ UnoRuntime.queryInterface(XSimpleText.class, anno);
+ oText.setString("XSheetAnnotation");
+ anno.setIsVisible(true);
+ boolean bVis = anno.getIsVisible();
+ return bVis;
+ }
+
+ /**
+ * Gets the position of annotated cell
+ * Returns <b>true</b> if this position is not null.
+ */
+ protected boolean check_getPosition() {
+ boolean bResult = false;
+ CellAddress oCAddr = anno.getPosition();
+ return (oCAddr != null);
+ }
+
+ /**
+ * Sets the string of annotation, makes it hidden and then
+ * visible. Visibility is checked in both cases. <p>
+ * Returns <b>true</b> if the <code>getIsVisible</code> method
+ * returns <code>false</code> in the first case and <code>true</code>
+ * in the second.
+ */
+ protected boolean check_setIsVisible() {
+ boolean bResult = true;
+ XSimpleText oText = (XSimpleText)
+ UnoRuntime.queryInterface(XSimpleText.class, anno);
+ oText.setString("XSheetAnnotation");
+ anno.setIsVisible(false);
+ boolean bVis = anno.getIsVisible();
+ if (!bVis) {
+ anno.setIsVisible(true);
+ bVis = anno.getIsVisible();
+ if (bVis) {
+ bResult = true;
+ }
+ }
+
+ return bResult;
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotations.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotations.java
new file mode 100644
index 000000000000..8115afb6b6ff
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotations.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetAnnotations.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSheetAnnotations;
+import com.sun.star.table.CellAddress;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetAnnotations</code>
+* interface methods :
+* <ul>
+* <li><code> insertNew()</code></li>
+* <li><code> removeByIndex()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.sheet.XSheetAnnotations
+*/
+public class _XSheetAnnotations extends MultiMethodTest {
+
+ public XSheetAnnotations oObj = null;
+
+ /**
+ * Adds two new annotations into collection. <p>
+ * Has <b>OK</b> status if the number of elements in collection
+ * increased by 2 after method call.
+ */
+ public void _insertNew(){
+ boolean bResult = false;
+
+ int initialAmount = oObj.getCount();
+ String sAnno = oObj.toString();
+
+ oObj.insertNew(new CellAddress((short)1, 2, 5), sAnno + "1");
+ oObj.insertNew(new CellAddress((short)1, 1, 1), sAnno + "2");
+
+ bResult = (oObj.getCount() == 2 + initialAmount);
+ tRes.tested("insertNew()", bResult);
+ }
+
+ /**
+ * Removes one annotation from collection. <p>
+ * Has <b>OK</b> status if the number of elements in collection
+ * decreased after method call. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertNew </code> : to be sure at least two elements
+ * exist in the collection.</li>
+ * </ul>
+ */
+ public void _removeByIndex(){
+ requiredMethod("insertNew()");
+ int tmpCnt = oObj.getCount();
+
+ oObj.removeByIndex(1);
+ int newCnt = oObj.getCount();
+
+ tRes.tested("removeByIndex()", newCnt < tmpCnt);
+ }
+
+} // EOC _XSheetAnnotations
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationsSupplier.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationsSupplier.java
new file mode 100644
index 000000000000..ef752c36c24b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationsSupplier.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetAnnotationsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSheetAnnotations;
+import com.sun.star.sheet.XSheetAnnotationsSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetAnnotationsSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getAnnotations()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetAnnotationsSupplier
+*/
+public class _XSheetAnnotationsSupplier extends MultiMethodTest {
+
+ public XSheetAnnotationsSupplier oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getAnnotations(){
+ log.println("testing getAnnotations");
+ XSheetAnnotations oSheetAnno = oObj.getAnnotations();
+ tRes.tested("getAnnotations()", oSheetAnno != null );
+ }
+
+} // EOC _XSheetAnnotationsSupplier
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java b/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java
new file mode 100644
index 000000000000..89dd8f1b25d9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java
@@ -0,0 +1,436 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetCellCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.CellFlags;
+import com.sun.star.sheet.XArrayFormulaRange;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSheetCellCursor;
+import com.sun.star.sheet.XSheetOperation;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCellRange;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.XMergeable;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetCellCursor</code>
+* interface methods :
+* <ul>
+* <li><code> collapseToCurrentRegion()</code></li>
+* <li><code> collapseToCurrentArray()</code></li>
+* <li><code> collapseToMergedArea()</code></li>
+* <li><code> expandToEntireColumns()</code></li>
+* <li><code> expandToEntireRows()</code></li>
+* <li><code> collapseToSize()</code></li>
+* </ul> <p>
+* Component must also implement the following interfaces :
+* <ul>
+* <li> <code> com.sun.star.sheet.XCellRangeAddressable </code> :
+* to get range address </li>
+* <ul> <p>
+* Range of cursor must be of size 4 x 4. <p>
+* @see com.sun.star.sheet.XSheetCellCursor
+*/
+public class _XSheetCellCursor extends MultiMethodTest {
+
+ public XSheetCellCursor oObj = null;
+
+ /**
+ * Test creates the array formula, assigns this array to another array,
+ * collapses cursor into one cell, applies method, checks the size of the
+ * result range, erases array formula, checks that array formula has been
+ * cleared. <p>
+ * Has <b>OK</b> status if no exceptions were thrown, if size of the result
+ * range is equal to size of the range where the array formula was set and
+ * if array formula was successfully cleared. <p>
+ */
+ public void _collapseToCurrentArray() {
+ boolean bResult = false;
+
+ XCellRangeAddressable crAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj);
+ CellRangeAddress addr = crAddr.getRangeAddress() ;
+ int leftCol = addr.StartColumn ;
+ int topRow = addr.StartRow ;
+ int width = addr.EndColumn - addr.StartColumn + 1 ;
+ int height = addr.EndRow - addr.StartRow + 1 ;
+
+ log.println( "Object area is ((" + leftCol + "," + topRow + "),(" +
+ (leftCol + width - 1) + "," + (topRow + height - 1) + ")" );
+
+ XCellRange new_range = null;
+ try {
+ // first we need to create an array formula
+ new_range =
+ oObj.getCellRangeByPosition(0, 0, 0, height - 1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.print("Get cell range by position failed: ");
+ e.printStackTrace(log);
+ tRes.tested("collapseToCurrentArray()", false);
+ }
+
+ log.println("DB: Successfully new range created");
+ XArrayFormulaRange arrFormulaRange = (XArrayFormulaRange)
+ UnoRuntime.queryInterface (XArrayFormulaRange.class, new_range);
+ // write a simple formula (this array assigns another array)
+ arrFormulaRange.setArrayFormula("A1:A" + height) ;
+
+ // collapse cursor into one cell and then try to apply the method
+ oObj.collapseToSize (1, 1) ;
+ oObj.collapseToCurrentArray() ;
+
+ // check the size of result range
+ int cols = ( (XColumnRowRange)UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getColumns().getCount();
+ int rows = ( (XColumnRowRange)UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getRows().getCount();
+
+ if (cols == 1 && rows == height) {
+ bResult = true;
+ } else {
+ bResult = false;
+ log.println("The size of cell range must be 1x" + height +
+ ", but after method call it was " + cols + "x" + rows);
+ }
+
+ // erase array formula
+ arrFormulaRange.setArrayFormula("");
+
+ // check if array formula has been cleared with last statement
+ try {
+ // if array formula isn't cleared exception is thrown
+ new_range.getCellByPosition(0,0).setValue(111) ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ bResult = false ;
+ log.println(
+ "Array formula hasn't been cleared with setArrayFormula(\"\")");
+ XSheetOperation clearRange = (XSheetOperation)
+ UnoRuntime.queryInterface (XSheetOperation.class, new_range);
+ int allFlags =
+ CellFlags.ANNOTATION | CellFlags.DATETIME | CellFlags.EDITATTR;
+ allFlags = allFlags
+ | CellFlags.HARDATTR | CellFlags.OBJECTS | CellFlags.STRING;
+ allFlags = allFlags
+ | CellFlags.VALUE | CellFlags.FORMULA | CellFlags.STYLES;
+ clearRange.clearContents(allFlags) ;
+ }
+
+ tRes.tested("collapseToCurrentArray()", bResult );
+ }
+
+ /**
+ * Test clears contents of spreadsheet, collapses cursor to current range,
+ * checks size of cursor range, fills a cell that is close to
+ * cursor range, collapses cursor to current range, checks size of cursor
+ * range again and restores original size. <p>
+ * Has <b> OK </b> status if after clearing of content and collapsing cursor
+ * range size remains 4 x 4, if after filling of cell and collapsing cursor
+ * range extends by one in both dimensions and no exceptions were thrown.<p>
+ */
+ public void _collapseToCurrentRegion(){
+ boolean bResult = true;
+ int width = 4, height = 4;
+ int leftCol = -1, topRow = -1;
+
+ XSpreadsheet oSheet = oObj.getSpreadsheet();
+ ((XSheetOperation) UnoRuntime.queryInterface(
+ XSheetOperation.class, oSheet) ).clearContents(65535);
+ oObj.collapseToCurrentRegion();
+ int cols = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getColumns().getCount();
+ int rows = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getRows().getCount();
+
+ if (cols != width || rows != height) {
+ bResult = false ;
+ log.println("After collapseToCurrentRegion()"
+ + " call Region must have size " + width + "x" + height
+ + " but it is " + cols + "x" + rows);
+ }
+
+ // if previous test was successful try more complicated case
+ if (bResult) {
+ if (leftCol != -1 && topRow != -1) {
+ try {
+ oSheet.getCellByPosition(
+ leftCol + width, topRow + height).setValue(1);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.print("Can't get cell by position:");
+ e.printStackTrace(log);
+ bResult = false;
+ }
+
+ oObj.collapseToCurrentRegion() ;
+
+ // checking results
+ cols = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj)).getColumns().getCount();
+ rows = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj)).getRows().getCount();
+
+ if (cols == width + 1 && rows == height + 1) {
+ bResult &= true;
+ } else {
+ bResult = false;
+ log.println("After collapseToCurrentRegion() call [2]"
+ + " region must have size " + (width+1) + "x"
+ + (height + 1) + " but it is " + cols + "x" + rows );
+ }
+ }
+ }
+
+ tRes.tested("collapseToCurrentRegion()", bResult);
+
+ // restore original size
+ oObj.collapseToSize(width, height);
+ }
+
+ /**
+ * Test merges a cells of range that has a greater size, collapses cursor to
+ * merged area, checks size of cursor range and restores original size
+ * of cursor range. <p>
+ * Has <b> OK </b> status if after merging of cells and collapsing cursor
+ * range extends by one in both dimensions and no exceptions were thrown.<p>
+ */
+ public void _collapseToMergedArea(){
+ int width = 1, height = 1 ;
+ int leftCol = 0, topRow = 0 ;
+
+ boolean bResult = true ;
+
+ log.println("DB: Starting collapseToMergedArea() method test ...") ;
+ XSpreadsheet oSheet = oObj.getSpreadsheet() ;
+ log.println ("DB: got Spreadsheet.") ;
+
+ XCellRange newRange = null;
+ try {
+ newRange = oSheet.getCellRangeByPosition (
+ leftCol + width - 1, topRow + height - 1,
+ leftCol + width, topRow + height );
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Can't get cell range by position");
+ e.printStackTrace(log);
+ bResult = false;
+ }
+
+ XMergeable mergeRange = (XMergeable)
+ UnoRuntime.queryInterface (XMergeable.class, newRange);
+ if (mergeRange == null) {
+ log.println("DB: newRange doesn't implement XMergeable interface");
+ } else {
+ log.println("DB: XMergeable interface successfully queried.");
+ }
+
+ mergeRange.merge(true);
+ log.println("DB: Successfuly merged.") ;
+
+ oObj.collapseToMergedArea() ;
+ log.println("DB: Succesfully collapseToMergedArea() method called");
+
+ // unmerge area to restore SpreadSheet
+ mergeRange.merge(false);
+ log.println("DB: Successfully unmerged.") ;
+
+ // checking results
+ int cols = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getColumns().getCount();
+ int rows = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getRows().getCount();
+ log.println("DB: Column and row numbers succesfully get") ;
+
+ if (cols == width + 1 && rows == height + 3) {
+ bResult &= true;
+ } else {
+ bResult = false;
+ log.println(
+ "After collapseToMergedArea() call region must have size "
+ + (width + 1) + "x" + (height + 1) + " but it is " + cols
+ + "x" + rows );
+ }
+
+ tRes.tested("collapseToMergedArea()", bResult) ;
+
+ // restore original size
+ oObj.collapseToSize(width, height);
+ }
+
+ /**
+ * Test collapses cursor to the new size, checks size
+ * of cursor range and restores original size of cursor range. <p>
+ * Has <b> OK </b> status if after collapsing cursor
+ * range extends by three in both dimensions. <p>
+ */
+ public void _collapseToSize(){
+ boolean bResult = false;
+ int width = 1, height = 1;
+
+ // collapseToSize() method test
+ oObj.collapseToSize (width + 3, height + 3);
+
+ // checking results
+ int cols = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getColumns().getCount();
+ int rows = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getRows().getCount();
+
+ if (cols == width + 3 && rows == height + 3) {
+ bResult = true ;
+ } else {
+ bResult = false ;
+ log.println( "After collapseToSize() call region must have size "
+ + (width + 3) + "x" + (height + 3) + " but it is "
+ + cols + "x" +rows);
+ }
+
+ tRes.tested("collapseToSize()", bResult) ;
+
+ // restore original size
+ oObj.collapseToSize(width, height) ;
+ }
+
+ /**
+ * Test expands cursor to entire columns, checks size
+ * of cursor range and restores original size of cursor range. <p>
+ * Has <b> OK </b> status if after expanding cursor
+ * range extends to all rows in the columns (number of rows is greater than
+ * 32000 and number of columns remains the same). <p>
+ */
+ public void _expandToEntireColumns(){
+ boolean bResult = false;
+ int width = 1, height = 1 ;
+
+ // expandToEntireColumns() method test
+ oObj.expandToEntireColumns () ;
+
+ // checking results
+ int cols = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getColumns().getCount();
+ int rows = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getRows().getCount();
+
+ if (cols == width && rows >= 32000) {
+ bResult = true ;
+ } else {
+ bResult = false ;
+ log.println(
+ "After expandToEntireColumns() call region must have size "+
+ width + "x(>=32000) but it is " + cols + "x" + rows);
+ }
+
+ tRes.tested("expandToEntireColumns()", bResult) ;
+
+ // restore original size
+ oObj.collapseToSize(width, height) ;
+ }
+
+ /**
+ * Test expands cursor to entire rows, checks size
+ * of cursor range and restores original size of cursor range. <p>
+ * Has <b> OK </b> status if after expanding cursor
+ * range extends to all columns in the rows (number of columns is greater
+ * than 256 and number of rows remains the same). <p>
+ */
+ public void _expandToEntireRows(){
+ boolean bResult = false;
+ int width = 1, height = 1 ;
+
+ // expandToEntireRows() method test
+ oObj.expandToEntireRows () ;
+
+ // checking results
+ int cols = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getColumns().getCount();
+ int rows = ((XColumnRowRange)
+ UnoRuntime.queryInterface(
+ XColumnRowRange.class, oObj) ).getRows().getCount();
+
+ if (cols >= 256 && rows == height) {
+ bResult = true;
+ } else {
+ bResult = false ;
+ log.println("After expandToEntireRows() call region " +
+ "must have size (>=256)x" + height + " but it is " +
+ cols + "x" + rows );
+ }
+
+ tRes.tested("expandToEntireRows()", bResult) ;
+
+ // restore original size
+ oObj.collapseToSize(width, height) ;
+ }
+
+} // EOC _XSheetCellCursor
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetCellRange.java b/qadevOOo/tests/java/ifc/sheet/_XSheetCellRange.java
new file mode 100644
index 000000000000..cc961d3f9676
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetCellRange.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetCellRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSheetCellRange;
+import com.sun.star.sheet.XSpreadsheet;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetCellRange</code>
+* interface methods :
+* <ul>
+* <li><code> getSpreadsheet()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetCellRange
+*/
+public class _XSheetCellRange extends MultiMethodTest {
+
+ public XSheetCellRange oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getSpreadsheet(){
+ XSpreadsheet oSheet = oObj.getSpreadsheet();
+ tRes.tested("getSpreadsheet()", oSheet != null);
+ }
+
+} // EOC _XSheetCellRange
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetCellRangeContainer.java b/qadevOOo/tests/java/ifc/sheet/_XSheetCellRangeContainer.java
new file mode 100644
index 000000000000..661879b12a43
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetCellRangeContainer.java
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetCellRangeContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSheetCellRangeContainer;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetCellRangeContainer</code>
+* interface methods :
+* <ul>
+* <li><code> addRangeAddress() </code></li>
+* <li><code> removeRangeAddress() </code></li>
+* <li><code> addRangeAddresses() </code></li>
+* <li><code> removeRangeAddresses() </code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.sheet.XSheetCellRangeContainer
+*/
+public class _XSheetCellRangeContainer extends MultiMethodTest {
+ public XSheetCellRangeContainer oObj = null;
+ public CellRangeAddress[] rAddr = new CellRangeAddress[3];
+
+ /**
+ * After method called, the new array of structures 'CellRangeAddress'
+ * is created. Then container is cleared.
+ */
+ public void before() {
+ for ( short i=0; i<=2; i++ ) {
+ rAddr[i] = new CellRangeAddress();
+ rAddr[i].Sheet = i;
+ rAddr[i].StartColumn = i;
+ rAddr[i].StartRow = i;
+ rAddr[i].EndColumn = i + 3;
+ rAddr[i].EndRow = i + 3;
+ try {
+ oObj.removeRangeAddresses(oObj.getRangeAddresses());
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error: Cannot remove "+
+ "range addresses." ,e);
+ }
+ }
+ }
+
+ /**
+ * The method called. Then new value is added to Container.
+ * Next we try to obtain back added value and check it. <p>
+ *
+ * Has <b> OK </b> status if the range just added presents among
+ * all ranges in the container.
+ */
+ public void _addRangeAddress() {
+ boolean result = true;
+
+ log.println("Elements before adding: " + oObj.getCount());
+ oObj.addRangeAddress(rAddr[0], false);
+ log.println("Elements after adding: " + oObj.getCount());
+ CellRangeAddress[] addr = oObj.getRangeAddresses();
+ boolean exist = false ;
+ for (int i=0; i<=oObj.getCount()-1; i++) {
+ if ( addr[i].Sheet == rAddr[0].Sheet &&
+ addr[i].StartColumn == rAddr[0].StartColumn &&
+ addr[i].StartRow == rAddr[0].StartRow &&
+ addr[i].EndColumn == rAddr[0].EndColumn &&
+ addr[i].EndRow == rAddr[0].EndRow) {
+
+ exist = true;
+ }
+ }
+
+ result &= exist ;
+
+ tRes.tested("addRangeAddress()" ,result);
+ }
+
+ /**
+ * The method called. Then a value added before is removed.
+ * Next we check Container for existence of removed value. <p>
+ * Has <b> OK </b> status if the range just removed doesn't presents among
+ * all ranges in the container.
+ */
+ public void _removeRangeAddress() {
+ boolean result = true;
+
+ log.println("Elements before removing: " + oObj.getCount());
+ try {
+ oObj.removeRangeAddress(rAddr[0]);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+ log.println("Elements after removing: " + oObj.getCount());
+ CellRangeAddress[] addr = oObj.getRangeAddresses();
+ for (int i=0; i<=oObj.getCount()-1; i++) {
+ if ( (addr[i].Sheet == rAddr[0].Sheet) &&
+ (addr[i].StartColumn == rAddr[0].StartColumn) &&
+ (addr[i].StartRow == rAddr[0].StartRow) &&
+ (addr[i].EndColumn == rAddr[0].EndColumn) &&
+ (addr[i].EndRow == rAddr[0].EndRow) ) {
+ result = false;
+ }
+ }
+ tRes.tested("removeRangeAddress()" ,result);
+ }
+
+ /**
+ * The method called. Then new values are added to Container.
+ * Next we try to obtain back all added values and check it. <p>
+ *
+ * Has <b> OK </b> status if the count of ranges increases by
+ * number of added ranges - 1 (one of ranges already exists in the
+ * container). And if all of ranges added exist in the container.
+ */
+ public void _addRangeAddresses() {
+ executeMethod("addRangeAddress()");
+
+ boolean result = true;
+
+ int cntBefore = oObj.getCount();
+ log.println("Elements before adding: " + cntBefore);
+ oObj.addRangeAddresses(rAddr, false);
+ log.println("Elements after adding: " + oObj.getCount());
+ CellRangeAddress[] addr = oObj.getRangeAddresses();
+
+ result &= cntBefore + rAddr.length == oObj.getCount();
+
+ for (int j = 0; j < rAddr.length; j++) {
+ boolean exist = false ;
+ for (int i=0; i < oObj.getCount(); i++) {
+ if ( addr[i].Sheet == rAddr[j].Sheet &&
+ addr[i].StartColumn == rAddr[j].StartColumn &&
+ addr[i].StartRow == rAddr[j].StartRow &&
+ addr[i].EndColumn == rAddr[j].EndColumn &&
+ addr[i].EndRow == rAddr[j].EndRow ) {
+
+ exist = true;
+ break;
+ }
+ }
+ result &= exist;
+ }
+
+ tRes.tested("addRangeAddresses()" ,result);
+ }
+
+ /**
+ * All ranges are remover from contaier.
+ *
+ * Has <b> OK </b> status if there are no more ranges in the container.
+ */
+ public void _removeRangeAddresses() {
+ boolean result = false;
+ int cnt;
+
+ log.println("Elements before removing: " + oObj.getCount());
+ try {
+ oObj.removeRangeAddresses(oObj.getRangeAddresses());
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+ if ( (cnt = oObj.getCount()) == 0) {
+ result = true;
+ }
+ log.println("Elements after removing: " + cnt);
+ tRes.tested("removeRangeAddresses()" ,result);
+ }
+
+ /**
+ * Forces environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetCellRanges.java b/qadevOOo/tests/java/ifc/sheet/_XSheetCellRanges.java
new file mode 100644
index 000000000000..afa2462d506c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetCellRanges.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetCellRanges.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.container.XEnumeration;
+import com.sun.star.sheet.XSheetCellRanges;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetCellRanges</code>
+* interface methods :
+* <ul>
+* <li><code> getCells()</code></li>
+* <li><code> getRangeAddressesAsString()</code></li>
+* <li><code> getRangeAddresses()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetCellRanges
+*/
+public class _XSheetCellRanges extends MultiMethodTest{
+
+ public XSheetCellRanges oObj = null;
+
+ /**
+ * Test calls the method, creates enumeration of returned value
+ * and checks that the enumeration has elements. <p>
+ * Has <b> OK </b> status if gained enumeration has elements. <p>
+ */
+ public void _getCells() {
+ log.println("Testing getCells ...");
+
+ XEnumeration oEnum = oObj.getCells().createEnumeration();
+ boolean res = oEnum.hasMoreElements();
+ if (!res) {
+ log.println(
+ "The Enumeration gained via getCells() has no Elements");
+ }
+ tRes.tested("getCells()", res);
+ }
+
+ /**
+ * Test calls the method and checks length of returned array. <p>
+ * Has <b> OK </b> status if length of returned array is greater than 2.<p>
+ */
+ public void _getRangeAddresses() {
+ log.println("Testing getRangeAddresses ...");
+ CellRangeAddress[] oRanges = oObj.getRangeAddresses();
+ int howmuch = oRanges.length;
+ tRes.tested("getRangeAddresses()", (howmuch > 2) );
+ }
+
+ /**
+ * Test calls the method and checks returned string. <p>
+ * Has <b> OK </b> status if returned string starts from 'Sheet'.<p>
+ */
+ public void _getRangeAddressesAsString() {
+ log.println("Testing getRangeAddressesAsString ...");
+ String oRanges = oObj.getRangeAddressesAsString();
+ tRes.tested("getRangeAddressesAsString()",oRanges.indexOf("C1:D4")>0);
+ }
+
+} // finished class _XSheetCellRanges
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetCondition.java b/qadevOOo/tests/java/ifc/sheet/_XSheetCondition.java
new file mode 100644
index 000000000000..292d63b97730
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetCondition.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetCondition.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.ConditionOperator;
+import com.sun.star.sheet.XSheetCondition;
+import com.sun.star.table.CellAddress;
+import lib.MultiMethodTest;
+import util.ValueChanger;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetCondition</code>
+* interface methods :
+* <ul>
+* <li><code> getOperator()</code></li>
+* <li><code> setOperator()</code></li>
+* <li><code> getFormula1()</code></li>
+* <li><code> setFormula1()</code></li>
+* <li><code> getFormula2()</code></li>
+* <li><code> setFormula2()</code></li>
+* <li><code> getSourcePosition()</code></li>
+* <li><code> setSourcePosition()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetCondition
+*/
+public class _XSheetCondition extends MultiMethodTest {
+ public XSheetCondition oObj = null;
+ public String Formula1 = null;
+ public String Formula2 = null;
+ public ConditionOperator Operator = null;
+ public CellAddress SourcePosition = null;
+
+ /**
+ * Test calls the method, checks and stores returned value. <p>
+ * Has <b> OK </b> status if returned vakue isn't null. <p>
+ */
+ public void _getFormula1() {
+ Formula1 = oObj.getFormula1();
+ tRes.tested("getFormula1()", Formula1 != null);
+ }
+
+ /**
+ * Test calls the method, checks and stores returned value. <p>
+ * Has <b> OK </b> status if returned vakue isn't null. <p>
+ */
+ public void _getFormula2() {
+ Formula2 = oObj.getFormula2();
+ tRes.tested("getFormula2()", Formula2 != null);
+ }
+
+ /**
+ * Test calls the method, checks and stores returned value. <p>
+ * Has <b> OK </b> status if returned vakue isn't null. <p>
+ */
+ public void _getOperator() {
+ Operator = oObj.getOperator();
+ tRes.tested("getOperator()", Operator != null);
+ }
+
+ /**
+ * Test calls the method, checks and stores returned value. <p>
+ * Has <b> OK </b> status if returned vakue isn't null. <p>
+ */
+ public void _getSourcePosition() {
+ SourcePosition = oObj.getSourcePosition();
+ tRes.tested("getSourcePosition()", SourcePosition != null);
+ }
+
+ /**
+ * Test sets new value of formula1, gets formula1 again and compares
+ * returned value with value that was stored by method
+ * <code>getFormula1()</code>. <p>
+ * Has <b> OK </b> status if values aren't equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFormula1() </code> : to have value of 'Formula1' </li>
+ * </ul>
+ */
+ public void _setFormula1() {
+ requiredMethod("getFormula1()");
+ oObj.setFormula1("$Sheet1.$C$" + Thread.activeCount());
+ tRes.tested("setFormula1()", !Formula1.equals( oObj.getFormula1() ) );
+ }
+
+ /**
+ * Test sets new value of formula2, gets formula2 again and compares
+ * returned value with value that was stored by method
+ * <code>getFormula2()</code>. <p>
+ * Has <b> OK </b> status if values aren't equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFormula2() </code> : to have value of 'Formula2' </li>
+ * </ul>
+ */
+ public void _setFormula2() {
+ requiredMethod("getFormula2()");
+ oObj.setFormula2("$Sheet1.$A$" + Thread.activeCount());
+ tRes.tested("setFormula2()", !Formula2.equals( oObj.getFormula2() ) );
+ }
+
+ /**
+ * Test sets new value of operator, gets operator and compares
+ * returned value with value that was set. <p>
+ * Has <b> OK </b> status if values aren't equal. <p>
+ */
+ public void _setOperator() {
+ oObj.setOperator(ConditionOperator.BETWEEN);
+ tRes.tested("setOperator()", !Operator.equals( oObj.getOperator() ) );
+ }
+
+ /**
+ * Test change value that was stored by method
+ * <code>getSourcePosition()</code>, sets this new value, gets source
+ * position again and compares returned value with value that was set. <p>
+ * Has <b> OK </b> status if values aren't equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSourcePosition() </code> : to have value of source
+ * position </li>
+ * </ul>
+ */
+ public void _setSourcePosition() {
+ requiredMethod("getSourcePosition()");
+ oObj.setSourcePosition(
+ (CellAddress)ValueChanger.changePValue(SourcePosition));
+ tRes.tested(
+ "setSourcePosition()",
+ !SourcePosition.equals( oObj.getSourcePosition() ) );
+ }
+
+} // finish class _XSheetCondition
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetConditionalEntries.java b/qadevOOo/tests/java/ifc/sheet/_XSheetConditionalEntries.java
new file mode 100644
index 000000000000..608481f93324
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetConditionalEntries.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetConditionalEntries.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.sheet.ConditionOperator;
+import com.sun.star.sheet.XSheetConditionalEntries;
+import com.sun.star.table.CellAddress;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetConditionalEntries</code>
+* interface methods :
+* <ul>
+* <li><code> addNew()</code></li>
+* <li><code> removeByIndex()</code></li>
+* <li><code> clear()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetConditionalEntries
+*/
+public class _XSheetConditionalEntries extends MultiMethodTest {
+ public XSheetConditionalEntries oObj = null;
+ int nNum = 0;
+
+ /**
+ * Test adds a conditional entry to the format. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _addNew() {
+ nNum = oObj.getCount();
+ oObj.addNew( Conditions(4) );
+ boolean res = (nNum + 1) == oObj.getCount();
+
+ tRes.tested("addNew()", res);
+ }
+
+ /**
+ * Test calls the method and checks number of conditional entries in
+ * collection. <p>
+ * Has <b> OK </b> status if number of conditional entries in co0llection
+ * after method call is equal zero. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addNew() </code> : to have one conditional entry in
+ * collection at least </li>
+ * </ul>
+ */
+ public void _clear() {
+ requiredMethod("removeByIndex()");
+ oObj.clear();
+ int anz = oObj.getCount();
+ tRes.tested("clear()", anz == 0);
+ }
+
+ /**
+ * Test adds a conditional entry, removes entry with index 0
+ * and compares number of entries after adding to number of entries after
+ * removing. <p>
+ * Has <b> OK </b> status if number of entries after adding is greater
+ * than number of entries after removing. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> clear() </code> : to be sure that collection hasn't
+ * elements </li>
+ * </ul>
+ */
+ public void _removeByIndex() {
+ requiredMethod("addNew()");
+ oObj.removeByIndex(0);
+ int pastNum = oObj.getCount();
+ tRes.tested("removeByIndex()", pastNum == nNum);
+ }
+
+ /**
+ * Method creates array of property value for conditional entry using
+ * passed parameter <code>nr</code>.
+ * @param nr number of row for conditional entry
+ */
+ protected 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;
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ protected void after() {
+ tEnv.dispose();
+ }
+} // finish class _XSheetConditionalEntries
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetConditionalEntry.java b/qadevOOo/tests/java/ifc/sheet/_XSheetConditionalEntry.java
new file mode 100644
index 000000000000..99cc51a135b0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetConditionalEntry.java
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetConditionalEntry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSheetConditionalEntry;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetConditionalEntry</code>
+* interface methods :
+* <ul>
+* <li><code> getStyleName()</code></li>
+* <li><code> setStyleName()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetConditionalEntry
+*/
+public class _XSheetConditionalEntry extends MultiMethodTest {
+
+ public XSheetConditionalEntry oObj = null;
+ public String StyleName = null;
+
+ /**
+ * Test calls the method, stores and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getStyleName() {
+ StyleName = oObj.getStyleName();
+ tRes.tested("getStyleName()", StyleName != null);
+ }
+
+ /**
+ * Test sets new value of style name, gets current style name and compares
+ * returned value with value that was stored by method <code>getStyleName()
+ * </code>. <p>
+ * Has <b> OK </b> status if values aren't equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getStyleName() </code> : to have current style name </li>
+ * </ul>
+ */
+ public void _setStyleName() {
+ requiredMethod("getStyleName()");
+ oObj.setStyleName("Heading");
+ tRes.tested("setStyleName()", !StyleName.equals(oObj.getStyleName()));
+ }
+
+} // finish class _XSheetConditionalEntry
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetFilterDescriptor.java b/qadevOOo/tests/java/ifc/sheet/_XSheetFilterDescriptor.java
new file mode 100644
index 000000000000..8f4444253313
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetFilterDescriptor.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetFilterDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.TableFilterField;
+import com.sun.star.sheet.XSheetFilterDescriptor;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetFilterDescriptor</code>
+* interface methods :
+* <ul>
+* <li><code> getFilterFields()</code></li>
+* <li><code> setFilterFields()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetFilterDescriptor
+*/
+public class _XSheetFilterDescriptor extends MultiMethodTest {
+
+ public XSheetFilterDescriptor oObj = null;
+ public TableFilterField[] TFF = null;
+
+ /**
+ * Test calls the method, stores and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getFilterFields(){
+ TFF = oObj.getFilterFields();
+ tRes.tested("getFilterFields()", TFF != null );
+ }
+
+ /**
+ * Test sets new value of the definitions of the filter fields,
+ * gets the current definitions of the filter fields and compares
+ * returned value with value that was stored by method
+ * <code>getFilterFields()</code>. <p>
+ * Has <b> OK </b> status if values aren't equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getFilterFields() </code> : to have the current definitions
+ * of the filter fields </li>
+ * </ul>
+ */
+ public void _setFilterFields() {
+ requiredMethod("getFilterFields()");
+ TableFilterField[] newTFF = new TableFilterField[1];
+ newTFF[0] = new TableFilterField();
+ oObj.setFilterFields(newTFF);
+ newTFF = oObj.getFilterFields();
+ tRes.tested("setFilterFields()", ! ValueComparer.equalValue(TFF, newTFF));
+ }
+
+} // finish class _XSheetFilterDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetOperation.java b/qadevOOo/tests/java/ifc/sheet/_XSheetOperation.java
new file mode 100644
index 000000000000..f84c9222b581
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetOperation.java
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetOperation.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.CellFlags;
+import com.sun.star.sheet.GeneralFunction;
+import com.sun.star.sheet.XSheetOperation;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetOperation</code>
+* interface methods :
+* <ul>
+* <li><code> computeFunction()</code></li>
+* <li><code> clearContents()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetOperation
+*/
+public class _XSheetOperation extends MultiMethodTest {
+
+ public XSheetOperation oObj = null;
+
+ /**
+ * Test clears formula and value contents, calls the method
+ * <code>computeFunction</code> and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is equal to zero
+ * and no exceptions were thrown. <p>
+ */
+ public void _clearContents() {
+ boolean result = true;
+ double resultVal = -1;
+
+ log.println("Testing clearContents() ...");
+
+ int allFlags;
+ allFlags = CellFlags.VALUE | CellFlags.FORMULA;
+
+ oObj.clearContents (allFlags) ;
+
+ try {
+ resultVal = oObj.computeFunction(GeneralFunction.SUM);
+ result &= (resultVal == 0.0) || (resultVal == 0);
+ } catch (com.sun.star.uno.Exception e) {
+ result &= false ;
+ log.println(
+ "Exception occured while checking results of method");
+ e.printStackTrace(log);
+ }
+
+ tRes.tested("clearContents()", result);
+
+ } // finished clearContents
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is equal or greate than zero
+ * and no exceptions were thrown. <p>
+ */
+ public void _computeFunction() {
+
+ log.println("Testing computeFunction() ...");
+ double resultVal = -1;
+ boolean result = true;
+
+ try {
+ resultVal = oObj.computeFunction (GeneralFunction.COUNT) ;
+ result = resultVal >= 0;
+ } catch (com.sun.star.uno.Exception e) {
+ result = false;
+ log.println("Exception occured in method computeFunction.");
+ e.printStackTrace(log);
+ }
+
+ tRes.tested("computeFunction()", result);
+ } // finished computeFunction
+
+} // finished class _XSheetOperation
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetPageBreak.java b/qadevOOo/tests/java/ifc/sheet/_XSheetPageBreak.java
new file mode 100644
index 000000000000..af9f1be71aef
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSheetPageBreak.java
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSheetPageBreak.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.TablePageBreakData;
+import com.sun.star.sheet.XSheetPageBreak;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSheetPageBreak</code>
+* interface methods :
+* <ul>
+* <li><code> getColumnPageBreaks()</code></li>
+* <li><code> getRowPageBreaks()</code></li>
+* <li><code> removeAllManualPageBreaks()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSheetPageBreak
+*/
+public class _XSheetPageBreak extends MultiMethodTest {
+
+ public XSheetPageBreak oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getColumnPageBreaks() {
+ TablePageBreakData[] breakArr = oObj.getColumnPageBreaks();
+ tRes.tested("getColumnPageBreaks()", breakArr != null);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getRowPageBreaks() {
+ TablePageBreakData[] breakArr = oObj.getRowPageBreaks();
+ tRes.tested("getRowPageBreaks()", breakArr != null);
+ }
+
+ /**
+ * Test calls the method and checks that all breaks gone. <p>
+ * Has <b> OK </b> status if number of column breaks and number of row breaks
+ * are equal to zero. <p>
+ */
+ public void _removeAllManualPageBreaks() {
+ oObj.removeAllManualPageBreaks();
+
+ int manualRowPageBreaks = 0;
+ int manualColumnPageBreaks = 0;
+
+ log.println("Check if all breaks are gone");
+
+ TablePageBreakData[] breakArr = oObj.getColumnPageBreaks();
+ for (int i = 0; i < breakArr.length; i++)
+ if (breakArr[i].ManualBreak) manualColumnPageBreaks++;
+
+ breakArr = oObj.getRowPageBreaks();
+ for (int i = 0; i < breakArr.length; i++)
+ if (breakArr[i].ManualBreak) manualRowPageBreaks++ ;
+
+ tRes.tested(
+ "removeAllManualPageBreaks()",
+ manualColumnPageBreaks == 0 && manualRowPageBreaks == 0);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSpreadsheet.java b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheet.java
new file mode 100644
index 000000000000..210af3db982e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheet.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSpreadsheet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSheetCellCursor;
+import com.sun.star.sheet.XSheetCellRange;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSpreadsheet</code>
+* interface methods :
+* <ul>
+* <li><code> createCursor()</code></li>
+* <li><code> createCursorByRange()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSpreadsheet
+*/
+public class _XSpreadsheet extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XSpreadsheet oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _createCursor() {
+ log.println("Testing createCursor");
+ XSheetCellCursor oCursor = oObj.createCursor() ;
+ tRes.tested("createCursor()", oCursor != null);
+ }
+
+ /**
+ * Test gets a cell range, call method using this cell range
+ * and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null
+ * and no exceptions were thrown. <p>
+ */
+ public void _createCursorByRange() {
+ log.println("Testing createCursorByRange");
+
+ log.println("getting cellrange");
+ XCellRange oRange = null;
+ try {
+ oRange = oObj.getCellRangeByPosition (1, 1, 2, 3);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Can't get cell range by address");
+ e.printStackTrace(log);
+ tRes.tested("createCursorByRange()", false);
+ }
+
+ XSheetCellRange oSheetRange = (XSheetCellRange)
+ UnoRuntime.queryInterface(XSheetCellRange.class, oRange) ;
+ log.println("getting Cursor");
+ XSheetCellCursor oCursor = oObj.createCursorByRange(oSheetRange);
+ tRes.tested("createCursorByRange()", oCursor != null);
+ }
+
+} // finisch class _XSpreadsheet
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument.java b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument.java
new file mode 100644
index 000000000000..166aa8aba978
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSpreadsheetDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSpreadsheetDocument</code>
+* interface methods :
+* <ul>
+* <li><code> getSheets()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSpreadsheetDocument
+*/
+public class _XSpreadsheetDocument extends MultiMethodTest {
+
+ public XSpreadsheetDocument oObj = null;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getSheets() {
+ XSpreadsheets sheets = oObj.getSheets();
+ tRes.tested("getSheets()", sheets != null);
+ }
+
+
+} // finish class _XSpreadsheetDocument
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSpreadsheetView.java b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheetView.java
new file mode 100644
index 000000000000..9b2e1b397e99
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheetView.java
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSpreadsheetView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetView;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.sheet.XSpreadsheetView</code>
+* interface methods :
+* <ul>
+* <li><code> getActiveSheet()</code></li>
+* <li><code> setActiveSheet()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Sheet'</code> (of type <code>XSpreadsheet</code>):
+* to set new active spreadsheet </li>
+* <ul> <p>
+* @see com.sun.star.sheet.XSpreadsheetView
+*/
+public class _XSpreadsheetView extends MultiMethodTest {
+
+ public XSpreadsheetView oObj = null;
+ public XSpreadsheet oSheet = null;
+
+ /**
+ * Test calls the method, stores and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getActiveSheet() {
+ oSheet = oObj.getActiveSheet();
+ tRes.tested("getActiveSheet()", oSheet != null);
+ }
+
+ /**
+ * Test sets new active sheet that was obtained by relation
+ * <code>'Sheet'</code>, gets the current active sheet and compares
+ * returned value with value that was stored by method
+ * <code>getFilterFields()</code>. <p>
+ * Has <b> OK </b> status if values aren't equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getActiveSheet() </code> : to have the current
+ * active sheet </li>
+ * </ul>
+ */
+ public void _setActiveSheet() {
+ requiredMethod("getActiveSheet()");
+
+ XSpreadsheet new_Sheet = (XSpreadsheet)tEnv.getObjRelation("Sheet");
+ if (new_Sheet == null) throw new StatusException(Status.failed
+ ("Relation 'Sheet' not found"));
+
+ oObj.setActiveSheet(new_Sheet);
+ new_Sheet = oObj.getActiveSheet();
+ tRes.tested("setActiveSheet()", !oSheet.equals(new_Sheet));
+ }
+
+
+} // finish class _XSpreadsheetView
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSpreadsheets.java b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheets.java
new file mode 100644
index 000000000000..ad638cef5289
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheets.java
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSpreadsheets.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XSpreadsheets;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSpreadsheets</code>
+* interface methods :
+* <ul>
+* <li><code> insertNewByName()</code></li>
+* <li><code> moveByName()</code></li>
+* <li><code> copyByName()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.sheet.XSpreadsheets
+*/
+public class _XSpreadsheets extends MultiMethodTest {
+
+ public XSpreadsheets oObj = null;
+ protected static int uniqCount = 0;
+ protected int uniqNumber = 0;
+
+ /**
+ * Sets the unique number for the current test.
+ */
+ protected synchronized void before() {
+ uniqNumber = uniqCount ++ ;
+ }
+
+ /**
+ * Test inserts new sheet using the name returned by the method
+ * <code>newName</code>, copies inserted sheet with the new name,
+ * checks existence of the sheet with this name in collection and removes
+ * the both sheets from the collection. <p>
+ * Has <b> OK </b> status if the sheet with the name of the copy exists
+ * in the collection and no exceptions were thrown. <p>
+ */
+ public void _copyByName() {
+ boolean result = true;
+ //first insert one that should be copied
+ String iS = newName("copyFrom");
+ log.println("Inserting sheet '" + iS + "'") ;
+ oObj.insertNewByName(iS, (short)0);
+ String[] eNames = oObj.getElementNames();
+ String NewSheet = newName("copyTo");
+ log.println( "Try to copy "+eNames[0]+" to "+NewSheet);
+ oObj.copyByName(eNames[0], NewSheet, (short)0);
+ result = oObj.hasByName(NewSheet);
+ //remove all inserted sheets
+ try {
+ oObj.removeByName(NewSheet);
+ oObj.removeByName(iS);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.print("Can't remove sheet by name");
+ e.printStackTrace(log);
+ result = false;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.print("Can't remove sheet by name");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("copyByName()", result);
+ } // finished _copyByName
+
+ /**
+ * Test inserts new sheet using the name returned by the method
+ * <code>newName</code>, moves the inserted sheet to the new position
+ * in collection, gets all element names in collection and checks the name
+ * of the sheet in the new position. <p>
+ * Has <b> OK </b> status if the sheet name in the new position is equal to
+ * the name of the sheet that was moved. <p>
+ */
+ public void _moveByName() {
+ //first insert one that should be moved
+ String iS = newName("move");
+ oObj.insertNewByName(iS, (short) 0);
+ String[] eNames = oObj.getElementNames();
+ String sheetToMove = eNames[0];
+ log.println( "Try to move "+ sheetToMove);
+ oObj.moveByName(sheetToMove,(short) 2);
+ eNames = oObj.getElementNames();
+ tRes.tested("moveByName()", sheetToMove.equals(eNames[1]));
+ } // finished _moveByName
+
+ /**
+ * Test inserts new sheet using the name returned by the method
+ * <code>newName</code>, checks the existence of the inserted sheet in
+ * the collection, removes the sheet, tries to insert the sheet with the
+ * bad name returned by method <code>badName()</code>. <p>
+ * Has <b> OK </b> status if the inserted sheet exists in the collection
+ * after first method call and if exception occured during the second call. <p>
+ */
+ public void _insertNewByName() {
+
+ boolean result = false;
+
+ String NewSheet = newName("insert");
+ log.println( "Try to insert " + NewSheet);
+ oObj.insertNewByName(NewSheet, (short) 0);
+ result = oObj.hasByName( NewSheet );
+ try {
+ oObj.removeByName( NewSheet );
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.print("Can't remove sheet '" + NewSheet + "':");
+ e.printStackTrace(log);
+ result = false;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.print("Can't remove sheet '" + NewSheet + "':");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ try {
+ NewSheet = badName();
+ log.println( "Try to insert " + NewSheet);
+ oObj.insertNewByName(NewSheet, (short) 0);
+ log.println(
+ "No Exception thrown while inserting sheet with invalid name");
+ result &= false;
+ oObj.removeByName( NewSheet );
+ } catch (com.sun.star.uno.RuntimeException e) {
+ log.println(
+ "Expected exception occured during testing 'insertNewByName'");
+ result &= true;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.print("Can't remove sheet '" + NewSheet + "':");
+ e.printStackTrace(log);
+ result = false;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.print("Can't remove sheet '" + NewSheet + "':");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ tRes.tested("insertNewByName()", result);
+ } // finished _insertByName
+
+ /**
+ * Method returns unique new name using passed prefix and unique number
+ * of the current test.
+ */
+ public String newName(String prefix) {
+ return prefix + uniqNumber ;
+ } // finished newName
+
+ /**
+ * Method return bad name for a sheet using the name of the current thread.
+ */
+ public String badName() {
+ return Thread.currentThread().getName();
+ } // finished badName
+
+
+} //finish class _XSpreadsheets
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSubTotalDescriptor.java b/qadevOOo/tests/java/ifc/sheet/_XSubTotalDescriptor.java
new file mode 100644
index 000000000000..845319e08226
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSubTotalDescriptor.java
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSubTotalDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.GeneralFunction;
+import com.sun.star.sheet.SubTotalColumn;
+import com.sun.star.sheet.XSubTotalDescriptor;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSubTotalDescriptor</code>
+* interface methods :
+* <ul>
+* <li><code> addNew()</code></li>
+* <li><code> clear()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSubTotalDescriptor
+*/
+public class _XSubTotalDescriptor extends MultiMethodTest {
+
+ public XSubTotalDescriptor oObj = null;
+
+ /**
+ * Test creates a subtotal field definition and adds it to the descriptor.<p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _addNew() {
+ SubTotalColumn[] columns = new SubTotalColumn[1];
+ SubTotalColumn column = new SubTotalColumn();
+ column.Column = 5;
+ column.Function = GeneralFunction.SUM;
+ columns[0] = column;
+ oObj.addNew(columns, 1);
+ tRes.tested("addNew()", true);
+ }
+
+ /**
+ * Test just calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _clear() {
+ oObj.clear();
+ tRes.tested("clear()", true);
+ }
+
+
+} // finish class _XSubTotalDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XSubTotalField.java b/qadevOOo/tests/java/ifc/sheet/_XSubTotalField.java
new file mode 100644
index 000000000000..1d54bcbd2dd7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XSubTotalField.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSubTotalField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.GeneralFunction;
+import com.sun.star.sheet.SubTotalColumn;
+import com.sun.star.sheet.XSubTotalField;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XSubTotalField</code>
+* interface methods :
+* <ul>
+* <li><code> getGroupColumn()</code></li>
+* <li><code> setGroupColumn()</code></li>
+* <li><code> getSubTotalColumns()</code></li>
+* <li><code> setSubTotalColumns()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XSubTotalField
+*/
+public class _XSubTotalField extends MultiMethodTest {
+
+ public XSubTotalField oObj = null;
+ public int GroupColumn = 0;
+ public SubTotalColumn[] STColumns = null;
+
+ /**
+ * Test calls the method, stores and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't equal to zero. <p>
+ */
+ public void _getGroupColumn() {
+ GroupColumn = oObj.getGroupColumn();
+ tRes.tested("getGroupColumn()", GroupColumn != 0);
+ } // end of getGroupColumn
+
+ /**
+ * Test calls the method, stores and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null. <p>
+ */
+ public void _getSubTotalColumns() {
+ STColumns = oObj.getSubTotalColumns();
+ tRes.tested("getSubTotalColumns()", STColumns != null);
+ } // end of getSubTotalColumns
+
+ /**
+ * Test sets new value of the column by which entries are grouped,
+ * gets the current value and compares
+ * returned value with value that was stored by method
+ * <code>getGroupColumn()</code>. <p>
+ * Has <b> OK </b> status if values aren't equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getGroupColumn() </code> : to have the current column by
+ * which entries are grouped </li>
+ * </ul>
+ */
+ public void _setGroupColumn() {
+ requiredMethod("getGroupColumn()");
+ oObj.setGroupColumn(2);
+ tRes.tested("setGroupColumn()", GroupColumn != oObj.getGroupColumn());
+ } // end of getGroupColumn
+
+ /**
+ * Test sets new value using method, gets the current value and compares
+ * returned value with value that was stored by method
+ * <code>getSubTotalColumns()</code>. <p>
+ * Has <b> OK </b> status if values aren't equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSubTotalColumns() </code> : to have the current value</li>
+ * </ul>
+ */
+ public void _setSubTotalColumns() {
+ requiredMethod("getSubTotalColumns()");
+ SubTotalColumn[] columns = new SubTotalColumn[2];
+ SubTotalColumn column = new SubTotalColumn();
+ column.Column=2;
+ column.Function=GeneralFunction.AVERAGE;
+ columns[0]=column;
+ columns[1]=STColumns[0];
+ oObj.setSubTotalColumns(columns);
+ tRes.tested(
+ "setSubTotalColumns()",
+ !STColumns.equals(oObj.getSubTotalColumns()) );
+ } // end of getSubTotalColumns
+
+} // finish class _XSubTotalField
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XUsedAreaCursor.java b/qadevOOo/tests/java/ifc/sheet/_XUsedAreaCursor.java
new file mode 100644
index 000000000000..a80bcca65e2c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XUsedAreaCursor.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XUsedAreaCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSheetCellCursor;
+import com.sun.star.sheet.XUsedAreaCursor;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XUsedAreaCursor</code>
+* interface methods :
+* <ul>
+* <li><code> gotoStartOfUsedArea()</code></li>
+* <li><code> gotoEndOfUsedArea()</code></li>
+* </ul> <p>
+* Component must also implement the following interfaces :
+* <ul>
+* <li> <code> com.sun.star.XCellRangeAddressable </code> : to check the current
+* position of the cursor </li>
+* <ul> <p>
+* @see com.sun.star.sheet.XUsedAreaCursor
+*/
+public class _XUsedAreaCursor extends MultiMethodTest {
+
+ public XUsedAreaCursor oObj = null;
+ public XSheetCellCursor oC = null;
+ CellRangeAddress sAddr = null;
+
+ /**
+ * Test points the cursor to the start of used area, expands cursor to the
+ * end of the used area, gets and checks current range address, then
+ * points the cursor to the end of the used area, gets and checks current
+ * range address again. <p>
+ * Has <b> OK </b> status if the range address expands at all used area
+ * in first case and if the range address just points to the cell at the end
+ * of the used area in second case. <p>
+ */
+ public void _gotoEndOfUsedArea() {
+ boolean result = true ;
+
+ XCellRangeAddressable oAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj) ;
+
+ // first with true argument
+ oObj.gotoStartOfUsedArea(false);
+ oObj.gotoEndOfUsedArea(true);
+ sAddr = oAddr.getRangeAddress();
+
+ result &= (sAddr.StartColumn == 1);
+ result &= (sAddr.StartRow == 1);
+ result &= (sAddr.EndColumn == 4);
+ result &= (sAddr.EndRow == 5);
+
+ oObj.gotoEndOfUsedArea(false);
+ sAddr = oAddr.getRangeAddress();
+
+ result &= (sAddr.StartColumn == 4);
+ result &= (sAddr.StartRow == 5);
+ result &= (sAddr.EndColumn == 4);
+ result &= (sAddr.EndRow == 5);
+
+ tRes.tested("gotoEndOfUsedArea()", result) ;
+ }
+
+ /**
+ * Test points the cursor to the end of used area, expands cursor to the
+ * start of the used area, gets and checks current range address, then
+ * points the cursor to the start of the used area, gets and checks current
+ * range address again. <p>
+ * Has <b> OK </b> status if the range address expands at all used area
+ * in first case and if the range address just points to the cell at the
+ * start of the used area in second case. <p>
+ */
+ public void _gotoStartOfUsedArea() {
+ XCellRangeAddressable oAddr = (XCellRangeAddressable)
+ UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj) ;
+
+ boolean result = true ;
+
+ // with true parameter first
+ oObj.gotoEndOfUsedArea(false);
+ oObj.gotoStartOfUsedArea(true);
+ sAddr = oAddr.getRangeAddress();
+
+ result &= (sAddr.StartColumn == 1);
+ result &= (sAddr.StartRow == 1);
+ result &= (sAddr.EndColumn == 4);
+ result &= (sAddr.EndRow == 5);
+
+ // now testing with false parameter
+ oObj.gotoStartOfUsedArea(false);
+ sAddr = oAddr.getRangeAddress();
+
+ result &= (sAddr.StartColumn == 1);
+ result &= (sAddr.StartRow == 1);
+ result &= (sAddr.EndColumn == 1);
+ result &= (sAddr.EndRow == 1);
+
+ tRes.tested("gotoStartOfUsedArea()", result) ;
+ } // finished gotoStartOfUsedArea
+
+ /**
+ * Forces object environment recreation.
+ */
+ protected void after() {
+ tEnv.dispose();
+ }
+} // finished class _XUsedAreaCursor
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XViewFreezable.java b/qadevOOo/tests/java/ifc/sheet/_XViewFreezable.java
new file mode 100644
index 000000000000..e1b9b58495c8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XViewFreezable.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XViewFreezable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XViewFreezable;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XViewFreezable</code>
+* interface methods :
+* <ul>
+* <li><code> hasFrozenPanes()</code></li>
+* <li><code> freezeAtPosition()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XViewFreezable
+*/
+public class _XViewFreezable extends MultiMethodTest {
+
+ public XViewFreezable oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _freezeAtPosition() {
+ oObj.freezeAtPosition(2, 2);
+ tRes.tested("freezeAtPosition()", true);
+ }
+
+ /**
+ * Test calls the method, checks returned value, unfreezes panes, calls the
+ * method and checks returned value again. <p>
+ * Has <b> OK </b> status if returned value is true after firts call and
+ * returned value is false after second. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> freezeAtPosition() </code> : to freeze panes with the
+ * specified number of columns and rows </li>
+ * </ul>
+ */
+ public void _hasFrozenPanes() {
+ requiredMethod("freezeAtPosition()");
+ boolean result = oObj.hasFrozenPanes();
+ oObj.freezeAtPosition(0,0);
+ result &= !oObj.hasFrozenPanes();
+ tRes.tested("hasFrozenPanes()", result);
+ }
+
+
+} // finish class _XViewFreezable
+
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XViewPane.java b/qadevOOo/tests/java/ifc/sheet/_XViewPane.java
new file mode 100644
index 000000000000..a3a56b85b79e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XViewPane.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XViewPane.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XViewPane;
+import com.sun.star.table.CellRangeAddress;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XViewPane</code>
+* interface methods :
+* <ul>
+* <li><code> getFirstVisibleColumn()</code></li>
+* <li><code> setFirstVisibleColumn()</code></li>
+* <li><code> getFirstVisibleRow()</code></li>
+* <li><code> setFirstVisibleRow()</code></li>
+* <li><code> getVisibleRange()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XViewPane
+*/
+public class _XViewPane extends MultiMethodTest {
+
+ public XViewPane oObj = null;
+ int row = 3;
+ int col = 5;
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is equal to value that was set
+ * by method <code>setFirstVisibleColumn()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setFirstVisibleColumn() </code> : to set specific value
+ * of the first column that is visible in the pane </li>
+ * </ul>
+ */
+ public void _getFirstVisibleColumn() {
+ requiredMethod("setFirstVisibleColumn()");
+ boolean result = col == oObj.getFirstVisibleColumn();
+ tRes.tested("getFirstVisibleColumn()", result);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is equal to value that was set
+ * by method <code>setFirstVisibleRow()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setFirstVisibleRow() </code> : to set specific value of
+ * the first row that is visible in the pane </li>
+ * </ul>
+ */
+ public void _getFirstVisibleRow() {
+ requiredMethod("setFirstVisibleRow()");
+ boolean result = row == oObj.getFirstVisibleRow();
+ tRes.tested("getFirstVisibleRow()", result);
+ }
+
+ /**
+ * Test just calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setFirstVisibleColumn() {
+ oObj.setFirstVisibleColumn(col);
+ tRes.tested("setFirstVisibleColumn()", true);
+ }
+
+ /**
+ * Test just calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _setFirstVisibleRow() {
+ oObj.setFirstVisibleRow(row);
+ tRes.tested("setFirstVisibleRow()", true);
+ }
+
+ /**
+ * Test calls the method, checks returned value and adds object relation
+ * 'DATAAREA' to test environment. <p>
+ * Has <b> OK </b> status if returned value isn't null and if start row and
+ * start column are equal to values that was set by methods
+ * <code>setFirstVisibleRow</code> and <code>setFirstVisibleColumn</code>.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setFirstVisibleRow() </code> : to set specific value of
+ * the first row that is visible in the pane </li>
+ * <li> <code> setFirstVisibleColumn() </code> : to set specific value of
+ * the first column that is visible in the pane </li>
+ * </ul>
+ */
+ public void _getVisibleRange() {
+ requiredMethod("setFirstVisibleRow()");
+ requiredMethod("setFirstVisibleColumn()");
+
+ CellRangeAddress RA = oObj.getVisibleRange();
+ boolean result = RA != null;
+ if (result) {
+ result &= RA.Sheet == 0;
+ result &= RA.StartRow == row;
+ result &= RA.StartColumn == col;
+ tEnv.addObjRelation("DATAAREA", RA);
+ }
+
+ tRes.tested("getVisibleRange()", result);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/sheet/_XViewSplitable.java b/qadevOOo/tests/java/ifc/sheet/_XViewSplitable.java
new file mode 100644
index 000000000000..4e7ed34a893b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/sheet/_XViewSplitable.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XViewSplitable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.sheet;
+
+import com.sun.star.sheet.XViewSplitable;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.sheet.XViewSplitable</code>
+* interface methods :
+* <ul>
+* <li><code> getIsWindowSplit()</code></li>
+* <li><code> getSplitHorizontal()</code></li>
+* <li><code> getSplitVertical()</code></li>
+* <li><code> getSplitColumn()</code></li>
+* <li><code> getSplitRow()</code></li>
+* <li><code> splitAtPosition()</code></li>
+* </ul> <p>
+* @see com.sun.star.sheet.XViewSplitable
+*/
+public class _XViewSplitable extends MultiMethodTest {
+
+ public XViewSplitable oObj = null;
+ protected final int posX = 101, posY = 51;
+
+ /**
+ * Test just calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public void _splitAtPosition(){
+ oObj.splitAtPosition(posX, posY);
+ tRes.tested("splitAtPosition()", true);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value is equal to true. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> splitAtPosition() </code> : that the view was splitted into
+ * individual panes </li>
+ * </ul>
+ */
+ public void _getIsWindowSplit(){
+ requiredMethod("splitAtPosition()");
+ tRes.tested("getIsWindowSplit()", oObj.getIsWindowSplit());
+ }
+
+ /**
+ * Test calls the method and compares returned value with value that was
+ * set by method <code>splitAtPosition()</code>. <p>
+ * Has <b> OK </b> status if returned value is equal to value that was
+ * set by method <code>splitAtPosition()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> splitAtPosition() </code> : to split the view at the
+ * specified position </li>
+ * </ul>
+ */
+ public void _getSplitHorizontal() {
+ requiredMethod("splitAtPosition()");
+ tRes.tested("getSplitHorizontal()", oObj.getSplitHorizontal() == posX);
+ }
+
+ /**
+ * Test calls the method and compares returned value with value that was
+ * set by method <code>splitAtPosition()</code>. <p>
+ * Has <b> OK </b> status if returned value is equal to value that was
+ * set by method <code>splitAtPosition()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> splitAtPosition() </code> : to split the view at the
+ * specified position </li>
+ * </ul>
+ */
+ public void _getSplitVertical() {
+ requiredMethod("splitAtPosition()");
+ tRes.tested("getSplitVertical()", oObj.getSplitVertical() == posY);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't equal zero. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> splitAtPosition() </code> : to split the view at the
+ * specified position </li>
+ * </ul>
+ */
+ public void _getSplitColumn() {
+ requiredMethod("splitAtPosition()");
+ tRes.tested("getSplitColumn()", oObj.getSplitColumn() != 0);
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't equal zero. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> splitAtPosition() </code> : to split the view at the
+ * specified position </li>
+ * </ul>
+ */
+ public void _getSplitRow() {
+ requiredMethod("splitAtPosition()");
+ tRes.tested("getSplitRow()", oObj.getSplitRow() != 0);
+ }
+} // finish class _XViewSplitable
+
+
diff --git a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java
new file mode 100644
index 000000000000..69d932a246e8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java
@@ -0,0 +1,425 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CharacterProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.style;
+
+import com.sun.star.beans.XPropertySet;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.ValueChanger;
+import util.utils;
+
+
+/**
+* Testing <code>com.sun.star.style.CharacterProperties</code>
+* service properties :
+* <ul>
+* <li><code> CharFontName</code></li>
+* <li><code> CharFontStyleName</code></li>
+* <li><code> CharFontFamily</code></li>
+* <li><code> CharFontCharSet</code></li>
+* <li><code> CharFontPitch</code></li>
+* <li><code> CharColor</code></li>
+* <li><code> CharEscapement</code></li>
+* <li><code> CharHeight</code></li>
+* <li><code> CharUnderline</code></li>
+* <li><code> CharWeight</code></li>
+* <li><code> CharPosture</code></li>
+* <li><code> CharAutoKerning</code></li>
+* <li><code> CharBackColor</code></li>
+* <li><code> CharBackTransparent</code></li>
+* <li><code> CharCaseMap</code></li>
+* <li><code> CharCrossedOut</code></li>
+* <li><code> CharFlash</code></li>
+* <li><code> CharStrikeout</code></li>
+* <li><code> CharWordMode</code></li>
+* <li><code> CharKerning</code></li>
+* <li><code> CharLocale</code></li>
+* <li><code> CharKeepTogether</code></li>
+* <li><code> CharNoLineBreak</code></li>
+* <li><code> CharShadowed</code></li>
+* <li><code> CharFontType</code></li>
+* <li><code> CharStyleName</code></li>
+* <li><code> CharContoured</code></li>
+* <li><code> CharCombineIsOn</code></li>
+* <li><code> CharCombinePrefix</code></li>
+* <li><code> CharCombineSuffix</code></li>
+* <li><code> CharEmphasize</code></li>
+* <li><code> CharRelief</code></li>
+* <li><code> RubyText</code></li>
+* <li><code> RubyAdjust</code></li>
+* <li><code> RubyCharStyleName</code></li>
+* <li><code> RubyIsAbove</code></li>
+* <li><code> CharRotation</code></li>
+* <li><code> CharRotationIsFitToLine</code></li>
+* <li><code> CharScaleWidth</code></li>
+* <li><code> HyperLinkURL</code></li>
+* <li><code> HyperLinkTarget</code></li>
+* <li><code> HyperLinkName</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'PARA'</code>: <b>optional</b>
+* (must implement <code>XPropertySet</code>):
+* if this relation is specified then some properties
+* testing is performed in a special manner. (e.g. this used in
+* <code>sw.SwXParagraph</code> component) For details
+* see {@link #changeProp} method description. </li>
+* <li> <code>'PORTION'</code>: <b>optional</b>
+* (must implement <code>XPropertySet</code>):
+* if this relation is specified then some properties
+* testing is performed in a special manner. (e.g. this used in
+* <code>sw.SwXParagraph</code> component) For details
+* see {@link #changeProp} method description. </li>
+* <ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.style.CharacterProperties
+*/
+public class _CharacterProperties extends MultiPropertyTest {
+
+ public void _CharFontName() {
+ testProperty("CharFontName", "Times New Roman", "Arial") ;
+ }
+
+ public void _CharHeight() {
+ testProperty("CharHeight", new PropertyTester() {
+ protected Object getNewValue(String propName, Object old) {
+ if (utils.isVoid(old)) {
+ return new Float(10) ;
+ } else {
+ return new Float(((Float) old).floatValue() + 10) ;
+ }
+ }
+ }) ;
+ }
+
+ /**
+ * Custom tester for properties which contains image URLs.
+ * Switches between two JPG images' URLs.
+ */
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (oldValue.equals("http://www.sun.com"))
+ return "http://www.openoffice.org"; else
+ return "http://www.sun.com";
+ }
+ } ;
+
+ public void _HyperLinkURL() {
+ testProperty("HyperLinkURL", URLTester) ;
+ }
+
+ public void _HyperLinkName() {
+ testProperty("HyperLinkName", URLTester) ;
+ }
+
+ public void _HyperLinkTarget() {
+ testProperty("HyperLinkTarget", URLTester) ;
+ }
+
+ public void _CharWeight() {
+ testProperty("CharWeight", new Float(com.sun.star.awt.FontWeight.BOLD),
+ new Float(com.sun.star.awt.FontWeight.THIN)) ;
+ }
+
+ public void _CharPosture() {
+ testProperty("CharPosture", com.sun.star.awt.FontSlant.ITALIC,
+ com.sun.star.awt.FontSlant.NONE) ;
+ }
+
+ /**
+ * Custom tester for style name properties. Switches between
+ * 'Citation' and 'Emphasis' names.
+ */
+ protected PropertyTester StyleTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (utils.isVoid(oldValue) || (oldValue.equals("Standard")))
+ return "Citation"; else
+ return "Emphasis";
+ }
+ } ;
+
+ /**
+ * If relations for paragraph and portion exist, then testing
+ * of this property performed using these objects, else
+ * testing is performed in common way.
+ */
+ public void _CharStyleName() {
+ log.println("Testing with custom Property tester") ;
+ Object oPara = tEnv.getObjRelation("PARA");
+ Object oPort = tEnv.getObjRelation("PORTION");
+ if (oPara == null) {
+ testProperty("CharStyleName", StyleTester) ;
+ } else {
+ changeProp((XPropertySet) oPara,
+ (XPropertySet) oPort,"CharStyleName","Standard");
+ }
+ }
+
+ /**
+ * If relations for paragraph and portion exist, then testing
+ * of this property performed using these objects, else
+ * testing is performed in common way.
+ */
+ public void _RubyCharStyleName() {
+ log.println("Testing with custom Property tester") ;
+ Object oPara = tEnv.getObjRelation("PARA");
+ Object oPort = tEnv.getObjRelation("PORTION");
+ if (oPara == null) {
+ testProperty("RubyCharStyleName", StyleTester) ;
+ } else {
+ changeProp((XPropertySet) oPara, (XPropertySet)
+ oPort,"RubyCharStyleName","Standard");
+ }
+ }
+
+ /**
+ * If relations for paragraph and portion exist, then testing
+ * of this property performed using these objects, else
+ * testing is performed in common way.
+ */
+ public void _RubyAdjust() {
+ log.println("Testing with custom Property tester") ;
+ Object oPara = tEnv.getObjRelation("PARA");
+ Object oPort = tEnv.getObjRelation("PORTION");
+ if (oPara == null) {
+ testProperty("RubyAdjust",new Short((short)0),new Short((short)1));
+ } else {
+ Short aShort = new Short((short) 1);
+ changeProp((XPropertySet) oPara,
+ (XPropertySet) oPort,"RubyAdjust", aShort);
+ }
+ Short aShort = new Short((short) 1);
+ }
+
+ /**
+ * Custom tester for the ruby text property.
+ */
+ protected PropertyTester RubyTextTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (utils.isVoid(oldValue)) {
+ return new String("RubyText");
+ } else {
+ return ValueChanger.changePValue(oldValue);
+ }
+ }
+ } ;
+
+ /**
+ * If relations for paragraph and portion exist, then testing
+ * of this property performed using these objects, else
+ * testing is performed in common way.
+ */
+ public void _RubyText() {
+ log.println("Testing with custom Property tester") ;
+ Object oPara = tEnv.getObjRelation("PARA");
+ Object oPort = tEnv.getObjRelation("PORTION");
+ if (oPara == null) {
+ testProperty("RubyText", RubyTextTester) ;
+ } else {
+ changeProp((XPropertySet) oPara, (XPropertySet) oPort,
+ "RubyText","");
+ }
+ }
+
+ /**
+ * If relations for paragraph and portion exist, then testing
+ * of this property performed using these objects, else
+ * testing is performed in common way.
+ */
+ public void _RubyIsAbove() {
+ log.println("Testing with custom Property tester") ;
+ Object oPara = tEnv.getObjRelation("PARA");
+ Object oPort = tEnv.getObjRelation("PORTION");
+ if (oPara == null) {
+ testProperty("RubyIsAbove") ;
+ } else {
+ changeProp((XPropertySet) oPara, (XPropertySet) oPort,
+ "RubyIsAbove",new Boolean(true));
+ }
+ }
+
+ /**
+ * This property only takes values between 0..100
+ * so ist must be treated special
+ */
+ public void _CharEscapementHeight() {
+ Byte aByte = new Byte((byte)75);
+ Byte max = new Byte((byte)100);
+ testProperty("CharEscapementHeight", aByte, max) ;
+ }
+
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _CharRotation() {
+ Short aShort = new Short((short) 10);
+ changeProp(oObj,oObj, "CharRotation", aShort);
+ }
+
+ /**
+ * Tests the property specified by <code>name</code> using
+ * property set <code>oProps</code>, but value after setting
+ * this property to a new value is checked using another
+ * PropertySet <code>get</code>. Special cases used for
+ * <code>CharRotation</code> property (it can have only certain values
+ * 0, 900, ...), and for <code>*StyleName</code> properties
+ * (only existing style names are accepted)
+ * @param oProps PropertySet from which property value is get
+ * changed and set.
+ * @param get PropertySet where property value is checked after
+ * setting.
+ * @param name Propety name to test.
+ * @param newVal Value used to set as new property value if
+ * the value get is null.
+ */
+ public void changeProp(XPropertySet oProps,
+ XPropertySet get,String name, Object newVal) {
+
+ Object gValue = null;
+ Object sValue = null;
+ Object ValueToSet = null;
+
+ try {
+ //waitForAllThreads();
+ gValue = oProps.getPropertyValue(name);
+
+ if ( (gValue == null) || (utils.isVoid(gValue)) ) {
+ log.println("Value for "+name+" is NULL");
+ gValue = newVal;
+ }
+
+ //waitForAllThreads();
+ if (name.equals("CharRotation")) {
+ Short s1 = new Short((short) 0);
+ Short s2 = new Short((short) 900);
+ if (gValue.equals(s1)) {
+ ValueToSet = s2;
+ } else {
+ ValueToSet = s1;
+ }
+ } else {
+ ValueToSet = ValueChanger.changePValue(gValue);
+ }
+ if (name.endsWith("StyleName")) {
+ if ( ((String) gValue).equals("Standard") ) {
+ ValueToSet="Main index entry";
+ }
+ else {
+ ValueToSet="Emphasis";
+ }
+ }
+
+ //waitForAllThreads();
+ oProps.setPropertyValue(name,ValueToSet);
+ sValue = get.getPropertyValue(name);
+ if (sValue == null) {
+ log.println("Value for "+name+" is NULL after setting");
+ sValue = gValue;
+ }
+
+ //check get-set methods
+ if (gValue.equals(sValue)) {
+ log.println("Value for '"+name+"' hasn't changed");
+ tRes.tested(name, false);
+ } else {
+ log.println("Property '"+name+"' OK");
+ log.println("old: "+gValue.toString());
+ log.println("new: "+ValueToSet.toString());
+ log.println("result: "+sValue.toString());
+ tRes.tested(name, true);
+ }
+ }
+ catch (com.sun.star.beans.UnknownPropertyException ex) {
+ if (isOptional(name)) {
+ log.println("Property '"+name+
+ "' is optional and not supported");
+ tRes.tested(name,true);
+ }
+ else {
+ log.println("Exception occured while testing property '" +
+ name + "'");
+ ex.printStackTrace(log);
+ tRes.tested(name, false);
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while testing property '" +
+ name + "'");
+ e.printStackTrace(log);
+ tRes.tested(name, false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while testing property '" +
+ name + "'");
+ e.printStackTrace(log);
+ tRes.tested(name, false);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while testing property '" +
+ name + "'");
+ e.printStackTrace(log);
+ tRes.tested(name, false);
+ }
+ }// end of changeProp
+
+} //finish class _CharacterProperties
+
diff --git a/qadevOOo/tests/java/ifc/style/_CharacterPropertiesAsian.java b/qadevOOo/tests/java/ifc/style/_CharacterPropertiesAsian.java
new file mode 100644
index 000000000000..2670d507abb9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/style/_CharacterPropertiesAsian.java
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CharacterPropertiesAsian.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.style;
+
+import lib.MultiPropertyTest;
+
+import lib.MultiPropertyTest;
+import com.sun.star.awt.FontSlant;
+import com.sun.star.awt.FontWeight;
+
+/**
+* Testing <code>com.sun.star.style.CharacterPropertiesAsian</code>
+* service properties :
+* <ul>
+* <li><code> CharHeightAsian</code></li>
+* <li><code> CharWeightAsian</code></li>
+* <li><code> CharFontNameAsian</code></li>
+* <li><code> CharFontStyleNameAsian</code></li>
+* <li><code> CharFontFamilyAsian</code></li>
+* <li><code> CharFontCharSetAsian</code></li>
+* <li><code> CharFontPitchAsian</code></li>
+* <li><code> CharPostureAsian</code></li>
+* <li><code> CharLocaleAsian</code></li>
+* <li><code> ParaIsCharacterDistance</code></li>
+* <li><code> ParaIsForbiddenRules</code></li>
+* <li><code> ParaIsHangingPunctuation</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.style.CharacterPropertiesAsian
+*/
+public class _CharacterPropertiesAsian extends MultiPropertyTest {
+
+ public void _CharPostureAsian() {
+ testProperty("CharPostureAsian", FontSlant.NONE, FontSlant.ITALIC);
+ }
+
+ public void _CharWeightAsian() {
+ testProperty("CharWeightAsian", new Float(FontWeight.NORMAL),
+ new Float(FontWeight.BOLD));
+ }
+
+ public void _ParaIsCharacterDistance() {
+ testProperty("ParaIsCharacterDistance", Boolean.TRUE, Boolean.FALSE);
+ }
+
+ public void _ParaIsForbiddenRules() {
+ testProperty("ParaIsForbiddenRules", Boolean.TRUE, Boolean.FALSE);
+ }
+
+ public void _ParaIsHangingPunctuation() {
+ testProperty("ParaIsHangingPunctuation", Boolean.TRUE, Boolean.FALSE);
+ }
+} //finish class _CharacterPropertiesAsian \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/style/_CharacterPropertiesComplex.java b/qadevOOo/tests/java/ifc/style/_CharacterPropertiesComplex.java
new file mode 100644
index 000000000000..c9c487b8bae0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/style/_CharacterPropertiesComplex.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CharacterPropertiesComplex.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.style;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.style.CharacterPropertiesComplex</code>
+* service properties :
+* <ul>
+* <li><code> CharHeightComplex</code></li>
+* <li><code> CharWeightComplex</code></li>
+* <li><code> CharFontNameComplex</code></li>
+* <li><code> CharFontStyleNameComplex</code></li>
+* <li><code> CharFontFamilyComplex</code></li>
+* <li><code> CharFontCharSetComplex</code></li>
+* <li><code> CharFontPitchComplex</code></li>
+* <li><code> CharPostureComplex</code></li>
+* <li><code> CharLocaleComplex</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.style.CharacterPropertiesComplex
+*/
+public class _CharacterPropertiesComplex extends MultiPropertyTest {
+
+
+} //finish class _CharacterPropertiesComplex
+
diff --git a/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java
new file mode 100644
index 000000000000..15672bd9517a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java
@@ -0,0 +1,345 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ParagraphProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.style;
+
+import com.sun.star.table.BorderLine;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import lib.MultiPropertyTest$PropertyValueSwitcher;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.style.ParagraphProperties</code>
+* service properties :
+* <ul>
+* <li><code> ParaAdjust</code></li>
+* <li><code> ParaLineSpacing</code></li>
+* <li><code> ParaBackColor</code></li>
+* <li><code> ParaBackTransparent</code></li>
+* <li><code> ParaBackGraphicURL</code></li>
+* <li><code> ParaBackGraphicFilter</code></li>
+* <li><code> ParaBackGraphicLocation</code></li>
+* <li><code> ParaLastLineAdjust</code></li>
+* <li><code> ParaExpandSingleWord</code></li>
+* <li><code> ParaLeftMargin</code></li>
+* <li><code> ParaRightMargin</code></li>
+* <li><code> ParaTopMargin</code></li>
+* <li><code> ParaBottomMargin</code></li>
+* <li><code> ParaLineNumberCount</code></li>
+* <li><code> ParaLineNumberStartValue</code></li>
+* <li><code> ParaIsHyphenation</code></li>
+* <li><code> PageDescName</code></li>
+* <li><code> PageNumberOffset</code></li>
+* <li><code> ParaRegisterModeActive</code></li>
+* <li><code> ParaTabStops</code></li>
+* <li><code> ParaStyleName</code></li>
+* <li><code> DropCapFormat</code></li>
+* <li><code> DropCapWholeWord</code></li>
+* <li><code> ParaKeepTogether</code></li>
+* <li><code> ParaSplit</code></li>
+* <li><code> NumberingLevel</code></li>
+* <li><code> NumberingRules</code></li>
+* <li><code> NumberingStartValue</code></li>
+* <li><code> ParaIsNumberingRestart</code></li>
+* <li><code> NumberingStyleName</code></li>
+* <li><code> ParaOrphans</code></li>
+* <li><code> ParaWidows</code></li>
+* <li><code> ParaShadowFormat</code></li>
+* <li><code> IsHangingPunctuation</code></li>
+* <li><code> IsCharacterDistance</code></li>
+* <li><code> IsForbiddenRules</code></li>
+* <li><code> LeftBorder</code></li>
+* <li><code> RightBorder</code></li>
+* <li><code> TopBorder</code></li>
+* <li><code> BottomBorder</code></li>
+* <li><code> BorderDistance</code></li>
+* <li><code> LeftBorderDistance</code></li>
+* <li><code> RightBorderDistance</code></li>
+* <li><code> TopBorderDistance</code></li>
+* <li><code> BottomBorderDistance</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'NRULES'</code> : <b>optional</b>
+* (service <code>com.sun.star.text.NumberingRules</code>):
+* instance of the service which can be set as 'NumberingRules'
+* property new value. If the relation doesn't then two
+* different <code>NumberingRules</code> objects are tried
+* to be obtained by setting different 'NumberingStyleName'
+* property styles and getting 'NumberingRules' property values.</li>
+* <ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.style.ParagraphProperties
+*/
+public class _ParagraphProperties extends MultiPropertyTest {
+
+ /**
+ * Custom tester for numbering style properties. Switches between
+ * 'Numbering 1' and 'Numbering 2' styles.
+ */
+ protected PropertyTester NumberingStyleTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if ((oldValue != null) && (oldValue.equals("Numbering 1")))
+ return "Numbering 2"; else
+ return "Numbering 1";
+ }
+ } ;
+
+ /**
+ * Custom tester for paragraph style properties. Switches between
+ * 'Salutation' and 'Heading' styles.
+ */
+ protected PropertyTester charStyleTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (!utils.isVoid(oldValue) && (oldValue.equals("Example")))
+ return "Emphasis"; else
+ return "Example";
+ }
+ } ;
+
+ /**
+ * Custom tester for paragraph style properties. Switches between
+ * 'Salutation' and 'Heading' styles.
+ */
+ protected PropertyTester ParaStyleTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (!utils.isVoid(oldValue) && (oldValue.equals("Heading")))
+ return "Salutation"; else
+ return "Heading";
+ }
+ } ;
+
+ /**
+ * Custom tester for PageDescName properties. Switches between
+ * 'HTML' and 'Standard' descriptor names.
+ */
+ protected PropertyTester PageDescTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (!util.utils.isVoid(oldValue) && (oldValue.equals("Default")))
+ return "HTML"; else
+ return "Default";
+ }
+ } ;
+
+ /**
+ * Custom tester for properties which have <code>short</code> type
+ * and can be void, so if they have void value, the new value must
+ * be specified. Switches between two different values.
+ */
+ protected PropertyTester ShortTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if ((oldValue != null) && (oldValue.equals(new Short((short) 0))))
+ return new Short((short) 2); else
+ return new Short((short) 0);
+ }
+ } ;
+
+ /**
+ * Custom tester for properties which contains image URLs.
+ * Switches between two JPG images' URLs.
+ */
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg"); else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ } ;
+
+ protected PropertyTester rules = null ;
+
+ /**
+ * Creates tester for 'NumberingRules' depending on relation.
+ */
+ public void before() {
+ final Object nRules = tEnv.getObjRelation("NRULES");
+
+ if (nRules != null) {
+ rules = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return nRules;
+ }
+ } ;
+ } else {
+ Object rules1 = null ;
+ Object rules2 = null ;
+ try {
+ oObj.setPropertyValue("NumberingStyleName", "Numbering 1");
+ rules1 = oObj.getPropertyValue("NumberingRules") ;
+ oObj.setPropertyValue("NumberingStyleName", "Numbering 2");
+ rules2 = oObj.getPropertyValue("NumberingRules") ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("WARNING !!! Exception getting numbering rules :");
+ e.printStackTrace(log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("WARNING !!! Exception getting numbering rules :");
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("WARNING !!! Exception getting numbering rules :");
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Property 'NumberingStyleName' is not supported.");
+ }
+ rules = new PropertyValueSwitcher(rules1, rules2) ;
+ }
+ }
+
+ /**
+ * Tested with custom property tester.
+ */
+ public void _NumberingStyleName() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("NumberingStyleName", NumberingStyleTester) ;
+ }
+
+ /**
+ * Tested with custom property tester.
+ */
+ public void _DropCapCharStyleName() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("DropCapCharStyleName", charStyleTester) ;
+ }
+
+ /**
+ * Tested with custom property tester.
+ */
+ public void _ParaStyleName() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("ParaStyleName", ParaStyleTester) ;
+ }
+
+ /**
+ * Tested with custom property tester.
+ */
+ public void _PageDescName() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("PageDescName", PageDescTester) ;
+ }
+
+ /**
+ * Tested with custom property tester. Before testing property
+ * <code>ParaAdjust</code> is setting to value <code>BLOCK</code>
+ * because setting the property <code>ParaLastLineAdjust</code>
+ * makes sense only in this case.
+ */
+ public void _ParaLastLineAdjust() {
+ log.println("Testing with custom Property tester") ;
+ try {
+ oObj.setPropertyValue("ParaAdjust",
+ com.sun.star.style.ParagraphAdjust.BLOCK);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured setting property 'ParagraphAdjust'" + e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured setting property 'ParagraphAdjust'" + e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured setting property 'ParagraphAdjust'" + e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured setting property 'ParagraphAdjust'" + e);
+ }
+ testProperty("ParaLastLineAdjust", ShortTester) ;
+ }
+
+ /**
+ * Tested with custom property tester.
+ */
+ public void _ParaBackGraphicURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("ParaBackGraphicURL", URLTester) ;
+ }
+
+ /**
+ * Tested with custom property tester. <p>
+ * The following property tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> NumberingStyleName </code> : a numbering style must
+ * be set before testing this property </li>
+ * </ul>
+ */
+ public void _NumberingLevel() {
+ requiredMethod("NumberingStyleName");
+ log.println("Testing with custom Property tester") ;
+ testProperty("NumberingLevel", ShortTester) ;
+ }
+
+ /**
+ * Tested with custom property tester.
+ */
+ public void _ParaVertAlignment() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("ParaVertAlignment", ShortTester) ;
+ }
+
+ /**
+ * Tested with custom property tester. <p>
+ * The following property tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> NumberingStyleName </code> : a numbering style must
+ * be set before testing this property </li>
+ * </ul>
+ */
+ public void _NumberingRules() {
+ requiredMethod("NumberingStyleName");
+ testProperty("NumberingRules",rules);
+ }
+} // finish class _ParagraphProperties
+
diff --git a/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesAsian.java b/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesAsian.java
new file mode 100644
index 000000000000..4f12d09ea763
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesAsian.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ParagraphPropertiesAsian.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:12:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.style;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.style.ParagraphPropertiesAsian</code>
+* service properties :
+* <ul>
+* <li><code> ParaIsHangingPunctuation </code></li>
+* <li><code> ParaIsCharacterDistance </code></li>
+* <li><code> ParaIsForbiddenRules </code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.style.ParagraphProperties
+*/
+public class _ParagraphPropertiesAsian extends MultiPropertyTest {
+
+} // finish class _ParagraphProperties
+
diff --git a/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesComplex.java b/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesComplex.java
new file mode 100644
index 000000000000..acd2239c736a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/style/_ParagraphPropertiesComplex.java
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ParagraphPropertiesComplex.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.style;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.style.ParagraphPropertiesComplex</code>
+*
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.style.ParagraphPropertiesComplex
+*/
+public class _ParagraphPropertiesComplex extends MultiPropertyTest {
+
+
+ protected PropertyTester WritingModeTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if ((oldValue != null) && (oldValue.equals(new Short(com.sun.star.text.WritingMode2.LR_TB))))
+ return new Short(com.sun.star.text.WritingMode2.PAGE); else
+ return new Short(com.sun.star.text.WritingMode2.LR_TB);
+ }
+ } ;
+
+ public void _WritingMode() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("WritingMode", WritingModeTester) ;
+ }
+
+} // finish class _ParagraphPropertiesComplex
+
diff --git a/qadevOOo/tests/java/ifc/style/_Style.java b/qadevOOo/tests/java/ifc/style/_Style.java
new file mode 100644
index 000000000000..243df53d71ca
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/style/_Style.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Style.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.style;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.style.Style</code>
+* service properties :
+* <ul>
+* <li><code> IsPhysical</code></li>
+* <li><code> FollowStyle</code></li>
+* <li><code> DisplayName</code></li>
+* <li><code> IsAutoUpdate</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.style.Style
+*/
+public class _Style extends MultiPropertyTest {
+
+} // finish class _Style
+
+
diff --git a/qadevOOo/tests/java/ifc/style/_XStyle.java b/qadevOOo/tests/java/ifc/style/_XStyle.java
new file mode 100644
index 000000000000..6465d335e7fb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/style/_XStyle.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XStyle.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.style;
+
+import com.sun.star.style.XStyle;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.style.XStyle</code>
+* interface methods :
+* <ul>
+* <li><code> isUserDefined()</code></li>
+* <li><code> isInUse()</code></li>
+* <li><code> getParentStyle()</code></li>
+* <li><code> setParentStyle()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'PoolStyle'</code> (of type <code>XStyle</code>):
+* some style from the SOffice collection (not user defined) </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.style.XStyle
+*/
+public class _XStyle extends MultiMethodTest {
+
+ public XStyle oObj = null;
+ XStyle oMyStyle = null;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ oMyStyle = (XStyle) tEnv.getObjRelation("PoolStyle");
+ if (oMyStyle == null) throw new StatusException
+ (Status.failed("Relation not found")) ;
+ }
+
+ /**
+ * Gets the parent style . <p>
+ * Has <b> OK </b> status if the name of style returned is
+ * equal to the name of style which was set before. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setParentStyle() </code> : to set the parent style </li>
+ * </ul>
+ */
+ public void _getParentStyle() {
+ requiredMethod("setParentStyle()");
+ tRes.tested("getParentStyle()",
+ oObj.getParentStyle().equals(oMyStyle.getName()));
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method sreturns <code>true</code>. <p>
+ */
+ public void _isInUse() {
+ tRes.tested("isInUse()",oObj.isInUse());
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>. <p>
+ */
+ public void _isUserDefined() {
+ tRes.tested("isUserDefined()",
+ oObj.isUserDefined() && !oMyStyle.isUserDefined() );
+ }
+
+ /**
+ * Sets the style name which was passed as relation. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _setParentStyle() {
+ boolean result = true ;
+ try {
+ oObj.setParentStyle(oMyStyle.getName());
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Exception occured while method call: " + e);
+ result = false ;
+ }
+
+ tRes.tested("setParentStyle()",result);
+ }
+} //finish class _XStyle
+
diff --git a/qadevOOo/tests/java/ifc/style/_XStyleFamiliesSupplier.java b/qadevOOo/tests/java/ifc/style/_XStyleFamiliesSupplier.java
new file mode 100644
index 000000000000..4ca9fc7a239b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/style/_XStyleFamiliesSupplier.java
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XStyleFamiliesSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.style;
+
+import com.sun.star.style.XStyleFamiliesSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.style.XStyleFamiliesSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getStyleFamilies()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.style.XStyleFamiliesSupplier
+*/
+public class _XStyleFamiliesSupplier extends MultiMethodTest {
+
+ public XStyleFamiliesSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not null value.
+ */
+ public void _getStyleFamilies() {
+ tRes.tested("getStyleFamilies()",oObj.getStyleFamilies() != null);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/system/_XProxySettings.java b/qadevOOo/tests/java/ifc/system/_XProxySettings.java
new file mode 100644
index 000000000000..34a6bcd86f08
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/system/_XProxySettings.java
@@ -0,0 +1,337 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XProxySettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.system;
+
+import com.sun.star.system.XProxySettings;
+import java.util.Hashtable;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Tests <code>com.sun.star.system.XProxySettings</code> interface. The result
+ * of each method is compared with expected settings which is specified by the
+ * caller of the tests via object relation "XProxySettings.proxaSettings". That
+ * should be a Hashtable containing the following keys:
+ * <ul>
+ * <li>ftpProxyAddress</li>
+ * <li>ftpProxyPort</li>
+ * <li>gopherProxyAddress</li>
+ * <li>gopherProxyPort</li>
+ * <li>httpProxyAddress</li>
+ * <li>httpProxyPort</li>
+ * <li>httpsProxyAddress</li>
+ * <li>httpsProxyPort</li>
+ * <li>socksProxyAddress</li>
+ * <li>socksProxyPort</li>
+ * <li>proxyBypassAddress</li>
+ * <li>proxyEnabled</li>
+ * </ul>.
+ * Each value for a key, should be a String specifying the correct result of
+ * the corresponding getXXX() method of XProxySettings interface.
+ * <p>If the object relation is not specified the test failes.
+ *
+ */
+public class _XProxySettings extends MultiMethodTest {
+ public XProxySettings oObj;
+
+ /**
+ * Contains a Hashtable with correct results of the tested methods. See
+ * the class description.
+ */
+ Hashtable expectedProxies;
+
+ /**
+ * Checks that the "XProxySettings.proxySettings" object relation is
+ * specified and stores its value to <code>expectedProxies</code> field.
+ *
+ * @throws StatusException is the object relation is not specified.
+ *
+ * @see #expectedProxies
+ */
+ public void before() {
+ expectedProxies = (Hashtable)tEnv.getObjRelation(
+ "XProxySettings.proxySettings");
+
+ if (expectedProxies == null) {
+ throw new StatusException(
+ Status.failed("Expected proxy settings are not specified"));
+ }
+ }
+
+ /**
+ * Calls <code>getFtpProxyAddress()</code> and verifies its result with
+ * "ftpProxyAddress" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getFtpProxyAddress() {
+ String ftpProxyAddress = oObj.getFtpProxyAddress();
+ String expectedFtpProxyAddress = (String)
+ expectedProxies.get("ftpProxyAddress");
+
+ log.println("getFtpProxyAddress");
+ log.println("getting: "+ftpProxyAddress);
+ log.println("expected: "+expectedFtpProxyAddress);
+
+ tRes.tested("getFtpProxyAddress()",
+ ftpProxyAddress.equals(expectedFtpProxyAddress));
+ }
+
+ /**
+ * Calls <code>getFtpProxyPort()</code> and verifies its result with
+ * "ftpProxyPort" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getFtpProxyPort() {
+ String ftpProxyPort = oObj.getFtpProxyPort();
+ String expectedFtpProxyPort = (String)
+ expectedProxies.get("ftpProxyPort");
+
+ log.println("getFtpProxyPort");
+ log.println("getting: "+ftpProxyPort);
+ log.println("expected: "+expectedFtpProxyPort);
+
+ tRes.tested("getFtpProxyPort()",
+ ftpProxyPort.equals(expectedFtpProxyPort));
+ }
+
+ /**
+ * Calls <code>getGopherProxyAddress()</code> and verifies its result with
+ * "gopherProxyAddress" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getGopherProxyAddress() {
+ String gopherProxyAddress = oObj.getGopherProxyAddress();
+ String expectedGopherProxyAddress = (String)
+ expectedProxies.get("gopherProxyAddress");
+
+ tRes.tested("getGopherProxyAddress()",
+ gopherProxyAddress.equals(expectedGopherProxyAddress));
+ }
+
+ /**
+ * Calls <code>getGopherProxyPort()</code> and verifies its result with
+ * "gopherProxyPort" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getGopherProxyPort() {
+ String gopherProxyPort = oObj.getGopherProxyPort();
+ String expectedGopherProxyPort = (String)
+ expectedProxies.get("gopherProxyPort");
+
+ tRes.tested("getGopherProxyPort()",
+ gopherProxyPort.equals(expectedGopherProxyPort));
+ }
+
+ /**
+ * Calls <code>getHttpProxyAddress()</code> and verifies its result with
+ * "httpProxyAddress" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getHttpProxyAddress() {
+ String httpProxyAddress = oObj.getHttpProxyAddress();
+ String expectedHttpProxyAddress = (String)
+ expectedProxies.get("httpProxyAddress");
+
+ log.println("getHttpProxyAddress");
+ log.println("getting: "+httpProxyAddress);
+ log.println("expected: "+expectedHttpProxyAddress);
+
+ tRes.tested("getHttpProxyAddress()",
+ httpProxyAddress.equals(expectedHttpProxyAddress));
+ }
+
+ /**
+ * Calls <code>getHttpProxyPort()</code> and verifies its result with
+ * "httpProxyPort" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getHttpProxyPort() {
+ String httpProxyPort = oObj.getHttpProxyPort();
+ String expectedHttpProxyPort = (String)
+ expectedProxies.get("httpProxyPort");
+
+ log.println("getHttpProxyPort");
+ log.println("getting: "+httpProxyPort);
+ log.println("expected: "+expectedHttpProxyPort);
+
+ tRes.tested("getHttpProxyPort()",
+ httpProxyPort.equals(expectedHttpProxyPort));
+ }
+
+ /**
+ * Calls <code>getHttpsProxyAddress()</code> and verifies its result with
+ * "httpsProxyAddress" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getHttpsProxyAddress() {
+ String httpsProxyAddress = oObj.getHttpsProxyAddress();
+ String expectedHttpsProxyAddress = (String)
+ expectedProxies.get("httpsProxyAddress");
+
+ log.println("getHttpsProxyAddress");
+ log.println("getting: "+httpsProxyAddress);
+ log.println("expected: "+expectedHttpsProxyAddress);
+
+ tRes.tested("getHttpsProxyAddress()",
+ httpsProxyAddress.equals(expectedHttpsProxyAddress));
+ }
+
+ /**
+ * Calls <code>getHttpsProxyPort()</code> and verifies its result with
+ * "httpsProxyPort" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getHttpsProxyPort() {
+ String httpsProxyPort = oObj.getHttpsProxyPort();
+ String expectedHttpsProxyPort = (String)
+ expectedProxies.get("httpsProxyPort");
+
+ log.println("getHttpsProxyPort");
+ log.println("getting: "+httpsProxyPort);
+ log.println("expected: "+expectedHttpsProxyPort);
+
+ tRes.tested("getHttpsProxyPort()",
+ httpsProxyPort.equals(expectedHttpsProxyPort));
+ }
+
+ /**
+ * Calls <code>getProxyBypassAddress()</code> and verifies its result with
+ * "proxyBypassAddress" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getProxyBypassAddress() {
+ String proxyBypassAddress = oObj.getProxyBypassAddress();
+ String expectedProxyBypassAddress = (String)
+ expectedProxies.get("proxyBypassAddress");
+
+ log.println("getProxyBypassAddress");
+ log.println("getting: "+proxyBypassAddress);
+ log.println("expected: "+expectedProxyBypassAddress);
+
+ tRes.tested("getProxyBypassAddress()",
+ proxyBypassAddress.equals(expectedProxyBypassAddress));
+ }
+
+ /**
+ * Calls <code>getSocksProxyAddress()</code> and verifies its result with
+ * "socksProxyAddress" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getSocksProxyAddress() {
+ String socksProxyAddress = oObj.getSocksProxyAddress();
+ String expectedSocksProxyAddress = (String)
+ expectedProxies.get("socksProxyAddress");
+
+ log.println("getSocksProxyAddress");
+ log.println("getting: "+socksProxyAddress);
+ log.println("expected: "+expectedSocksProxyAddress);
+
+ tRes.tested("getSocksProxyAddress()",
+ socksProxyAddress.equals(expectedSocksProxyAddress));
+ }
+
+ /**
+ * Calls <code>getSocksProxyPort()</code> and verifies its result with
+ * "socksProxyPort" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _getSocksProxyPort() {
+ String socksProxyPort = oObj.getSocksProxyPort();
+ String expectedSocksProxyPort = (String)
+ expectedProxies.get("socksProxyPort");
+
+ log.println("getSocksProxyPort");
+ log.println("getting: "+socksProxyPort);
+ log.println("expected: "+expectedSocksProxyPort);
+
+ tRes.tested("getSocksProxyPort()",
+ socksProxyPort.equals(expectedSocksProxyPort));
+ }
+
+ /**
+ * Calls <code>isProxyEnabled()</code> and verifies its result with
+ * "proxyEnabled" value of <code>expectedProxies</code>.
+ *
+ * @see #expectedProxies
+ */
+ public void _isProxyEnabled() {
+ boolean proxyEnabled = oObj.isProxyEnabled();
+
+ String proxyEnabledStr = (String)expectedProxies.get("proxyEnabled");
+ boolean expected = proxyEnabledStr != null
+ && proxyEnabledStr.equalsIgnoreCase("true");
+
+ tRes.tested("isProxyEnabled()", proxyEnabled == expected);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/system/_XSimpleMailClientSupplier.java b/qadevOOo/tests/java/ifc/system/_XSimpleMailClientSupplier.java
new file mode 100644
index 000000000000..c950013287fe
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/system/_XSimpleMailClientSupplier.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSimpleMailClientSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.system;
+
+import com.sun.star.system.XSimpleMailClient;
+import com.sun.star.system.XSimpleMailClientSupplier;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.system.XSimpleMailClientSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> querySimpleMailClient()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'SystemMailExist'</code> (of type <code>Boolean</code>):
+* if <code>true</code> then <code>SimpleSystemMail</code> service
+* is available, if NOT then the service is not availabel or
+* OS doesn't has system mail.</li>
+* <ul> <p>
+* @see com.sun.star.system.XSimpleMailClientSupplier
+*/
+public class _XSimpleMailClientSupplier extends MultiMethodTest {
+
+ public XSimpleMailClientSupplier oObj = null;
+
+ /**
+ * Test calls the method if the <code>SimpleSystemMail</code>
+ * service is available on current OS. <p>
+ * Has <b> OK </b> status if not null value returned or
+ * has <b>SKIPPED.OK</b> status if SystemMail is not available. <p>
+ */
+ public void _querySimpleMailClient() {
+ if (Boolean.TRUE.equals
+ ((Boolean)tEnv.getObjRelation("SystemMailExist"))) {
+
+ XSimpleMailClient aClient = oObj.querySimpleMailClient();
+ tRes.tested("querySimpleMailClient()",aClient != null);
+ } else {
+ log.println("SystemMail doesn't exist : nothing to test") ;
+ tRes.tested("querySimpleMailClient()", tRes.skipped(true)) ;
+ }
+ }
+
+
+} // finish class _XSimpleMailClientSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java b/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java
new file mode 100644
index 000000000000..63ab31614de9
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSystemShellExecute.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.system;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.system.XSystemShellExecute;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import util.utils;
+
+
+/**
+* Testing <code>com.sun.star.system.XSystemShellExecute</code>
+* interface methods :
+* <ul>
+* <li><code> execute()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.system.XSystemShellExecute
+*/
+public class _XSystemShellExecute extends MultiMethodTest {
+
+ public XSystemShellExecute oObj = null;
+
+ /**
+ * Excecutes 'java SystemShellExecute SystemShellExecute.txt' command line.
+ * <p>Has <b> OK </b> status if the method successfully returns
+ * and file 'SystemShellExecute.txt' was created. <p>
+ */
+ public void _execute() {
+ String cClassPath = System.getProperty("DOCPTH");
+ String cResFile = utils.getOfficeTempDirSys(tParam.getMSF())+"SystemShellExecute.txt";
+ String cResURL = utils.getOfficeTemp(tParam.getMSF())+"SystemShellExecute.txt";
+ String cArgs = "-classpath " + cClassPath +
+ " SystemShellExecute " + cResFile;
+
+ String jh = System.getProperty("java.home");
+ String fs = System.getProperty("file.separator");
+ String cmd = jh+fs+"bin"+fs+"java";
+
+ log.println("Executing : '"+cmd+" " + cArgs + "'");
+ try {
+ oObj.execute(cmd, cArgs, 1);
+ } catch (com.sun.star.system.SystemShellExecuteException e) {
+ log.println("Exception during execute: " + e);
+ log.println("This has been implemented due to security reasons");
+ tRes.tested("execute()", true);
+ return;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception during execute: " + e);
+ tRes.tested("execute()", false);
+ return;
+ }
+
+ XSimpleFileAccess xFileAccess = null;
+ try {
+ XMultiServiceFactory xMSF = tParam.getMSF();
+ Object fa = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
+ xFileAccess = (XSimpleFileAccess)
+ UnoRuntime.queryInterface(XSimpleFileAccess.class, fa);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't create SimpleFileAccess:" + e);
+ tRes.tested("execute()", false);
+ }
+
+ log.println("Waiting while the file will be created or timeout "+
+ "reached ...");
+ boolean bExist = false;
+ int i = 0;
+ while (i < 20 && !bExist) {
+ try {
+ bExist = xFileAccess.exists(cResURL);
+ } catch(com.sun.star.uno.Exception e) {
+ log.println("Exception:" + e);
+ }
+ shortWait();
+ i++;
+ }
+
+ if (bExist) {
+ log.println("The command was executed and file created in " +
+ i + " sec.");
+ } else {
+ log.println("File was not created");
+ }
+
+ tRes.tested("execute()", bExist);
+ }
+
+ /**
+ * Sleeps 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 _XSystemShellExecute
+
+
diff --git a/qadevOOo/tests/java/ifc/table/_CellProperties.java b/qadevOOo/tests/java/ifc/table/_CellProperties.java
new file mode 100644
index 000000000000..2c1bf78c9555
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_CellProperties.java
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CellProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import lib.MultiPropertyTest;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.xml.AttributeData;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+
+/**
+* Testing <code>com.sun.star.table.CellProperties</code>
+* service properties :
+* <ul>
+* <li><code> CellStyle</code></li>
+* <li><code> CellBackColor</code></li>
+* <li><code> IsCellBackgroundTransparent</code></li>
+* <li><code> NumberFormat</code></li>
+* <li><code> ShadowFormat</code></li>
+* <li><code> HoriJustify</code></li>
+* <li><code> VertJustify</code></li>
+* <li><code> Orientation</code></li>
+* <li><code> CellProtection</code></li>
+* <li><code> TableBorder</code></li>
+* <li><code> IsTextWrapped</code></li>
+* <li><code> RotateAngle</code></li>
+* <li><code> RotateReference</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.table.CellProperties
+*/
+public class _CellProperties extends MultiPropertyTest {
+
+
+ /**
+ * This property is tested with custom property tester which
+ * switches between 'Default' and 'Result' style names.
+ */
+ public void _CellStyle() {
+ testProperty("CellStyle", new PropertyTester() {
+ protected Object getNewValue(String name, Object old) {
+ return "Default".equals(old) ? "Result" : "Default" ;
+ }
+ }) ;
+ }
+
+ public void _UserDefinedAttributes() {
+ XNameContainer uda = null;
+ boolean res = false;
+ try {
+ //uda = (XNameContainer) new util.NameContainerImpl();
+ uda = (XNameContainer) oObj.getPropertyValue("UserDefinedAttributes");
+ AttributeData attr = new AttributeData();
+ attr.Namespace = "http://www.sun.com/staroffice/apitest/Cellprop";
+ attr.Type="CDATA";
+ attr.Value="true";
+ uda.insertByName("Cellprop:has-first-alien-attribute",attr);
+ String[] els = uda.getElementNames();
+ oObj.setPropertyValue("UserDefinedAttributes",uda);
+ uda = (XNameContainer) oObj.getPropertyValue("UserDefinedAttributes");
+ els = uda.getElementNames();
+ Object obj = uda.getByName("Cellprop:has-first-alien-attribute");
+ res = true;
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ log.println("Don't know the Property 'UserDefinedAttributes'");
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ log.println("WrappedTargetException while getting Property 'UserDefinedAttributes'");
+ } catch (com.sun.star.container.NoSuchElementException nee) {
+ log.println("added Element isn't part of the NameContainer");
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ log.println("IllegalArgumentException while getting Property 'UserDefinedAttributes'");
+ } catch (com.sun.star.beans.PropertyVetoException pve) {
+ log.println("PropertyVetoException while getting Property 'UserDefinedAttributes'");
+ } catch (com.sun.star.container.ElementExistException eee) {
+ log.println("ElementExistException while getting Property 'UserDefinedAttributes'");
+ }
+ tRes.tested("UserDefinedAttributes",res);
+ }
+
+} // finish class _CellProperties
+
diff --git a/qadevOOo/tests/java/ifc/table/_TableColumn.java b/qadevOOo/tests/java/ifc/table/_TableColumn.java
new file mode 100644
index 000000000000..709deb36619e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_TableColumn.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TableColumn.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiPropertyTest;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.table.TableColumn</code>
+* service properties :
+* <ul>
+* <li><code> Width</code></li>
+* <li><code> OptimalWidth</code></li>
+* <li><code> IsVisible</code></li>
+* <li><code> IsStartOfNewPage</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.table.TableColumn
+*/
+public class _TableColumn extends MultiPropertyTest {
+
+ public void _OptimalWidth() {
+ boolean res = false;
+ try {
+ XInterface tObject = tEnv.getTestObject();
+ XCellRange aRange = (XCellRange)
+ UnoRuntime.queryInterface(XCellRange.class, tObject);
+ aRange.getCellByPosition(0,0).setFormula("Thats a pretty long text");
+ Object width_before = oObj.getPropertyValue("Width");
+ log.println("Before setting to optimal width: "+width_before);
+ oObj.setPropertyValue("OptimalWidth", new Boolean(true));
+ Object width_after = oObj.getPropertyValue("Width");
+ log.println("After setting to optimal width: "+width_after);
+ res = ! ValueComparer.equalValue(width_before,width_after);
+ } catch (Exception e) {
+ res = false;
+ e.printStackTrace(log);
+ }
+
+ tRes.tested("OptimalWidth",res );
+ }
+
+} //finish class _TableColumn
+
+
diff --git a/qadevOOo/tests/java/ifc/table/_TableRow.java b/qadevOOo/tests/java/ifc/table/_TableRow.java
new file mode 100644
index 000000000000..4db7251c7a23
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_TableRow.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TableRow.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.table.TableRow</code>
+* service properties :
+* <ul>
+* <li><code> Height</code></li>
+* <li><code> OptimalHeight</code></li>
+* <li><code> IsVisible</code></li>
+* <li><code> IsStartOfNewPage</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.table.TableRow
+*/
+public class _TableRow extends MultiPropertyTest {
+
+} // finish class _TableRow
+
diff --git a/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java b/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java
new file mode 100644
index 000000000000..4e7aadd24a14
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAutoFormattable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.table.XAutoFormattable;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.util.Random;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.table.XAutoFormattable</code>
+* interface methods :
+* <ul>
+* <li><code> autoFormat()</code></li>
+* </ul> <p>
+* The component tested <b>must implement</b> interface
+* <code>com.sun.star.table.XCellRange</code>. <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.table.XAutoFormattable
+*/
+public class _XAutoFormattable extends MultiMethodTest {
+ public XAutoFormattable oObj = null;
+
+ /**
+ * First 'Default' autoformat is set and a background of a cell
+ * is obtained. Then any other autoformat is set and background
+ * of a cell is obtained again.<p>
+ * Has <b> OK </b> status if backgrounds with different autoformat
+ * settings are differ. <p>
+ */
+ public void _autoFormat() {
+ boolean bResult = true;
+ XMultiServiceFactory oMSF = tParam.getMSF();
+ String name = "Default";
+
+ try {
+ oObj.autoFormat(name); // applying default format
+
+ // getting current background of the cell
+ XCellRange cellRange = (XCellRange)UnoRuntime.
+ queryInterface(XCellRange.class, oObj);
+ XCell oCell = cellRange.getCellByPosition(0, 0);
+ XPropertySet PS = (XPropertySet)UnoRuntime.
+ queryInterface(XPropertySet.class, oCell);
+
+ Integer bkgrnd1 = (Integer)PS.getPropertyValue("BackColor");
+
+ // getting formats names.
+ XInterface iFormats = (XInterface)oMSF.
+ createInstance("com.sun.star.sheet.TableAutoFormats");
+ XNameAccess formats = (XNameAccess)UnoRuntime.
+ queryInterface(XNameAccess.class, iFormats);
+ String[] names = formats.getElementNames();
+
+ // getting one random not default style name
+ Random rnd = new Random();
+ if (names.length > 1) {
+ while (name.equals("Default")) {
+ name = names[rnd.nextInt(names.length)];
+ }
+ }
+ else {
+ name = names[0];
+ }
+
+ log.println("Applying style " + name);
+ // applying style
+ oObj.autoFormat(name);
+
+ // getting new cell's backround.
+ Integer bkgrnd2 = (Integer)PS.getPropertyValue("BackColor");
+
+ bResult &= !bkgrnd1.equals(bkgrnd2);
+
+ } catch(com.sun.star.uno.Exception e) {
+ log.println("Exception occured :");
+ e.printStackTrace(log);
+ bResult = false;
+ }
+
+ tRes.tested("autoFormat()", bResult);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/table/_XCell.java b/qadevOOo/tests/java/ifc/table/_XCell.java
new file mode 100644
index 000000000000..be91b5856fcd
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XCell.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCell.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.table.CellContentType;
+import com.sun.star.table.XCell;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.table.XCell</code>
+* interface methods :
+* <ul>
+* <li><code> getFormula()</code></li>
+* <li><code> setFormula()</code></li>
+* <li><code> getValue()</code></li>
+* <li><code> setValue()</code></li>
+* <li><code> getType()</code></li>
+* <li><code> getError()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.table.XCell
+*/
+public class _XCell extends MultiMethodTest {
+ public XCell oObj = null;
+
+ /**
+ * First time errors checked when a proper formula is entered.
+ * Second time an incorrect formula entered and errors are checked.<p>
+ * Has <b> OK </b> status if in the first case error code 0 returned,
+ * and in the second case none-zerro code returned. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setFormula() </code> : the method must set proper
+ * formula into cell, so there must be no errors </li>
+ * </ul>
+ */
+ public void _getError() {
+ requiredMethod("setFormula()") ;
+
+ boolean result = true;
+
+ if (oObj.getError() != 0) {
+ result = false ;
+ log.println("getError(): Expected error code is 0, but returned " +
+ oObj.getError()) ;
+ }
+ oObj.setFormula("=sqrt(-2)") ; // incorrect formula
+ if (oObj.getError() == 0) {
+ result = false ;
+ log.println("getError(): # Non zero error code expected,"+
+ " but 0 returned") ;
+ }
+
+ tRes.tested("getError()", result);
+ } // end getError()
+
+ /**
+ * Sets a formula and then gets it. <p>
+ * Has <b> OK </b> status if the formula set are the same as get. <p>
+ */
+ public void _getFormula() {
+ boolean result = true;
+
+ String formula = "";
+ log.println("getFormula()");
+ oObj.setFormula("=2+2");
+
+ formula = (String) oObj.getFormula();
+
+ result &= formula.endsWith("2+2");
+ tRes.tested("getFormula()", result);
+ } // end getFormula()
+
+ /**
+ * Gets the type and check it. <p>
+ * Has <b> OK </b> status if the type is one of valid values. <p>
+ */
+ public void _getType() {
+ boolean result = true;
+ result = true ;
+ log.println("getType() ...");
+
+ if(oObj.getType() == CellContentType.EMPTY) result &= true ;
+ else if (oObj.getType() == CellContentType.VALUE) result &= true ;
+ else if (oObj.getType() == CellContentType.TEXT) result &= true ;
+ else if (oObj.getType() == CellContentType.FORMULA) result &= true ;
+ else result = false;
+
+ tRes.tested ("getType()", result) ;
+ } // end getType()
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _getValue() {
+ boolean result = true;
+ double value = 0;
+ log.println("getValue() ...");
+
+ value = (double) oObj.getValue();
+
+ tRes.tested("getValue()",result);
+ } // end getValue()
+
+ /**
+ * Sets a formula and then gets it. <p>
+ * Has <b> OK </b> status if the formula set are the same as get. <p>
+ */
+ public void _setFormula() {
+ boolean result = true;
+ String formula = "";
+ log.println("setFormula() ...");
+
+ oObj.setFormula("=2/6") ;
+
+ formula = (String) oObj.getFormula();
+
+ result &= formula.endsWith("2/6");
+ tRes.tested ("setFormula()", result) ;
+ } // end setFormula
+
+ /**
+ * Sets a value and then gets it. <p>
+ * Has <b> OK </b> status if the value set is equal to value get. <p>
+ */
+ public void _setValue() {
+ boolean result = true;
+ double cellValue = 0;
+ log.println("setValue() ...");
+
+ oObj.setValue(222.333) ;
+ cellValue = (double) oObj.getValue() ;
+
+ result &= (cellValue == 222.333);
+ tRes.tested("setValue()", result);
+ } // end setValue()
+}
+
diff --git a/qadevOOo/tests/java/ifc/table/_XCellCursor.java b/qadevOOo/tests/java/ifc/table/_XCellCursor.java
new file mode 100644
index 000000000000..92324c498206
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XCellCursor.java
@@ -0,0 +1,280 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCellCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSheetCellCursor;
+import com.sun.star.sheet.XSheetCellRange;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCellCursor;
+import com.sun.star.table.XCellRange;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.table.XCellCursor</code>
+* interface methods :
+* <ul>
+* <li><code> gotoStart()</code></li>
+* <li><code> gotoEnd()</code></li>
+* <li><code> gotoNext()</code></li>
+* <li><code> gotoPrevious()</code></li>
+* <li><code> gotoOffset()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'SHEET'</code> (of type <code>XSpreadsheet</code>):
+* is used for creating a new cell range.</li>
+* <ul> <p>
+*
+* The component tested <b>must implement</b>
+* <code>XCellRangeAddressable</code> interface. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.table.XCellCursor
+*/
+public class _XCellCursor extends MultiMethodTest {
+
+ public static XCellCursor oObj = null;
+ public static XSpreadsheet oSheet = null;
+
+ /**
+ * <code>XCellRangeAddressable</code> interface is queried
+ * first for getting current position of cursor. The cursor
+ * is moved to next cell. Address of cursor obtained before
+ * and after moving. <p>
+ * Has <b> OK </b> status if cursor column is changed after
+ * movement. <p>
+ */
+ public void _gotoNext(){
+ boolean bResult = false;
+ int startCol, endCol, startRow, endRow = 0;
+ int startCol2, endCol2, startRow2, endRow2 = 0;
+
+ XCellRangeAddressable oRange = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj);
+ CellRangeAddress oAddr = oRange.getRangeAddress();
+ startRow = oAddr.StartRow;
+ startCol = oAddr.StartColumn;
+ endRow = oAddr.EndRow;
+ endCol = oAddr.EndColumn;
+
+ oObj.gotoNext();
+
+ oAddr = oRange.getRangeAddress();
+ startRow2 = oAddr.StartRow;
+ startCol2 = oAddr.StartColumn;
+ endRow2 = oAddr.EndRow;
+ endCol2 = oAddr.EndColumn;
+
+ if (!(startCol == startCol2)){
+ bResult = true;
+ }
+ tRes.tested( "gotoNext()", bResult );
+ }
+
+ /**
+ * <code>XCellRangeAddressable</code> interface is queried
+ * first for getting current position of cursor. The cursor
+ * is moved then. Address of cursor obtained before
+ * and after moving. <p>
+ * Has <b> OK </b> status if starting column and row of
+ * cursor is changed after movement. <p>
+ */
+ public void _gotoOffset(){
+ boolean bResult = false;
+ int startCol, endCol, startRow, endRow = 0;
+ int startCol2, endCol2, startRow2, endRow2 = 0;
+
+ XCellRangeAddressable oRange = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj);
+ CellRangeAddress oAddr = oRange.getRangeAddress();
+ startRow = oAddr.StartRow;
+ startCol = oAddr.StartColumn;
+ endRow = oAddr.EndRow;
+ endCol = oAddr.EndColumn;
+
+ oObj.gotoOffset(4,4);
+
+ oAddr = oRange.getRangeAddress();
+ startRow2 = oAddr.StartRow;
+ startCol2 = oAddr.StartColumn;
+ endRow2 = oAddr.EndRow;
+ endCol2 = oAddr.EndColumn;
+ if (!(startCol == startCol2) || (startRow == startRow2)){
+ bResult = true;
+ }
+ tRes.tested( "gotoOffset()", bResult );
+ }
+
+ /**
+ * <code>XCellRangeAddressable</code> interface is queried
+ * first for getting current position of cursor. The cursor
+ * is moved to previous cell. Address of cursor obtained before
+ * and after moving. <p>
+ * Has <b> OK </b> status if cursor column is changed after
+ * movement. <p>
+ */
+ public void _gotoPrevious(){
+ boolean bResult = false;
+ int startCol, endCol, startRow, endRow = 0;
+ int startCol2, endCol2, startRow2, endRow2 = 0;
+
+ XCellRangeAddressable oRange = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj);
+ CellRangeAddress oAddr = oRange.getRangeAddress();
+ startRow = oAddr.StartRow;
+ startCol = oAddr.StartColumn;
+ endRow = oAddr.EndRow;
+ endCol = oAddr.EndColumn;
+
+ oObj.gotoPrevious();
+
+ oAddr = oRange.getRangeAddress();
+ startRow2 = oAddr.StartRow;
+ startCol2 = oAddr.StartColumn;
+ endRow2 = oAddr.EndRow;
+ endCol2 = oAddr.EndColumn;
+
+ if (!(startCol == startCol2)){
+ bResult = true;
+ }
+ tRes.tested( "gotoPrevious()", bResult );
+ }
+
+ /**
+ * <code>XCellRangeAddressable</code> interface is queried
+ * first for getting current position of cursor. The cursor
+ * is moved to the start of its range .
+ * Address of cursor obtained before and after moving. <p>
+ * Has <b> OK </b> status if cursor was collapsed to a single
+ * cell (i.e. start column is the same as end column) after
+ * movement. <p>
+ */
+ public void _gotoStart(){
+ boolean bResult = false;
+ int startCol, endCol, startRow, endRow = 0;
+
+ XCellRangeAddressable oRange = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj);
+ oObj.gotoStart();
+ CellRangeAddress oAddr = oRange.getRangeAddress();
+ startRow = oAddr.StartRow;
+ startCol = oAddr.StartColumn;
+ endRow = oAddr.EndRow;
+ endCol = oAddr.EndColumn;
+ if ((startCol == endCol) && (endRow == startRow)){
+ bResult = true;
+ }
+
+ tRes.tested( "gotoStart()", bResult );
+ }
+
+ /**
+ * A new cell range is created using spreadsheet passed by relation.
+ * The method is tested on that range. <code>gotoEnd</code> is
+ * called and range address is checked.<p>
+ * Has <b> OK </b> status if cursor was collapsed to a single
+ * cell (i.e. start column is the same as end column) after
+ * movement. <p>
+ */
+ public void _gotoEnd(){
+ //gotoEnd gets it's own cursor to see a change
+ oSheet = (XSpreadsheet) tEnv.getObjRelation("SHEET");
+ XCellRange testRange = oSheet.getCellRangeByName("$A$1:$g$7") ;
+ XSheetCellRange testSheetRange = (XSheetCellRange)
+ UnoRuntime.queryInterface(XSheetCellRange.class,testRange);
+ XSheetCellCursor oCellCursor = oSheet.createCursorByRange
+ (testSheetRange);
+ XCellCursor oCursor = (XCellCursor)
+ UnoRuntime.queryInterface(XCellCursor.class,oCellCursor);
+
+ boolean bResult = false;
+ int startCol, endCol, startRow, endRow = 0;
+
+ XCellRangeAddressable oRange = (XCellRangeAddressable)
+ UnoRuntime.queryInterface(XCellRangeAddressable.class, oCursor);
+ oCursor.gotoEnd();
+ CellRangeAddress oAddr = oRange.getRangeAddress();
+ startRow = oAddr.StartRow;
+ startCol = oAddr.StartColumn;
+ endRow = oAddr.EndRow;
+ endCol = oAddr.EndColumn;
+ if ((startCol == endCol) && (endRow == startRow)){
+ bResult = true;
+ }
+
+ tRes.tested( "gotoEnd()", bResult );
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ protected void after() {
+ disposeEnvironment();
+ }
+
+
+} //EOC _XCellCursor
+
diff --git a/qadevOOo/tests/java/ifc/table/_XCellRange.java b/qadevOOo/tests/java/ifc/table/_XCellRange.java
new file mode 100644
index 000000000000..445b92a98bd3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XCellRange.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCellRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.table.XCellRange</code>
+* interface methods :
+* <ul>
+* <li><code> getCellByPosition()</code></li>
+* <li><code> getCellRangeByPosition()</code></li>
+* <li><code> getCellRangeByName()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'ValidRange'</code> (of type <code>String</code>):
+* cell range that can be defined by the object test instead of
+* definition at this test ("<code>A1:A1</code>")</li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.table.XCellRange
+*/
+public class _XCellRange extends MultiMethodTest {
+ public XCellRange oObj = null;
+
+ /**
+ * First a cell get from valid position, second - from invalid. <p>
+ * Has <b> OK </b> status if in the first case not null value is
+ * returned and no exceptions are thrown, and in the second
+ * case <code>IndexOutOfBoundsException</code> is thrown. <p>
+ */
+ public void _getCellByPosition() {
+
+ boolean result = false;
+
+ try {
+ XCell cell = oObj.getCellByPosition(0,0);
+ result = cell != null ;
+ log.println("Getting cell by position with a valid position ... OK");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occurred while getting cell by position with a valid position");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ try {
+ oObj.getCellByPosition(-1,1);
+ log.println("No Exception occurred while getting cell by position with invalid position");
+ result &= false;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Getting cell by position with a invalid position ... OK");
+ result &= true;
+ }
+
+ tRes.tested( "getCellByPosition()", result );
+
+ } // end getCellByPosition()
+
+ /**
+ * A range is tried to obtain with valid name. <p>
+ * Has <b> OK </b> status if not null range is
+ * returned. <p>
+ */
+ public void _getCellRangeByName() {
+
+ boolean result = false;
+
+ String valid = (String) tEnv.getObjRelation("ValidRange");
+ if (valid == null ) valid = "A1:A1";
+ XCellRange range = oObj.getCellRangeByName(valid);
+ result = range != null ;
+ log.println("Getting cellrange by name with a valid name ... OK");
+
+ tRes.tested( "getCellRangeByName()", result );
+
+
+ } // end getCellRangeByName()
+
+ /**
+ * First a range is tried to obtain with valid bounds,
+ * second - with invalid. <p>
+ * Has <b> OK </b> status if in the first case not null range is
+ * returned and no exceptions are thrown, and in the second
+ * case <code>IndexOutOfBoundsException</code> is thrown. <p>
+ */
+ public void _getCellRangeByPosition() {
+
+ boolean result = false;
+
+ try {
+ XCellRange range = oObj.getCellRangeByPosition(0,0,0,0);
+ result = range != null;
+ log.println("Getting cellrange by Position with a valid position ... OK");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occurred while getting cellrange by position with a valid position");
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ try {
+ oObj.getCellRangeByPosition(-1,0,-1,1);
+ log.println("No Exception occurred while getting cellrange by position with invalid position");
+ result &= false;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Getting cellrange by position with a invalid position ... OK");
+ result &= true;
+ }
+
+ tRes.tested( "getCellRangeByPosition()", result );
+
+
+ } // end getCellRangeByPosition()
+
+} // finish class _XCellRange
+
diff --git a/qadevOOo/tests/java/ifc/table/_XColumnRowRange.java b/qadevOOo/tests/java/ifc/table/_XColumnRowRange.java
new file mode 100644
index 000000000000..1e8769fad135
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XColumnRowRange.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XColumnRowRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.table.XColumnRowRange;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.table.XColumnRowRange</code>
+* interface methods :
+* <ul>
+* <li><code> getColumns()</code></li>
+* <li><code> getRows()</code></li>
+* </ul> <p>
+* @see com.sun.star.table.XColumnRowRange
+*/
+public class _XColumnRowRange extends MultiMethodTest {
+
+ public XColumnRowRange oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getColumns() {
+ tRes.tested( "getColumns()", oObj.getColumns()!=null );
+ } // getColumns()
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not null value
+ * and no exceptions were thrown. <p>
+ */
+ public void _getRows() {
+ tRes.tested( "getRows()", oObj.getRows()!=null );
+ } // getRows()
+
+} // finish class _XColumnRowRange
+
diff --git a/qadevOOo/tests/java/ifc/table/_XTableChart.java b/qadevOOo/tests/java/ifc/table/_XTableChart.java
new file mode 100644
index 000000000000..2cd5e66106cb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XTableChart.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTableChart.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XTableChart;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.table.XTableChart</code>
+* interface methods :
+* <ul>
+* <li><code> getHasColumnHeaders()</code></li>
+* <li><code> setHasColumnHeaders()</code></li>
+* <li><code> getHasRowHeaders()</code></li>
+* <li><code> setHasRowHeaders()</code></li>
+* <li><code> getRanges()</code></li>
+* <li><code> setRanges()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.table.XTableChart
+*/
+public class _XTableChart extends MultiMethodTest {
+
+ public XTableChart oObj = null;
+
+ /**
+ * Sets the property to <code>false</code> and then check it. <p>
+ * Has <b> OK </b> status if the method returns <code>false</code>. <p>
+ */
+ public void _getHasColumnHeaders() {
+ oObj.setHasColumnHeaders(false);
+ tRes.tested("getHasColumnHeaders()", !oObj.getHasColumnHeaders() );
+ } // getHasColumnHeaders()
+
+ /**
+ * Sets the property to <code>true</code> and then check it. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>. <p>
+ */
+ public void _setHasColumnHeaders() {
+ oObj.setHasColumnHeaders(true);
+ tRes.tested("setHasColumnHeaders()", oObj.getHasColumnHeaders() );
+ } // setHasColumnHeaders()
+
+ /**
+ * Sets the property to <code>false</code> and then check it. <p>
+ * Has <b> OK </b> status if the method returns <code>false</code>. <p>
+ */
+ public void _getHasRowHeaders() {
+ oObj.setHasRowHeaders(false);
+ tRes.tested("getHasRowHeaders()", !oObj.getHasRowHeaders() );
+ } // getHasRowHeaders()
+
+ /**
+ * Sets the property to <code>true</code> and then check it. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>. <p>
+ */
+ public void _setHasRowHeaders() {
+ oObj.setHasRowHeaders(true);
+ tRes.tested("setHasRowHeaders()", oObj.getHasRowHeaders() );
+ } // setHasRowHeaders()
+
+ CellRangeAddress[] the_Ranges = null;
+
+ /**
+ * Test calls the method and stores the range returned. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> valuie. <p>
+ */
+ public void _getRanges() {
+ the_Ranges = oObj.getRanges();
+ tRes.tested("getRanges()", the_Ranges != null );
+ } // getRanges()
+
+ /**
+ * Changes the first range in range array obtained by
+ * <code>getRanges</code> method, then set changed array. <p>
+ * Has <b> OK </b> status if range array get is the same as was
+ * set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getRanges() </code> : to have initial ranges </li>
+ * </ul>
+ */
+ public void _setRanges() {
+ requiredMethod("getRanges()");
+ CellRangeAddress[] tmpRanges = oObj.getRanges();
+ tmpRanges[0].EndRow = 1;
+ oObj.setRanges(tmpRanges);
+ tRes.tested("setRanges()", ValueComparer.equalValue(
+ tmpRanges,oObj.getRanges()));
+ oObj.setRanges(the_Ranges);
+ } // getRanges()
+
+} // finish class _XTableChartsSupplier
+
+
+
diff --git a/qadevOOo/tests/java/ifc/table/_XTableCharts.java b/qadevOOo/tests/java/ifc/table/_XTableCharts.java
new file mode 100644
index 000000000000..68af2d08181a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XTableCharts.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTableCharts.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.awt.Rectangle;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XTableCharts;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.table.XTableCharts</code>
+* interface methods :
+* <ul>
+* <li><code> addNewByName()</code></li>
+* <li><code> removeByName()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'ADDR'</code>
+* (of type <code>com.sun.star.table.CellRangeAddress[]</code>):
+* data source ranges for chart creating. </li>
+* <li> <code>'RECT'</code>
+* (of type <code>com.sun.star.awt.Rectangle</code>):
+* the position of chart </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.table.XTableCharts
+*/
+public class _XTableCharts extends MultiMethodTest {
+
+ public XTableCharts oObj = null;
+
+ /**
+ * Adds a new chart into table with specified name . <p>
+ * Has <b> OK </b> status if <code>hasByName()</code> returns
+ * <code>true</code>. <p>
+ */
+ public void _addNewByName() {
+
+ CellRangeAddress[] the_Range = (CellRangeAddress[])
+ tEnv.getObjRelation("ADDR");
+ Rectangle the_rect = (Rectangle) tEnv.getObjRelation("RECT");
+ oObj.addNewByName("XTableCharts",the_rect,the_Range,true,true);
+ tRes.tested("addNewByName()", oObj.hasByName("XTableCharts") );
+
+ } // addNewByName()
+
+ /**
+ * Removes the chart added before. <p>
+ * Has <b> OK </b> status if <code>hasByName()</code> returns
+ * <code>false</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addNewByName() </code> : chart mst be added first </li>
+ * </ul>
+ */
+ public void _removeByName() {
+ requiredMethod("addNewByName()") ;
+
+ oObj.removeByName("XTableCharts");
+ tRes.tested("removeByName()", !oObj.hasByName("XTableCharts") );
+
+ } // removeByName()
+
+} // finish class _XTableCharts
+
+
+
diff --git a/qadevOOo/tests/java/ifc/table/_XTableChartsSupplier.java b/qadevOOo/tests/java/ifc/table/_XTableChartsSupplier.java
new file mode 100644
index 000000000000..7f0954bbf0d5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XTableChartsSupplier.java
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTableChartsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.table.XTableChartsSupplier;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.table.XTableChartsSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getCharts()</code></li>
+* </ul> <p>
+* @see com.sun.star.table.XTableChartsSupplier
+*/
+public class _XTableChartsSupplier extends MultiMethodTest {
+
+ public XTableChartsSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getCharts() {
+
+ tRes.tested( "getCharts()", oObj.getCharts()!=null );
+
+ } // getCharts()
+
+} // finish class _XTableChartsSupplier
+
+
+
diff --git a/qadevOOo/tests/java/ifc/table/_XTableColumns.java b/qadevOOo/tests/java/ifc/table/_XTableColumns.java
new file mode 100644
index 000000000000..a76ff291fb9f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XTableColumns.java
@@ -0,0 +1,426 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTableColumns.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.table.XTableColumns;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.table.XTableColumns</code>
+* interface methods :
+* <ul>
+* <li><code> insertByIndex()</code></li>
+* <li><code> removeByIndex()</code></li>
+* </ul> <p>
+*
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XTableColumns.XCellRange'</code> : <code>
+* com.sun.star.table.XCellRange</code> the cell range of
+* columns.</li>
+* <ul> <p>
+*
+* Test is multithread compilant. <p>
+* @see com.sun.star.table.XTableColumns
+*/
+public class _XTableColumns extends MultiMethodTest {
+
+ public XTableColumns oObj = null;
+ private XCellRange xCellRange = null;
+ private int lastColumn = 0;
+
+ public void before() {
+ xCellRange = (XCellRange)
+ tEnv.getObjRelation("XTableColumns.XCellRange") ;
+
+ if (xCellRange == null) throw new
+ StatusException(Status.failed("Relation missing"));
+
+ lastColumn = oObj.getCount() - 1 ;
+ }
+
+ /**
+ * First a number of cells in cell range are filled with data.
+ *
+ * Then columns inserted to valid positions : 1 column at 1,
+ * 1 column at 0, 2 columns at 0. <p>
+ *
+ * Then columns inserted to invalid positions : position -1,
+ * the column after last, and 0 columns inserted. <p>
+ *
+ * Has <b> OK </b> status if for valid cases :
+ * <ul>
+ * <li> content of other cells are properly shifted </li>
+ * <li> inserted columns are empty </li>
+ * <li> number of columns increases (in case if it is not the whole
+ * spreadsheet) by proper number. </li>
+ * </ul>
+ * and for invalid cases exception is thrown.
+ */
+ public void _insertByIndex() {
+
+ boolean result = true;
+ int origCnt = oObj.getCount();
+
+ try {
+ log.println("Filling range ... ");
+ fillRange(xCellRange);
+
+ log.println("Inserting 1 column at position 1 ...");
+ oObj.insertByIndex(1,1);
+
+ result &= checkColumn(0, 0);
+ result &= checkColumnEmpty(1);
+ result &= checkColumn(2, 1);
+ result &= checkColumn(3, 2);
+ result &= checkColumnEmpty(4);
+
+ if (lastColumn < 200) {
+ result &= checkColumn(lastColumn + 1, lastColumn);
+ result &= oObj.getCount() == origCnt + 1;
+ } else {
+ result &= checkColumnEmpty(lastColumn);
+ }
+
+ log.println("Inserting 1 column at position 0 ...");
+ oObj.insertByIndex(0,1);
+
+ result &= checkColumnEmpty(0);
+ result &= checkColumn(1, 0);
+ result &= checkColumnEmpty(2);
+ result &= checkColumn(3, 1);
+ result &= checkColumn(4, 2);
+ result &= checkColumnEmpty(5);
+ if (lastColumn < 200) {
+ result &= checkColumn(lastColumn + 2, lastColumn);
+ result &= oObj.getCount() == origCnt + 2;
+ }
+
+ log.println("Inserting 2 columns at position 0 ...");
+ oObj.insertByIndex(0,2);
+
+ result &= checkColumnEmpty(0);
+ result &= checkColumnEmpty(1);
+ result &= checkColumnEmpty(2);
+ result &= checkColumn(3, 0);
+ result &= checkColumnEmpty(4);
+ result &= checkColumn(5, 1);
+ result &= checkColumn(6, 2);
+ result &= checkColumnEmpty(7);
+ if (lastColumn < 200) {
+ result &= checkColumn(lastColumn + 4, lastColumn);
+ }
+
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+
+
+ // spreadsheet supports 256 columns and after inserting
+ // or removing a column their number remains the same
+ if (origCnt < 200) {
+ log.println("Checking that number of column increased.");
+ result &= oObj.getCount() == origCnt + 4;
+ log.println("Before: " + origCnt + ", After: " + oObj.getCount());
+ } else {
+ log.println("Number of columns is " + origCnt + ",") ;
+ log.println("supposing that this is the whole spreadsheet and ");
+ log.println("number of columns should not change.");
+ }
+
+ try {
+ oObj.insertByIndex(-1,1);
+ log.println("No Exception occurred while inserting column at -1");
+ result &= false;
+ } catch (Exception e) {
+ log.println("Inserting column at Index -1 ... OK");
+ result &= true;
+ }
+
+ int cnt = oObj.getCount();
+ try {
+ oObj.insertByIndex(cnt, 1);
+ log.println("No Exception occurred while inserting column at "
+ + cnt);
+ result &= false;
+ } catch (Exception e) {
+ log.println("Inserting column at Index " + cnt + " ... OK");
+ result &= true;
+ }
+
+ try {
+ oObj.insertByIndex(0,0);
+ log.println("No Exception occurred while inserting 0 columns");
+ result &= false;
+ } catch (Exception e) {
+ log.println("Inserting 0 columns ... OK");
+ result &= true;
+ }
+
+ tRes.tested( "insertByIndex()", result );
+
+ } // end insertByIndex()
+
+ /**
+ * Columns removed from valid positions : 1 column at 1,
+ * 1 column at 0, 2 columns at 0. <p>
+ *
+ * Then columns removed from invalid positions : position -1,
+ * the column after last, and 0 columns removed. <p>
+ *
+ * Has <b> OK </b> status if for valid cases :
+ * <ul>
+ * <li> content of other cells are properly shifted </li>
+ * <li> columns which are shifted left are empty </li>
+ * <li> number of columns decreases (in case if it is not the whole
+ * spreadsheet) by proper number. </li>
+ * </ul>
+ * and for invalid cases exception is thrown.
+ */
+ public void _removeByIndex() {
+ executeMethod("insertByIndex()");
+
+ boolean result = true;
+ int origCnt = oObj.getCount();
+
+ try {
+ log.println("Filling range ... ");
+
+ log.println("Removing 2 columns at position 0 ...");
+ oObj.removeByIndex(0,2);
+
+ result &= checkColumnEmpty(0);
+ result &= checkColumn(1, 0);
+ result &= checkColumnEmpty(2);
+ result &= checkColumn(3, 1);
+ result &= checkColumn(4, 2);
+ result &= checkColumnEmpty(5);
+ if (lastColumn < 200) {
+ result &= checkColumn(lastColumn + 2, lastColumn);
+ result &= oObj.getCount() == origCnt - 2;
+ }
+
+ log.println("Removing 1 column at position 0 ...");
+ oObj.removeByIndex(0,1);
+
+ result &= checkColumn(0, 0);
+ result &= checkColumnEmpty(1);
+ result &= checkColumn(2, 1);
+ result &= checkColumn(3, 2);
+ result &= checkColumnEmpty(4);
+ if (lastColumn < 200) {
+ result &= checkColumn(lastColumn + 1, lastColumn);
+ result &= oObj.getCount() == origCnt - 1;
+ }
+
+ log.println("Removing 1 column at position 1 ...");
+ oObj.removeByIndex(1,1);
+
+ result &= checkColumn(0, 0);
+ result &= checkColumn(1, 1);
+ result &= checkColumn(2, 2);
+ result &= checkColumnEmpty(3);
+ if (lastColumn < 200) {
+ result &= checkColumn(lastColumn, lastColumn);
+ }
+
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+
+
+ // spreadsheet supports 256 columns and after inserting
+ // or removing a column their number remains the same
+ if (origCnt < 200) {
+ log.println("Checking that number of column increased.");
+ result &= oObj.getCount() == origCnt - 4;
+ log.println("Before: " + origCnt + ", After: " + oObj.getCount());
+ } else {
+ log.println("Number of columns is " + origCnt + ",") ;
+ log.println("supposing that this is the whole spreadsheet and ");
+ log.println("number of columns should not change.");
+ }
+
+ try {
+ oObj.removeByIndex(-1,1);
+ log.println("No Exception occurred while removing column at -1");
+ result &= false;
+ } catch (Exception e) {
+ log.println("removing column at Index -1 ... OK");
+ result &= true;
+ }
+
+ int cnt = oObj.getCount();
+ try {
+ oObj.removeByIndex(cnt, 1);
+ log.println("No Exception occurred while removing column at "
+ + cnt);
+ result &= false;
+ } catch (Exception e) {
+ log.println("Removing column at Index " + cnt + " ... OK");
+ result &= true;
+ }
+
+ try {
+ oObj.removeByIndex(0,0);
+ log.println("No Exception occurred while removing 0 columns");
+ result &= false;
+ } catch (Exception e) {
+ log.println("removing 0 columns ... OK");
+ result &= true;
+ }
+
+ tRes.tested( "removeByIndex()", result );
+ } // end removeByIndex()
+
+ private void setCellText(XCell cell, String text) {
+ XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, cell) ;
+ xText.setString(text);
+ }
+ private String getCellText(XCell cell) {
+ XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, cell) ;
+ return xText.getString();
+ }
+
+ /**
+ * Fills the range with some data : two rows and 3 columns, and
+ * some columns are cleared.
+ *
+ * @param xRange Range to fill
+ * @throws IndexOutOfBoundsException if any errors occur during filling.
+ */
+ private void fillRange(XCellRange xRange)
+ throws com.sun.star.lang.IndexOutOfBoundsException {
+
+ for (int i = 0; i <= lastColumn && i < 3; i++) {
+ setCellText(xCellRange.getCellByPosition(i, 0), "" + i + "a");
+ setCellText(xCellRange.getCellByPosition(i, 1), "" + i + "b");
+ }
+
+ for (int i = 3; i <= lastColumn && i < 10; i++) {
+ setCellText(xCellRange.getCellByPosition(i, 0), "");
+ setCellText(xCellRange.getCellByPosition(i, 1), "");
+ }
+ }
+
+ /**
+ * Check the column (first two rows) if it has values with
+ * index specified.
+ *
+ * @param col Column to check
+ * @param idx What indexes must be in cells
+ * @return <code>true</code> if expected indexes are found,
+ * <code>false</code> otherwise.
+ * @throws IndexOutOfBoundsException
+ */
+ private boolean checkColumn(int col, int idx)
+ throws com.sun.star.lang.IndexOutOfBoundsException {
+
+ if (col >= oObj.getCount()) return true;
+
+ String c1 = getCellText(xCellRange.getCellByPosition(col, 0));
+ String c2 = getCellText(xCellRange.getCellByPosition(col, 1));
+
+ if (!((""+ idx + "a").equals(c1) && (""+ idx + "b").equals(c2))) {
+
+ log.println("FAILED for column " + col + " and index " + idx + "("
+ + c1 + "," + c2 + ")");
+ return false ;
+ }
+ return true;
+ }
+
+ /**
+ * Checks if the column (first two rows) has no data in its cells.
+ *
+ * @param col Column to check
+ * @return <code>true</code> if the column is empty, <code>false</code>
+ * if first two cells contains some strings.
+ * @throws IndexOutOfBoundsException
+ */
+ private boolean checkColumnEmpty(int col)
+ throws com.sun.star.lang.IndexOutOfBoundsException {
+
+ if (col >= oObj.getCount()) return true;
+
+ String c1 = getCellText(xCellRange.getCellByPosition(col, 0));
+ String c2 = getCellText(xCellRange.getCellByPosition(col, 1));
+ if (!("".equals(c1) && "".equals(c2))) {
+ log.println("FAILED for column " + col + " is not empty ("
+ + c1 + "," + c2 + ")");
+ return false ;
+ }
+ return true;
+ }
+
+ } //finish class _XTableColumns
+
diff --git a/qadevOOo/tests/java/ifc/table/_XTableRows.java b/qadevOOo/tests/java/ifc/table/_XTableRows.java
new file mode 100644
index 000000000000..dba1a2c923fe
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/table/_XTableRows.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTableRows.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:12:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.table;
+
+import com.sun.star.table.XTableRows;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.table.XTableRows</code>
+* interface methods :
+* <ul>
+* <li><code> insertByIndex()</code></li>
+* <li><code> removeByIndex()</code></li>
+* </ul> <p>
+* Test is multithread compilant. <p>
+* @see com.sun.star.table.XTableRows
+*/
+public class _XTableRows extends MultiMethodTest {
+
+ public XTableRows oObj = null;
+
+ /**
+ * First a row inserted to valid position, then to invalid. <p>
+ * Has <b> OK </b> status if in the first case number of rows increases
+ * by 1, and in the second an exception is thrown. <p>
+ */
+ public void _insertByIndex() {
+
+ boolean result = true;
+
+ int origCnt = oObj.getCount();
+ oObj.insertByIndex(0,1);
+ result &= oObj.getCount() == origCnt + 1;
+ log.println("Inserting row at Index 0 ... OK");
+
+ try {
+ oObj.insertByIndex(-1,1);
+ log.println("No Exception occurred while inserting row at -1");
+ result &= false;
+ } catch (Exception e) {
+ log.println("Inserting row at Index -1 ... OK");
+ result &= true;
+ }
+
+ tRes.tested( "insertByIndex()", result );
+
+ } // end insertByIndex()
+
+ /**
+ * First a row removed from valid position, then from invalid. <p>
+ *
+ * Has <b> OK </b> status if in the first case number of columns decreases
+ * by 1, and in the second an exception is thrown. <p>
+ */
+ public void _removeByIndex() {
+
+ boolean result = true;
+
+ requiredMethod("insertByIndex()");
+
+ int origCnt = oObj.getCount();
+ oObj.removeByIndex(0,1);
+ result &= oObj.getCount() == origCnt - 1;
+ log.println("Removing row at Index 0 ... OK");
+
+ try {
+ oObj.removeByIndex(-1,1);
+ log.println("No Exception occurred while Removing row at -1");
+ result &= false;
+ } catch (Exception e) {
+ log.println("Removing row at Index -1 ... OK");
+ result &= true;
+ }
+
+ tRes.tested( "removeByIndex()", result );
+ } // end removeByIndex()
+
+} //finish class _XTableRows
+
diff --git a/qadevOOo/tests/java/ifc/task/_XInteractionHandler.java b/qadevOOo/tests/java/ifc/task/_XInteractionHandler.java
new file mode 100644
index 000000000000..1d1703f4f903
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/task/_XInteractionHandler.java
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XInteractionHandler.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.task;
+
+
+
+/**
+* <code>com.sun.star.task.XInteractionHandler</code> interface testing.
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XInteractionHandler.Request'</code>
+* (of type <code>com.sun.star.task.XInteractionRequest</code>):
+* this interface implementation is handler specific and is
+* passed as argument to method <code>handle</code>. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.task.XInteractionHandler
+*/
+import com.sun.star.task.XInteractionHandler;
+import com.sun.star.task.XInteractionRequest;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* <code>com.sun.star.task.XInteractionHandler</code> interface testing.
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XInteractionHandler.Request'</code>
+* (of type <code>com.sun.star.task.XInteractionRequest</code>):
+* this interface implementation is handler specific and is
+* passed as argument to method <code>handle</code>. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.task.XInteractionHandler
+*/
+public class _XInteractionHandler extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XInteractionHandler oObj = null ;
+
+ private XInteractionRequest request = null ;
+
+ /**
+ * Retrieves an object relation. <p>
+ * @throws StatusException If the relation is not found.
+ */
+ public void before() {
+ request = (XInteractionRequest)
+ tEnv.getObjRelation("XInteractionHandler.Request") ;
+
+ //if (request == null)
+ // throw new StatusException(Status.failed("Reelation not found")) ;
+ }
+
+ /**
+ * Sinse this test is interactive (dialog window can't be
+ * disposed using API) it is skipped. <p>
+ * Always has <b>SKIPPED.OK</b> status .
+ */
+ public void _handle() {
+
+ /*
+
+ final XMultiServiceFactory msf = tParam.getMSF() ;
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+ XComponent textDoc = null ;
+ try {
+ textDoc = SOF.createTextDoc( null );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Can't create Document") ;
+ tRes.tested("handle()", false) ;
+ return ;
+ }
+ final XComponent fTextDoc = textDoc ;
+ final XModel xModelDoc = (XModel)
+ UnoRuntime.queryInterface(XModel.class, textDoc);
+
+ Thread thr = new Thread( new Runnable() {
+ public void run() {
+ try {
+ Thread.sleep(1000) ;
+ } catch (InterruptedException e ) {}
+
+ //fTextDoc.dispose() ;
+
+ XFrame docFr = xModelDoc.getCurrentController().getFrame() ;
+ docFr.dispose() ;
+
+ ///*
+ try {
+
+ Object dsk = msf.createInstance
+ ("com.sun.star.frame.Desktop");
+
+ XFrame xDsk = (XFrame)
+ UnoRuntime.queryInterface(XFrame.class, dsk) ;
+
+ XFrame fr = xDsk.findFrame("_top", 55) ;
+
+ XWindow win = fr.getContainerWindow() ;
+
+ String name = null ;
+ if (fr != null) {
+ name = fr.getName() ;
+ docFr.dispose() ;
+ }
+
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace();
+ } //
+ }
+ }) ;
+ thr.start() ;
+
+ oObj.handle(request) ;
+ try {
+ thr.join(500) ;
+ } catch (InterruptedException e ) {}
+ */
+
+ tRes.tested("handle()", Status.skipped(true)) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/task/_XJobExecutor.java b/qadevOOo/tests/java/ifc/task/_XJobExecutor.java
new file mode 100644
index 000000000000..3938d2daeec4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/task/_XJobExecutor.java
@@ -0,0 +1,112 @@
+ /*************************************************************************
+ *
+ * $RCSfile: _XJobExecutor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.task;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.task.XJobExecutor;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.frame._XJobExecutor</code>
+ * interface methods:
+ * <ul>
+ * <li><code> trigger() </code></li>
+ * </ul><p>
+ *
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'CallCounter'</code>
+ * (of type <code>com.sun.star.container.XNamed</code>):
+ * the <code>getName()</code> method of which must
+ * return number of calls to <code>XJob.execute</code>
+ * method which is registered for event 'TestEvent'
+ * </li>
+ * <ul> <p>
+ * @see com.sun.star.frame.XJobExecutor
+ */
+public class _XJobExecutor extends MultiMethodTest {
+ public static XJobExecutor oObj = null;
+
+ /**
+ * Gets the number of Job calls before and after triggering event.
+ *
+ * Has <b>OK</b> status if the Job was called on triggering
+ * event.
+ */
+ public void _trigger() {
+ XNamed counter = (XNamed) tEnv.getObjRelation("CallCounter");
+
+ int before = Integer.parseInt(counter.getName());
+
+ oObj.trigger("TestEvent");
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {}
+
+ int after = Integer.parseInt(counter.getName());
+
+ log.println("Calls before: " + before + ", after: " + after);
+
+ tRes.tested("trigger()", after == before + 1);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/task/_XStatusIndicatorFactory.java b/qadevOOo/tests/java/ifc/task/_XStatusIndicatorFactory.java
new file mode 100644
index 000000000000..58d265cb5cfa
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/task/_XStatusIndicatorFactory.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XStatusIndicatorFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.task;
+
+import com.sun.star.task.XStatusIndicator;
+import com.sun.star.task.XStatusIndicatorFactory;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.task.XStatusIndicatorFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createStatusIndicator()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.task.XStatusIndicatorFactory
+*/
+public class _XStatusIndicatorFactory extends MultiMethodTest {
+
+ public XStatusIndicatorFactory oObj = null;
+
+ /**
+ * A status indicator created. Also some actions performed
+ * with it, which are not related to test flow. <p>
+ * Has <b> OK </b> status if the method returns not null
+ * value. <p>
+ */
+ public void _createStatusIndicator() {
+ boolean bResult = true;
+
+ XStatusIndicator SI1 = oObj.createStatusIndicator();
+ XStatusIndicator SI2 = oObj.createStatusIndicator();
+ //Start all Indicators
+ SI1.start("Status1",100);
+ SI2.start("Status2",100);
+
+ //change SI2
+ SI2.setText("A new name for the status");
+ SI2.setValue(45);
+ SI2.reset();
+ SI2.end();
+
+ //Now SI1 is active
+ SI1.end();
+
+ bResult &= SI1 != null;
+
+ tRes.tested("createStatusIndicator()", bResult);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_BaseFrame.java b/qadevOOo/tests/java/ifc/text/_BaseFrame.java
new file mode 100644
index 000000000000..dd7ddd9a87f3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_BaseFrame.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * $RCSfile: _BaseFrame.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.text.BaseFrame</code>
+* service properties :
+* <ul>
+* <li><code> AnchorPageNo</code></li>
+* <li><code> AnchorFrame</code></li>
+* <li><code> BackColor</code></li>
+* <li><code> BackGraphicURL</code></li>
+* <li><code> BackGraphicFilter</code></li>
+* <li><code> BackGraphicLocation</code></li>
+* <li><code> LeftBorder</code></li>
+* <li><code> RightBorder</code></li>
+* <li><code> TopBorder</code></li>
+* <li><code> BottomBorder</code></li>
+* <li><code> BorderDistance</code></li>
+* <li><code> LeftBorderDistance</code></li>
+* <li><code> RightBorderDistance</code></li>
+* <li><code> TopBorderDistance</code></li>
+* <li><code> BottomBorderDistance</code></li>
+* <li><code> BackTransparent</code></li>
+* <li><code> ContentProtected</code></li>
+* <li><code> FrameStyleName</code></li>
+* <li><code> LeftMargin</code></li>
+* <li><code> RightMargin</code></li>
+* <li><code> TopMargin</code></li>
+* <li><code> BottomMargin</code></li>
+* <li><code> Height</code></li>
+* <li><code> Width</code></li>
+* <li><code> RelativeHeight</code></li>
+* <li><code> RelativeWidth</code></li>
+* <li><code> IsSyncWidthToHeight</code></li>
+* <li><code> IsSyncHeightToWidth</code></li>
+* <li><code> HoriOrient</code></li>
+* <li><code> HoriOrientPosition</code></li>
+* <li><code> HoriOrientRelation</code></li>
+* <li><code> VertOrient</code></li>
+* <li><code> VertOrientPosition</code></li>
+* <li><code> VertOrientRelation</code></li>
+* <li><code> HyperLinkURL</code></li>
+* <li><code> HyperLinkTarget</code></li>
+* <li><code> HyperLinkName</code></li>
+* <li><code> Opaque</code></li>
+* <li><code> PageToggle</code></li>
+* <li><code> PositionProtected</code></li>
+* <li><code> Print</code></li>
+* <li><code> ShadowFormat</code></li>
+* <li><code> ServerMap</code></li>
+* <li><code> Size</code></li>
+* <li><code> SizeProtected</code></li>
+* <li><code> Surround</code></li>
+* <li><code> SurroundAnchorOnly</code></li>
+* <li><code> BackColorTransparency</code></li>
+* <li><code> BackColorRGB</code></li>
+* <li><code> BackGraphicTransparency</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.BaseFrame
+*/
+public class _BaseFrame extends MultiPropertyTest {
+ public String str1 = "Graphics";
+ public String str2 = "Watermark";
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ protected PropertyTester StringTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (str1.equals(oldValue))
+ return str2;
+ else
+ return str1;
+ }
+ };
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _FrameStyleName() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("FrameStyleName", StringTester) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _BackColorTransparency() {
+ testProperty("BackColorTransparency", new Integer(10), new Integer(50)) ;
+ }
+
+} //finish class _BaseFrame
+
diff --git a/qadevOOo/tests/java/ifc/text/_BaseIndex.java b/qadevOOo/tests/java/ifc/text/_BaseIndex.java
new file mode 100644
index 000000000000..770e1ee9040c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_BaseIndex.java
@@ -0,0 +1,231 @@
+/*************************************************************************
+ *
+ * $RCSfile: _BaseIndex.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XIndexReplace;
+import com.sun.star.text.XTextColumns;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.text.BaseIndex</code>
+* service properties :
+* <ul>
+* <li><code> Title</code></li>
+* <li><code> IsProtected</code></li>
+* <li><code> ParaStyleHeading</code></li>
+* <li><code> ParaStyleLevel1</code></li>
+* <li><code> ParaStyleLevel2</code></li>
+* <li><code> ParaStyleLevel3</code></li>
+* <li><code> ParaStyleLevel4</code></li>
+* <li><code> ParaStyleLevel5</code></li>
+* <li><code> ParaStyleLevel6</code></li>
+* <li><code> ParaStyleLevel7</code></li>
+* <li><code> ParaStyleLevel8</code></li>
+* <li><code> ParaStyleLevel9</code></li>
+* <li><code> ParaStyleLevel10</code></li>
+* <li><code> ParaStyleSeparator</code></li>
+* <li><code> TextColumns</code></li>
+* <li><code> BackGraphicURL</code></li>
+* <li><code> BackGraphicFilter</code></li>
+* <li><code> BackGraphicLocation</code></li>
+* <li><code> BackTransparent</code></li>
+* <li><code> LevelFormat</code></li>
+* <li><code> CreateFromChapter</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.BaseIndex
+*/
+public class _BaseIndex extends MultiPropertyTest {
+
+ /**
+ * Redefined method returns object, that contains changed property value.
+ */
+ protected PropertyTester CustomTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ XTextColumns TC = (XTextColumns) oldValue;
+ TC.setColumnCount((short)(TC.getColumnCount() + (short) 1));
+ return TC;
+ }
+ };
+
+ /**
+ * New value must be defined for this property.
+ */
+ public void _TextColumns() {
+ log.println("Testing property 'TextColumns' with custom property tester") ;
+ testProperty("TextColumns", CustomTester) ;
+ }
+
+ /**
+ * The value of this property is a collection of document index
+ * level formats. This property is tested in the following manner :
+ * the property value (a collection) is obtained, the first element
+ * of this collection is replaced with new non-empty array
+ * (<code>PropertyValue[][]</code>) with some properties set.
+ * After that the collection is set back as property value. <p>
+ *
+ * Comparing of set and got <code>PropertyValue</code> arrays
+ * is difficult because values can be changed after setting
+ * by service miplementation. <p>
+ *
+ * Has <b>OK</b> status if the collection again gotten, has a
+ * new first element (i.e. lengths of the old array and the array
+ * get are different or their contents differ).
+ */
+ public void _LevelFormat() {
+ log.println("Testing property 'LevelFormat' with custom property tester") ;
+ testProperty("LevelFormat", new PropertyTester() {
+
+ PropertyValue[][] newVal = null;
+ PropertyValue[][] oldVal = null ;
+
+ protected Object getNewValue(String propName, Object oldValue) {
+ XIndexReplace indProp = (XIndexReplace) oldValue;
+ try {
+ oldVal = (PropertyValue[][]) indProp.getByIndex(0) ;
+
+ log.println("Get:") ;
+ printLevelFormatProperty(oldValue) ;
+
+ newVal = new PropertyValue[1][2];
+
+ for (int i=0; i < newVal[0].length; i++) {
+ newVal[0][i] = new PropertyValue();
+ }
+ newVal[0][1].Name = "TokenType";
+ newVal[0][1].Value = "TokenEntryText";
+ newVal[0][0].Name = "Text";
+ newVal[0][0].Value = "BaseIndex";
+
+ indProp.replaceByIndex(0, newVal);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Exception occured while testing LevelFormat");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ log.println("Exception occured while testing LevelFormat");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Exception occured while testing LevelFormat");
+ e.printStackTrace(log);
+ }
+ return indProp;
+ }
+
+ protected void checkResult(String propName, Object oldValue,
+ Object newValue, Object resValue, Exception exception)
+ throws Exception {
+
+ PropertyValue[][] res = (PropertyValue[][])
+ ((XIndexAccess) resValue ).getByIndex(0);
+
+ log.println("Result:");
+ printLevelFormatProperty(resValue) ;
+
+ boolean result = res.length != oldVal.length ||
+ !util.ValueComparer.equalValue(res, oldVal);
+
+ tRes.tested(propName, result) ;
+ }
+
+ });
+ }
+
+ /**
+ * Outputs full description of 'LevelFormat' property
+ * value into <code>log</code>.
+ */
+ private void printLevelFormatProperty(Object value) {
+ XIndexReplace indProp = (XIndexReplace) value;
+ PropertyValue[][] val = null ;
+ try {
+ log.println(" \u0421ollection has " + indProp.getCount() +
+ " elements : ") ;
+
+ for (int i =0 ; i < indProp.getCount(); i++) {
+ val = (PropertyValue[][]) indProp.getByIndex(i) ;
+
+ log.println(" " + i + ": has " + val.length + " levels :") ;
+
+ for (int j = 0; j < val.length; j++) {
+ log.println(" " + j + " level :") ;
+
+ for (int k = 0; k < val[j].length; k++) {
+ log.println(" " + val[j][k].Name + "=" +
+ val[j][k].Value) ;
+ }
+ }
+ }
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Exception occured while printing LevelFormat");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ log.println("Exception occured while printing LevelFormat");
+ e.printStackTrace(log);
+ }
+ }
+
+} // finish class _NumberingRules
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_BaseIndexMark.java b/qadevOOo/tests/java/ifc/text/_BaseIndexMark.java
new file mode 100644
index 000000000000..7a59d15410e6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_BaseIndexMark.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: _BaseIndexMark.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.BaseIndexMark</code>
+* service properties :
+* <ul>
+* <li><code> AlternativeText</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.BaseIndexMark
+*/
+public class _BaseIndexMark extends MultiPropertyTest {
+
+} // finish class _BaseIndexMark
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_CellProperties.java b/qadevOOo/tests/java/ifc/text/_CellProperties.java
new file mode 100644
index 000000000000..c1051759426f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_CellProperties.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CellProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.xml.AttributeData;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.text.CellProperties</code>
+* service properties :
+* <ul>
+* <li><code> BackColor</code></li>
+* <li><code> BackGraphicURL</code></li>
+* <li><code> BackGraphicFilter</code></li>
+* <li><code> BackGraphicLocation</code></li>
+* <li><code> NumberFormat</code></li>
+* <li><code> BackTransparent</code></li>
+* <li><code> LeftBorder</code></li>
+* <li><code> RightBorder</code></li>
+* <li><code> TopBorder</code></li>
+* <li><code> BottomBorder</code></li>
+* <li><code> LeftBorderDistance</code></li>
+* <li><code> RightBorderDistance</code></li>
+* <li><code> TopBorderDistance</code></li>
+* <li><code> BottomBorderDistance</code></li>
+* <li><code> UserDefinedAttributes</code></li>
+* <li><code> TextSection</code></li>
+* <li><code> IsProtected</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CellProperties.TextSection'</code> (of type
+* <code>XInterface</code>):
+* instance of <code>com.sun.star.text.TextSection</code></li>
+* </ul> <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code> crazy-blue.jpg </code> : jpeg image used to test
+* BackGraphicURL()</li>
+* <li> <code> space-metal.jpg </code> : jpeg image used to test
+* BackGraphicURL()</li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.CellProperties
+*/
+public class _CellProperties extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so new value must be specified from
+ * corresponding object relation.
+ */
+ public void _TextSection() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("TextSection", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return tEnv.getObjRelation("CellProperties.TextSection");
+ }
+ });
+ }
+
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ public void _BackColor() {
+ final Short val1 = new Short( (short) 4 );
+ final Short val2 = new Short( (short) 6 );
+ log.println("Testing with custom Property tester") ;
+ testProperty("BackColor", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if ( oldValue.equals(val1) )
+ return val2;
+ else
+ return val1;
+ }
+ });
+ }
+
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ public void _BackGraphicURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("BackGraphicURL", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (oldValue.equals(util.utils.getFullTestURL
+ ("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg");
+ else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ });
+ }
+
+
+ /**
+ * Redefined method returns object, that contains changed property value.
+ */
+ public void _UserDefinedAttributes() {
+ log.println("Testing with custom property tester");
+ testProperty("UserDefinedAttributes", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ XNameContainer NC = (XNameContainer) oldValue;
+ try {
+ NC.insertByName("MyAttribute",
+ new AttributeData("","CDATA","Value"));
+ } catch ( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Failed to check 'UserDefinedAttributes'");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ log.println("Failed to check 'UserDefinedAttributes'");
+ e.printStackTrace(log);
+ } catch ( com.sun.star.container.ElementExistException e ) {
+ log.println("Failed to check 'UserDefinedAttributes'");
+ e.printStackTrace(log);
+ }
+ return NC;
+ }
+ });
+ }
+
+} //finish class _CellProperties
+
diff --git a/qadevOOo/tests/java/ifc/text/_CellRange.java b/qadevOOo/tests/java/ifc/text/_CellRange.java
new file mode 100644
index 000000000000..c1cc5f48fc6f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_CellRange.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * $RCSfile: _CellRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.xml.AttributeData;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.text.CellRange</code>
+* service properties :
+* <ul>
+* <li><code> BackColor</code></li>
+* <li><code> BackGraphicURL</code></li>
+* <li><code> BackGraphicFilter</code></li>
+* <li><code> BackGraphicLocation</code></li>
+* <li><code> BackTransparent</code></li>
+* <li><code> ChartColumnAsLabel</code></li>
+* <li><code> ChartRowAsLabel</code></li>
+* <li><code> NumberFormat</code></li>
+* <li><code> TopMargin</code></li>
+* <li><code> BottomMargin</code></li>
+*
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code> crazy-blue.jpg </code> : jpeg image used to test
+* BackGraphicURL()</li>
+* <li> <code> space-metal.jpg </code> : jpeg image used to test
+* BackGraphicURL()</li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.CellProperties
+*/
+public class _CellRange extends MultiPropertyTest {
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ public void _BackColor() {
+ final Short val1 = new Short( (short) 4 );
+ final Short val2 = new Short( (short) 6 );
+ log.println("Testing with custom Property tester") ;
+ testProperty("BackColor", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if ( oldValue.equals(val1) )
+ return val2;
+ else
+ return val1;
+ }
+ });
+ }
+
+ /**
+ * This property could be changed only when graphic
+ * URL is set.
+ */
+ public void _BackGraphicFilter() {
+ executeMethod("BackGraphicURL");
+ testProperty("BackGraphicFilter");
+ }
+
+ /**
+ * Redefined method returns value, that differs from property value.
+ */
+ public void _BackGraphicURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("BackGraphicURL", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (oldValue.equals(util.utils.getFullTestURL
+ ("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg");
+ else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ });
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_Defaults.java b/qadevOOo/tests/java/ifc/text/_Defaults.java
new file mode 100644
index 000000000000..59cf4ea19163
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_Defaults.java
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Defaults.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.Defaults</code>
+*
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.Defaults
+*/
+public class _Defaults extends MultiPropertyTest {
+
+} //finish class _Defaults
+
diff --git a/qadevOOo/tests/java/ifc/text/_DocumentIndex.java b/qadevOOo/tests/java/ifc/text/_DocumentIndex.java
new file mode 100644
index 000000000000..994ae9cebe23
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_DocumentIndex.java
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DocumentIndex.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.DocumentIndex</code>
+* service properties :
+* <ul>
+* <li><code> UseAlphabeticalSeparators</code></li>
+* <li><code> UseKeyAsEntry</code></li>
+* <li><code> UseCombinedEntries</code></li>
+* <li><code> IsCaseSensitive</code></li>
+* <li><code> UsePP</code></li>
+* <li><code> UseDash</code></li>
+* <li><code> UseUpperCase</code></li>
+* <li><code> MainEntryCharacterStyleName</code></li>
+* <li><code> DocumentIndexMarks</code></li>
+* <li><code> Locale</code></li>
+* <li><code> SortAlgorithm</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.DocumentIndex
+*/
+public class _DocumentIndex extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_DocumentIndexMark.java b/qadevOOo/tests/java/ifc/text/_DocumentIndexMark.java
new file mode 100644
index 000000000000..2dd1e8eef283
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_DocumentIndexMark.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * $RCSfile: _DocumentIndexMark.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.DocumentIndexMark</code>
+* service properties :
+* <ul>
+* <li><code> PrimaryKey</code></li>
+* <li><code> SecondaryKey</code></li>
+* <li><code> IsMainEntry</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.DocumentIndexMark
+*/
+public class _DocumentIndexMark extends MultiPropertyTest {
+
+} // finish class _DocumentIndexMark
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_Footnote.java b/qadevOOo/tests/java/ifc/text/_Footnote.java
new file mode 100644
index 000000000000..6fcccf270f3c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_Footnote.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Footnote.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.Footnote</code>
+* service properties :
+* <ul>
+* <li><code> ReferenceId</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.Footnote
+*/
+public class _Footnote extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _ReferenceId() {
+ final Short val1 = new Short( (short) 1);
+ final Short val2 = new Short( (short) 2);
+
+ log.println("Testing with custom Property tester");
+ testProperty("ReferenceId", val1, val2);
+ }
+
+} //finish class _Footnote
+
diff --git a/qadevOOo/tests/java/ifc/text/_FootnoteSettings.java b/qadevOOo/tests/java/ifc/text/_FootnoteSettings.java
new file mode 100644
index 000000000000..a675ef679b0e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_FootnoteSettings.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * $RCSfile: _FootnoteSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.FootnoteSettings</code>
+* service properties :
+* <ul>
+* <li><code> CharStyleName</code></li>
+* <li><code> NumberingType</code></li>
+* <li><code> PageStyleName</code></li>
+* <li><code> ParaStyleName</code></li>
+* <li><code> Prefix</code></li>
+* <li><code> StartAt</code></li>
+* <li><code> Suffix</code></li>
+* <li><code> BeginNotice</code></li>
+* <li><code> EndNotice</code></li>
+* <li><code> FootnoteCounting</code></li>
+* <li><code> PositionEndOfDoc</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.FootnoteSettings
+*/
+public class _FootnoteSettings extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _CharStyleName() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("CharStyleName", "Endnote Symbol", "Endnote anchor") ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _PageStyleName() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("PageStyleName", "Standard", "Endnote") ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _ParaStyleName() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("ParaStyleName", "Standard", "Endnote") ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _NumberingType() {
+ Short val1 = new Short(com.sun.star.text.FootnoteNumbering.PER_DOCUMENT);
+ Short val2 = new Short(com.sun.star.text.FootnoteNumbering.PER_PAGE);
+ log.println("Testing with custom Property tester") ;
+ testProperty("NumberingType", val1, val2) ;
+ }
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _FootnoteCounting() {
+ Short val1 = new Short( (short) 1 );
+ Short val2 = new Short( (short) 2 );
+ log.println("Testing with custom Property tester") ;
+ testProperty("FootnoteCounting", val1, val2) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_LineNumberingProperties.java b/qadevOOo/tests/java/ifc/text/_LineNumberingProperties.java
new file mode 100644
index 000000000000..9c46e5b74a80
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_LineNumberingProperties.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * $RCSfile: _LineNumberingProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.LineNumberingProperties</code>
+* service properties :
+* <ul>
+* <li><code> IsOn</code></li>
+* <li><code> CharStyleName</code></li>
+* <li><code> CountEmptyLines</code></li>
+* <li><code> CountLinesInFrames</code></li>
+* <li><code> Distance</code></li>
+* <li><code> Interval</code></li>
+* <li><code> SeparatorText</code></li>
+* <li><code> SeparatorInterval</code></li>
+* <li><code> NumberPosition</code></li>
+* <li><code> NumberingType</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.LineNumberingProperties
+*/
+public class _LineNumberingProperties extends MultiPropertyTest {
+
+ /**
+ * This property can be VOID, and in case if it is so new
+ * value must be defined.
+ */
+ public void _CharStyleName() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("CharStyleName", "Endnote Symbol", "Endnote anchor") ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_NumberingRules.java b/qadevOOo/tests/java/ifc/text/_NumberingRules.java
new file mode 100644
index 000000000000..d855afc13f01
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_NumberingRules.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: _NumberingRules.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.NumberingRules</code>
+* service properties :
+* <ul>
+* <li><code> IsAbsoluteMargins</code></li>
+* <li><code> IsAutomatic</code></li>
+* <li><code> IsContinuousNumbering</code></li>
+* <li><code> Name</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.NumberingRules
+*/
+public class _NumberingRules extends MultiPropertyTest {
+
+} // finish class _NumberingRules
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_PrintSettings.java b/qadevOOo/tests/java/ifc/text/_PrintSettings.java
new file mode 100644
index 000000000000..0ec1a66c993f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_PrintSettings.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: _PrintSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.PrintSettings</code>
+* service properties :
+* <ul>
+* <li><code> PrintGraphics</code></li>
+* <li><code> PrintTables</code></li>
+* <li><code> PrintDrawings</code></li>
+* <li><code> PrintLeftPages</code></li>
+* <li><code> PrintRightPages</code></li>
+* <li><code> PrintControls</code></li>
+* <li><code> PrintReversed</code></li>
+* <li><code> PrintPaperFromSetup</code></li>
+* <li><code> PrintFaxName</code></li>
+* <li><code> PrintAnnotationMode</code></li>
+* <li><code> PrintProspect</code></li>
+* <li><code> PrintPageBackground</code></li>
+* <li><code> PrintBlackFonts</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.PrintSettings
+*/
+public class _PrintSettings extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_Text.java b/qadevOOo/tests/java/ifc/text/_Text.java
new file mode 100644
index 000000000000..e4c955f55dab
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_Text.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * $RCSfile: _Text.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+public class _Text extends MultiPropertyTest {
+
+} //finish class _BaseFrame
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextColumns.java b/qadevOOo/tests/java/ifc/text/_TextColumns.java
new file mode 100644
index 000000000000..ed86d109add4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextColumns.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextColumns.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XTextColumns;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+* Testing <code>com.sun.star.text.TextColumns</code>
+* service properties :
+* <ul>
+* <li><code> IsAutomatic</code></li>
+* <li><code> AutomaticDistance</code></li>
+* <li><code> SeparatorLineWidth</code></li>
+* <li><code> SeparatorLineColor</code></li>
+* <li><code> SeparatorLineRelativeHeight</code></li>
+* <li><code> SeparatorLineVerticalAlignment</code></li>
+* <li><code> SeparatorLineIsOn</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.TextColumns
+*/
+public class _TextColumns extends MultiPropertyTest {
+
+
+ /**
+ * Redefined method returns specific value, that differs from property
+ * value. ( (oldValue + referenceValue) / 2 ).
+ */
+ public void _AutomaticDistance() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("AutomaticDistance", new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ XTextColumns xTC = (XTextColumns)
+ UnoRuntime.queryInterface
+ (XTextColumns.class,tEnv.getTestObject());
+ int ref = xTC.getReferenceValue();
+ int setting = ( ( (Integer) oldValue).intValue() + ref) / 2;
+ return new Integer(setting);
+ }
+ });
+ }
+
+
+} //finish class _TextColumns
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextContent.java b/qadevOOo/tests/java/ifc/text/_TextContent.java
new file mode 100644
index 000000000000..9478192e56a6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextContent.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextContent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.TextContent</code>
+* service properties :
+* <ul>
+* <li><code> AnchorType</code></li>
+* <li><code> AnchorTypes</code></li>
+* <li><code> TextWrap</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.TextContent
+*/
+public class _TextContent extends MultiPropertyTest {
+
+} //finish class _TextContent
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextDocument.java b/qadevOOo/tests/java/ifc/text/_TextDocument.java
new file mode 100644
index 000000000000..8907576bd74e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextDocument.java
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.text.TextDocument</code>
+* service properties :
+* <ul>
+* <li><code> CharLocale</code></li>
+* <li><code> CharacterCount</code></li>
+* <li><code> ParagraphCount</code></li>
+* <li><code> WordCount</code></li>
+* <li><code> WordSeparator</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.text.TextDocument
+*/
+public class _TextDocument extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextFieldMaster.java b/qadevOOo/tests/java/ifc/text/_TextFieldMaster.java
new file mode 100644
index 000000000000..020c0b8cdff8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextFieldMaster.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextFieldMaster.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.text.TextFieldMaster</code>
+ * service properties :
+ * <ul>
+ * <li><code> Name</code></li>
+ * <li><code> DependentTextFields</code></li>
+ * <li><code> InstanceName</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.text.TextFieldMaster
+ */
+public class _TextFieldMaster extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextFrame.java b/qadevOOo/tests/java/ifc/text/_TextFrame.java
new file mode 100644
index 000000000000..ac5f399b5e9c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextFrame.java
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextFrame.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+ * Testing <code>com.sun.star.text.TextFrame</code>
+ * service properties :
+ * <ul>
+ * <li><code> FrameHeightAbsolute</code></li>
+ * <li><code> FrameWidthAbsolute</code></li>
+ * <li><code> FrameWidthPercent</code></li>
+ * <li><code> FrameHeightPercent</code></li>
+ * <li><code> FrameIsAutomaticHeight</code></li>
+ * <li><code> SizeType</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.text.TextFrame
+ */
+public class _TextFrame extends MultiPropertyTest {
+
+ /**
+ * Property tester which switches two shorts.
+ */
+ protected PropertyTester WModeTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(new Short(com.sun.star.text.WritingMode2.LR_TB)))
+ return new Short(com.sun.star.text.WritingMode2.TB_LR); else
+ return new Short(com.sun.star.text.WritingMode2.LR_TB);
+ }
+ } ;
+
+ /**
+ * This property must have predefined values
+ */
+ public void _WritingMode() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("WritingMode", WModeTester) ;
+ }
+
+} //finish class _TextFrame
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextGraphicObject.java b/qadevOOo/tests/java/ifc/text/_TextGraphicObject.java
new file mode 100644
index 000000000000..b73043658f0c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextGraphicObject.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextGraphicObject.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.awt.Point;
+import com.sun.star.container.XIndexContainer;
+import java.util.Random;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+ * Testing <code>com.sun.star.text.TextGraphicObject</code>
+ * service properties :
+ * <ul>
+ * <li><code> ImageMap</code></li>
+ * <li><code> ContentProtected</code></li>
+ * <li><code> SurroundContour</code></li>
+ * <li><code> ContourOutside</code></li>
+ * <li><code> ContourPolyPolygon</code></li>
+ * <li><code> GraphicCrop</code></li>
+ * <li><code> HoriMirroredOnEvenPages</code></li>
+ * <li><code> HoriMirroredOnOddPages</code></li>
+ * <li><code> VertMirrored</code></li>
+ * <li><code> GraphicURL</code></li>
+ * <li><code> GraphicFilter</code></li>
+ * <li><code> ActualSize</code></li>
+ * <li><code> AdjustLuminance</code></li>
+ * <li><code> AdjustContrast</code></li>
+ * <li><code> AdjustRed</code></li>
+ * <li><code> AdjustGreen</code></li>
+ * <li><code> AdjustBlue</code></li>
+ * <li><code> Gamma</code></li>
+ * <li><code> GraphicIsInverted</code></li>
+ * <li><code> Transparency</code></li>
+ * <li><code> GraphicColorMode</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'ImageMap'</code> (an inmplementation of
+ * <code>com.sun.star.image.ImageMapObject</code>):
+ * is used to insert a new Map into collection
+ * from 'ImageMap' property. </li>
+ * <ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.text.TextGraphicObject
+ */
+public class _TextGraphicObject extends MultiPropertyTest {
+
+ public Random rdm = new Random();
+
+ /**
+ * The tester which can change a sequence of <code>Point</code>'s
+ * or create a new one if necessary.
+ */
+ protected PropertyTester PointTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (utils.isVoid(oldValue))
+ return newPoint(); else
+ return changePoint((Point[][]) oldValue);
+ }
+ } ;
+
+ /**
+ * Tested with custom <code>PointTester</code>.
+ */
+ public void _ContourPolyPolygon() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("ContourPolyPolygon", PointTester) ;
+ }
+
+ /**
+ * Retrieves an ImageMap from relation and inserts it to the collection
+ * obtained as property value. Then this collection is set back.
+ * After that property value is get again. The number of elements
+ * in the old collection and in just gotten collection is checked.
+ *
+ * Has <b>OK</b> status if the number of elements in the new obtained
+ * collection is greater than in old one.
+ */
+ public void _ImageMap() {
+ try {
+ XIndexContainer imgMap = (XIndexContainer)
+ oObj.getPropertyValue("ImageMap");
+ int previous = imgMap.getCount();
+ log.println("Count (previous) "+previous);
+ Object im = tEnv.getObjRelation("IMGMAP");
+ imgMap.insertByIndex(0,im);
+ oObj.setPropertyValue("ImageMap",imgMap);
+ imgMap = (XIndexContainer) oObj.getPropertyValue("ImageMap");
+ int after = imgMap.getCount();
+ log.println("Count (after) "+after);
+ tRes.tested("ImageMap",previous < after);
+ }
+ catch (Exception ex) {}
+
+ }
+
+ /**
+ * Creates a new random points sequence.
+ */
+ public Point[][] newPoint() {
+ Point[][] res = new Point[1][185];
+ for (int i=0; i<res[0].length; i++) {
+ res[0][i] = new Point();
+ res[0][i].X = rd()*rd()*rd();
+ res[0][i].Y = rd()*rd()*rd();;
+ }
+ return res;
+ }
+
+ public int rd() {
+ return rdm.nextInt(6);
+ }
+
+ /**
+ * Changes the existing point sequence.
+ */
+ public Point[][] changePoint(Point[][] oldPoint) {
+ Point[][] res = oldPoint;
+ for (int i=0; i<res[0].length; i++) {
+ res[0][i].X += 1;
+ res[0][i].Y += 1;
+ }
+ return res;
+ }
+
+} // finish class _TextGraphicObject
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextPortion.java b/qadevOOo/tests/java/ifc/text/_TextPortion.java
new file mode 100644
index 000000000000..ecc66a589818
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextPortion.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextPortion.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.ControlCharacter;
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.text.TextPortion</code>
+ * service properties :
+ * <ul>
+ * <li><code> TextPortionType</code></li>
+ * <li><code> ControlCharacter</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.text.TextPortion
+ */
+public class _TextPortion extends MultiPropertyTest {
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _ControlCharacter() {
+ testProperty("ControlCharacter",
+ new Short(ControlCharacter.LINE_BREAK),
+ new Short(ControlCharacter.PARAGRAPH_BREAK)) ;
+ }
+
+} //finish class _TextPortion
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextSection.java b/qadevOOo/tests/java/ifc/text/_TextSection.java
new file mode 100644
index 000000000000..9464f50fe703
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextSection.java
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextSection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XTextColumns;
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+
+/**
+ * Testing <code>com.sun.star.text.TextSection</code>
+ * service properties :
+ * <ul>
+ * <li><code> Condition</code></li>
+ * <li><code> IsVisible</code></li>
+ * <li><code> IsProtected</code></li>
+ * <li><code> FileLink</code></li>
+ * <li><code> LinkRegion</code></li>
+ * <li><code> DDECommandType</code></li>
+ * <li><code> DDECommandFile</code></li>
+ * <li><code> DDECommandElement</code></li>
+ * <li><code> BackGraphicURL</code></li>
+ * <li><code> BackGraphicFilter</code></li>
+ * <li><code> BackGraphicLocation</code></li>
+ * <li><code> FootnoteIsCollectAtTextEnd</code></li>
+ * <li><code> FootnoteIsRestartNumbering</code></li>
+ * <li><code> FootnoteRestartNumberingAt</code></li>
+ * <li><code> FootnoteIsOwnNumbering</code></li>
+ * <li><code> FootnoteNumberingType</code></li>
+ * <li><code> FootnoteNumberingPrefix</code></li>
+ * <li><code> FootnoteNumberingSuffix</code></li>
+ * <li><code> EndnoteIsCollectAtTextEnd</code></li>
+ * <li><code> EndnoteIsRestartNumbering</code></li>
+ * <li><code> EndnoteRestartNumberingAt</code></li>
+ * <li><code> EndnoteIsOwnNumbering</code></li>
+ * <li><code> EndnoteNumberingType</code></li>
+ * <li><code> EndnoteNumberingPrefix</code></li>
+ * <li><code> EndnoteNumberingSuffix</code></li>
+ * <li><code> IsAutomaticUpdate</code></li>
+ * </ul> <p>
+ * The following predefined files needed to complete the test:
+ * <ul>
+ * <li> <code>crazy-blue.jpg, space-metal.jpg</code> : are used for
+ * setting 'BackGraphicURL' property. </li>
+ * <ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.text.TextSection
+ */
+public class _TextSection extends MultiPropertyTest {
+
+ /**
+ * Only image file URL can be used as a value.
+ */
+ public void _BackGraphicURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("BackGraphicURL",
+ util.utils.getFullTestURL("crazy-blue.jpg"),
+ util.utils.getFullTestURL("space-metal.jpg")) ;
+ }
+
+ /**
+ * This property can be void, so if old value is <code> null </code>
+ * new value must be specified.
+ */
+ public void _FootnoteNumberingType() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("FootnoteNumberingType",
+ new Short(com.sun.star.text.FootnoteNumbering.PER_DOCUMENT),
+ new Short(com.sun.star.text.FootnoteNumbering.PER_PAGE)) ;
+ }
+
+
+ /**
+ * Custom property tester for property <code>TextColumns</code>
+ */
+ protected PropertyTester TextColumnsTester = new PropertyTester() {
+
+ protected Object getNewValue(String propName, Object oldValue) {
+ XTextColumns TC = null;
+ short val2set = 25;
+
+ TC = (XTextColumns) tEnv.getObjRelation("TC");
+ val2set += ((XTextColumns) oldValue).getColumnCount();
+ TC.setColumnCount(val2set);
+
+ return TC;
+ };
+
+ protected boolean compare(Object obj1, Object obj2) {
+ short val1 = ((XTextColumns) obj1).getColumnCount();
+ short val2 = ((XTextColumns) obj2).getColumnCount();
+ return val1 == val2;
+ }
+
+ protected String toString(Object obj) {
+ return "XTextColumns: ColumnCount = "+((XTextColumns) obj).getColumnCount();
+ }
+
+ };
+
+ public void _TextColumns() {
+ log.println("Testing with custom Property tester");
+ testProperty("TextColumns", TextColumnsTester);
+ }
+
+
+} //finish class _TextContent
+
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextTable.java b/qadevOOo/tests/java/ifc/text/_TextTable.java
new file mode 100644
index 000000000000..08cb1b2cfed3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextTable.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextTable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.text.TextTable</code>
+ * service properties :
+ * <ul>
+ * <li><code> BreakType</code></li>
+ * <li><code> LeftMargin</code></li>
+ * <li><code> RightMargin</code></li>
+ * <li><code> HoriOrient</code></li>
+ * <li><code> KeepTogether</code></li>
+ * <li><code> Split</code></li>
+ * <li><code> PageNumberOffset</code></li>
+ * <li><code> PageDescName</code></li>
+ * <li><code> RelativeWidth</code></li>
+ * <li><code> IsWidthRelative</code></li>
+ * <li><code> RepeatHeadline</code></li>
+ * <li><code> ShadowFormat</code></li>
+ * <li><code> TopMargin</code></li>
+ * <li><code> BottomMargin</code></li>
+ * <li><code> BackTransparent</code></li>
+ * <li><code> Width</code></li>
+ * <li><code> ChartRowAsLabel</code></li>
+ * <li><code> ChartColumnAsLabel</code></li>
+ * <li><code> TableBorder</code></li>
+ * <li><code> TableColumnSeparators</code></li>
+ * <li><code> TableColumnRelativeSum</code></li>
+ * <li><code> BackColor</code></li>
+ * <li><code> BackGraphicURL</code></li>
+ * <li><code> BackGraphicFilter</code></li>
+ * <li><code> BackGraphicLocation</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.text.TextTable
+ */
+public class _TextTable extends MultiPropertyTest {
+
+ /**
+ * This property accepts only restricted range of values.
+ * The property value is switched between '' and 'Standard'
+ * strings.
+ */
+ public void _PageDescName() {
+ testProperty("PageDescName", "", "Standard");
+ }
+
+ /**
+ * For setting this property, 'HoriOrient' property must be
+ * set to non-automatic.
+ */
+ public void _Width() {
+ Short align = new Short(com.sun.star.text.HoriOrientation.CENTER);
+ try {
+ oObj.setPropertyValue("HoriOrient",align);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {}
+ catch (com.sun.star.lang.WrappedTargetException ex) {}
+ catch (com.sun.star.beans.PropertyVetoException ex) {}
+ catch (com.sun.star.beans.UnknownPropertyException ex) {}
+
+ testProperty("Width");
+ }
+
+ /**
+ * For setting this property, 'HoriOrient' property must be
+ * set to non-automatic.
+ */
+ public void _RelativeWidth() {
+ Short align = new Short(com.sun.star.text.HoriOrientation.CENTER);
+ try {
+ oObj.setPropertyValue("HoriOrient",align);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {}
+ catch (com.sun.star.lang.WrappedTargetException ex) {}
+ catch (com.sun.star.beans.PropertyVetoException ex) {}
+ catch (com.sun.star.beans.UnknownPropertyException ex) {}
+
+ testProperty("RelativeWidth");
+ }
+
+} // finish class _TextTable
+
diff --git a/qadevOOo/tests/java/ifc/text/_TextTableRow.java b/qadevOOo/tests/java/ifc/text/_TextTableRow.java
new file mode 100644
index 000000000000..1c5c4a7d5320
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_TextTableRow.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * $RCSfile: _TextTableRow.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.text.TextTableRow</code>
+ * service properties :
+ * <ul>
+ * <li><code> BackColor</code></li>
+ * <li><code> BackTransparent</code></li>
+ * <li><code> VertOrient</code></li>
+ * <li><code> BackGraphicURL</code></li>
+ * <li><code> BackGraphicFilter</code></li>
+ * <li><code> BackGraphicLocation</code></li>
+ * <li><code> TableColumnSeparators</code></li>
+ * <li><code> Height</code></li>
+ * <li><code> IsAutoHeight</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.text.TextTableRow
+ */
+public class _TextTableRow extends MultiPropertyTest {
+
+} // finish class _TextTableRow
+
diff --git a/qadevOOo/tests/java/ifc/text/_ViewSettings.java b/qadevOOo/tests/java/ifc/text/_ViewSettings.java
new file mode 100644
index 000000000000..6bce55dc566f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_ViewSettings.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * $RCSfile: _ViewSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.text.ViewSettings</code>
+ * service properties :
+ * <ul>
+ * <li><code> ShowAnnotations</code></li>
+ * <li><code> ShowBreaks</code></li>
+ * <li><code> ShowDrawings</code></li>
+ * <li><code> ShowFieldCommands</code></li>
+ * <li><code> ShowFootnoteBackground</code></li>
+ * <li><code> ShowGraphics</code></li>
+ * <li><code> ShowHiddenParagraphs</code></li>
+ * <li><code> ShowHiddenText</code></li>
+ * <li><code> ShowHoriRuler</code></li>
+ * <li><code> ShowHoriScrollBar</code></li>
+ * <li><code> ShowIndexMarkBackground</code></li>
+ * <li><code> ShowParaBreaks</code></li>
+ * <li><code> ShowProtectedSpaces</code></li>
+ * <li><code> ShowSoftHyphens</code></li>
+ * <li><code> ShowSpaces</code></li>
+ * <li><code> ShowTableBoundaries</code></li>
+ * <li><code> ShowTables</code></li>
+ * <li><code> ShowTabstops</code></li>
+ * <li><code> ShowTextBoundaries</code></li>
+ * <li><code> ShowTextFieldBackground</code></li>
+ * <li><code> ShowVertRuler</code></li>
+ * <li><code> ShowVertScrollBar</code></li>
+ * <li><code> SmoothScrolling</code></li>
+ * <li><code> SolidMarkHandles</code></li>
+ * <li><code> IsVertRulerRightAligned</code></li>
+ * <li><code> ShowOnlineLayout</code></li>
+ * <li><code> ZoomType</code></li>
+ * <li><code> ZoomValue</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.text.ViewSettings
+ */
+public class _ViewSettings extends MultiPropertyTest {
+
+} // finish class _ViewSettings
+
diff --git a/qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java b/qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java
new file mode 100644
index 000000000000..fe534fbdac2f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAutoTextContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XAutoTextContainer;
+import com.sun.star.text.XAutoTextGroup;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XAutoTextContainer</code>
+ * interface methods :
+ * <ul>
+ * <li><code> insertNewByName()</code></li>
+ * <li><code> removeByName()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XAutoTextContainer
+ */
+public class _XAutoTextContainer extends MultiMethodTest {
+ public XAutoTextContainer oObj = null;
+ // every Thread must insert it's own AutoTextContainer:
+ public String Name = "";
+
+ /**
+ * First removes old element from container with the specified name
+ * if it exists. Then tries to add a new group with the specified
+ * name. <p>
+ *
+ * Has <b>OK</b> status if not <code>null</code>
+ * <code>AutoTextGroup</code> instance is returned.
+ */
+ public void _insertNewByName() {
+ System.out.println("Starting: insertNewByName");
+ boolean result = true;
+ Name = "XAutoTextContainerx" + Thread.currentThread().getName();
+ Name = Name.replace('-','x');
+ Name = Name.replace(':','x');
+ Name = Name.replace('.','x');
+ XAutoTextGroup oGroup = null;
+ //first clear the container
+ log.println("remove old elements in container");
+ System.out.println("remove old elements in container");
+ try {
+ oObj.removeByName(Name);
+ log.println("old elements removed -> OK");
+ System.out.println("old elements removed -> OK");
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("no old elements available -> OK");
+ System.out.println("no old elements available -> OK");
+ }
+
+ // insert an element
+ log.println("insertNewByName");
+ try {
+ System.out.println("Inserting element with name '" + Name + "'");
+ log.println("Inserting element with name '" + Name + "'");
+ oGroup = oObj.insertNewByName(Name);
+ System.out.println("done");
+ } catch (com.sun.star.container.ElementExistException e) {
+ log.println("insertNewByName(): " + e);
+ result &= false;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("insertNewByName(): " + e);
+ result &= false;
+ }
+
+ result &= ( oGroup != null );
+ tRes.tested("insertNewByName()", result);
+ } // end insertNewByName()
+
+ /**
+ * First removes element by name which was added before,
+ * then tries to remove the element with the same name again. <p>
+ *
+ * Has <b> OK </b> status if in the first case no exceptions
+ * were thrown, and in the second case
+ * <code>NoSuchElementException</code> was thrown. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertNewByName() </code> : new element inserted here.</li>
+ * </ul>
+ */
+ public void _removeByName() {
+ requiredMethod("insertNewByName()");
+
+ boolean result = true;
+ // remove the element
+ log.println("removeByName()");
+ try {
+ log.println("Removing element with name '" + Name + "'");
+ oObj.removeByName(Name);
+ result &= true;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ result = false;
+ log.println("removeByName(): " + e + " -> FAILD");
+ }
+
+ log.println("2nd removeByName()");
+ try {
+ oObj.removeByName(Name);
+ log.println("No exceptions were thrown -> FAILED");
+ result = false ;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("2nd removeByName(): -> OK");
+ result &= true;
+ }
+
+ tRes.tested("removeByName()", result);
+
+ } // end removeByName()
+
+} /// finish class XAutoTextContainer
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XAutoTextEntry.java b/qadevOOo/tests/java/ifc/text/_XAutoTextEntry.java
new file mode 100644
index 000000000000..384adcdf15e4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XAutoTextEntry.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAutoTextEntry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XAutoTextEntry;
+import com.sun.star.text.XTextDocument;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.text.XAutoTextEntry</code>
+ * interface methods :
+ * <ul>
+ * <li><code> applyTo()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'TEXTDOC'</code> (of type <code>XTextDocument</code>):
+ * the text document for creating a text range.</li>
+ * <ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XAutoTextEntry
+ */
+public class _XAutoTextEntry extends MultiMethodTest {
+
+ public XAutoTextEntry oObj = null;
+
+ /**
+ * Applies the entry to a range created for the text document obtained from
+ * relation 'TEXTDOC'. <p>
+ * Has <b> OK </b> status if text of the document was changed. <p>
+ */
+ public void _applyTo() {
+ XTextDocument textDoc = (XTextDocument)tEnv.getObjRelation("TEXTDOC");
+ if (textDoc == null) {
+ throw new StatusException
+ (Status.failed("Couldn't get relation 'TEXTDOC'"));
+ }
+
+ String oldText = textDoc.getText().getString();
+ oObj.applyTo(textDoc.getText().createTextCursor());
+ String newText = textDoc.getText().getString();
+
+ log.println("Old text:\n" + oldText + "\nNew text:\n" + newText);
+
+ tRes.tested("applyTo()", ! newText.equals(oldText));
+ }
+
+} // finish class _XAutoTextEntry
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XAutoTextGroup.java b/qadevOOo/tests/java/ifc/text/_XAutoTextGroup.java
new file mode 100644
index 000000000000..fbbeaeec920d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XAutoTextGroup.java
@@ -0,0 +1,341 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XAutoTextGroup.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XAutoTextGroup;
+import com.sun.star.text.XTextRange;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.ValueComparer;
+
+/**
+ * Testing <code>com.sun.star.text.XAutoTextGroup</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getTitles()</code></li>
+ * <li><code> renameByName()</code></li>
+ * <li><code> insertNewByName()</code></li>
+ * <li><code> removeByName()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'TextRange'</code> (of type <code>XTextRange</code>):
+ * the range for which an entry is added. </li>
+ * <ul> <p>
+ * Test is multithread compilant. <p>
+ * @see com.sun.star.text.XAutoTextGroup
+ */
+public class _XAutoTextGroup extends MultiMethodTest {
+
+ public XAutoTextGroup oObj = null;
+
+ /**
+ * Unique number among different interface threads.
+ */
+ protected static int uniq = 0 ;
+
+ /**
+ * Unique string for AutoTextEntry names among different
+ * threads.
+ */
+ protected String str = null ;
+
+ /**
+ * Prefix for unique string.
+ * @see #str
+ */
+ protected static final String pref = "XAutoTextGroup" ;
+ protected XTextRange oRange = null;
+
+ /**
+ * Constructs a unique string for current interface thread
+ * for naming purposes. All old entries which names are
+ * started with prefix used for entry names, are deleted
+ * from the group (they can remain after previous unsuccessfull
+ * test runs). The relation is obtained.
+ *
+ * @throws StatusException if the relation is not found.
+ */
+ public void before() {
+ str = pref + uniq++ ;
+ String[] names = oObj.getElementNames() ;
+ for (int i = 0; i < names.length; i++) {
+ log.println(" " + names[i]);
+ if (names[i].toUpperCase().indexOf(pref.toUpperCase()) > 0) {
+ try {
+ log.println(" ... removing ...");
+ oObj.removeByName(names[i]) ;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Element '" + names[i] + "' not found.");
+ }
+ }
+ }
+
+ oRange = (XTextRange) tEnv.getObjRelation("TextRange");
+ if (oRange == null) {
+ throw new StatusException(Status.failed("No relation found")) ;
+ }
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getTitles() {
+
+ String[] titles = oObj.getTitles();
+ tRes.tested("getTitles()",titles != null);
+ }
+
+ /**
+ * Firsts inserts a new <code>AutoTextEntry</code> using a range
+ * from relation, entry titles are checked before and after
+ * insertion, second tries to add an entry with the same name. <p>
+ *
+ * Has <b>OK</b> status if in the first case titles are changed,
+ * and in the second case <code>ElementExistException</code> is
+ * thrown.
+ */
+ public void _insertNewByName() {
+
+ boolean result = false;
+
+ try {
+ String[] before = oObj.getTitles();
+ oObj.insertNewByName(str, "For " + str,oRange);
+ String[] after = oObj.getTitles();
+ result = !util.ValueComparer.equalValue(before, after);
+ }
+ catch (com.sun.star.container.ElementExistException ex) {
+ log.println("Exception occured while testing insertNewByName");
+ ex.printStackTrace(log);
+ result = false;
+ }
+
+ try {
+ oObj.insertNewByName(str, "For " + str, oRange);
+ log.println(
+ "com::sun::star::container::ElementExistsException wasn't thrown");
+ oObj.removeByName(str);
+ result &= false;
+ } catch (com.sun.star.container.ElementExistException ex) {
+ result &= true;
+ } catch (com.sun.star.container.NoSuchElementException ex) {
+ log.println("Wrong exception was thrown :");
+ ex.printStackTrace(log);
+ result &= false;
+ }
+
+ tRes.tested("insertNewByName()",result);
+
+ }
+
+ /**
+ * Removes <code>AutoTextEntry</code> added before and checks
+ * titles of the group before and after removing. <p>
+ * Has <b> OK </b> status if titles are not equal before and after
+ * removing and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertNewByName() </code> : the entry is
+ * inserted here. </li>
+ * </ul>
+ */
+ public void _removeByName() {
+ requiredMethod("insertNewByName()") ;
+
+ try {
+ String[] before = oObj.getTitles();
+ oObj.removeByName(str);
+ String[] after = oObj.getTitles();
+ tRes.tested("removeByName()",
+ !ValueComparer.equalValue(before,after));
+ }
+ catch (com.sun.star.container.NoSuchElementException ex) {
+ log.println("Exception occured while testing removeByName");
+ ex.printStackTrace(log);
+ tRes.tested("removeByName()",false);
+ }
+ }
+
+ /**
+ * Three cases are tested here :
+ * <ol>
+ * <li> Trying to rename an entry to a name, which already
+ * exists in the group. <code>ElementExistException</code>
+ * must be thrown. </li>
+ * <li> Trying to rename an element with non-existing name.
+ * <code>IllegalArgumentException</code> must be thrown.</li>
+ * <li> The normal situation : no exceptions must be thrown
+ * and element with a new name must arise. </li>
+ * </ol>
+ *
+ * Has <b>OK</b> status if all three cases were completed successfully.
+ */
+ public void _renameByName() {
+ boolean result = false;
+
+ try {
+ String[] tit = oObj.getTitles() ;
+ String[] names = oObj.getElementNames() ;
+ oObj.insertNewByName(str,"For " + str,oRange);
+ oObj.insertNewByName(str + "dup","For " + str,oRange);
+ tit = oObj.getTitles() ;
+ names = oObj.getElementNames() ;
+ result = true;
+ } catch (com.sun.star.container.ElementExistException e) {
+ log.println("Unexpected exception occured :") ;
+ e.printStackTrace(log);
+ } finally {
+ if (!result) {
+ try {
+ oObj.removeByName(str);
+ } catch (com.sun.star.container.NoSuchElementException e) {}
+ try {
+ oObj.removeByName(str + "dup");
+ } catch (com.sun.star.container.NoSuchElementException e) {}
+ tRes.tested("renameByName()", false);
+ return;
+ }
+ }
+
+
+ try {
+ oObj.renameByName(str, str + "dup", "For "+str);
+ log.println(
+ "com::sun::star::container::ElementExistsException wasn't thrown");
+ result = false;
+ } catch (com.sun.star.container.ElementExistException e) {
+ result = true;
+ } catch (com.sun.star.io.IOException e) {
+ log.println("Wrong exception was thrown :");
+ e.printStackTrace(log);
+ result = false;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Wrong exception was thrown :");
+ e.printStackTrace(log);
+ result = false;
+ } finally {
+ try {
+ oObj.removeByName(str);
+ } catch (com.sun.star.container.NoSuchElementException e) {}
+ try {
+ oObj.removeByName(str + "dup");
+ } catch (com.sun.star.container.NoSuchElementException e) {}
+ }
+
+ try {
+ oObj.renameByName("~"+str,str,str);
+ log.println(
+ "com::sun::star::lang::IllegalArgumentException wasn't thrown");
+ result &= false;
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ result &= true;
+ } catch (com.sun.star.container.ElementExistException e) {
+ log.println("Unexpected exception :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.io.IOException e) {
+ log.println("Unexpected exception :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ } finally {
+ try {
+ oObj.removeByName(str);
+ } catch (com.sun.star.container.NoSuchElementException e) {}
+ }
+
+ try {
+ oObj.insertNewByName(str, "For " + str, oRange);
+
+ oObj.renameByName(str,str+"a",str+"b");
+ result &= oObj.hasByName(str + "a");
+ } catch (com.sun.star.container.ElementExistException ex) {
+ log.println("Exception occured while testing renameByName");
+ ex.printStackTrace(log);
+ result &=false;
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured while testing renameByName");
+ ex.printStackTrace(log);
+ result &=false;
+ } catch (com.sun.star.io.IOException ex) {
+ log.println("Exception occured while testing renameByName");
+ ex.printStackTrace(log);
+ result &=false;
+ } finally {
+ try {
+ oObj.removeByName(str);
+ } catch (com.sun.star.container.NoSuchElementException e) {}
+ try {
+ oObj.removeByName(str + "a");
+ } catch (com.sun.star.container.NoSuchElementException e) {}
+ }
+
+ tRes.tested("renameByName()",result);
+
+ }
+
+} // finish class _XAutoTextGroup
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XChapterNumberingSupplier.java b/qadevOOo/tests/java/ifc/text/_XChapterNumberingSupplier.java
new file mode 100644
index 000000000000..f6cc39fb2acf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XChapterNumberingSupplier.java
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XChapterNumberingSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.container.XIndexReplace;
+import com.sun.star.text.XChapterNumberingSupplier;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XChapterNumberingSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getChapterNumberingRules()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XChapterNumberingSupplier
+ */
+public class _XChapterNumberingSupplier extends MultiMethodTest {
+
+ public static XChapterNumberingSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the returned collection
+ * has at least one element.
+ */
+ public void _getChapterNumberingRules() {
+ boolean res = false;
+
+ XIndexReplace the_chapter = oObj.getChapterNumberingRules();
+ res = the_chapter.hasElements();
+
+ tRes.tested("getChapterNumberingRules()",res);
+ }
+
+} // finish class _XChapterNumberingSupplier
+
diff --git a/qadevOOo/tests/java/ifc/text/_XDefaultNumberingProvider.java b/qadevOOo/tests/java/ifc/text/_XDefaultNumberingProvider.java
new file mode 100644
index 000000000000..68c5ee06cd6f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XDefaultNumberingProvider.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDefaultNumberingProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.Locale;
+import com.sun.star.text.XDefaultNumberingProvider;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.text.XDefaultNumberingProvider</code>
+* interface methods :
+* <ul>
+* <li><code> getDefaultOutlineNumberings()</code></li>
+* <li><code> getDefaultContinuousNumberingLevels()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.text.XDefaultNumberingProvider
+*/
+public class _XDefaultNumberingProvider extends MultiMethodTest {
+
+ public static XDefaultNumberingProvider oObj = null;
+ private Locale loc = new Locale("en", "EN", "") ;
+
+ /**
+ * Just gets numberings for "en" locale. <p>
+ * Has <b>OK</b> status if not <code>null</code> value returned
+ * and no runtime exceptions occured.
+ */
+ public void _getDefaultOutlineNumberings() {
+ XIndexAccess xIA[] = oObj.getDefaultOutlineNumberings(loc) ;
+
+ tRes.tested("getDefaultOutlineNumberings()", xIA != null) ;
+ }
+
+ /**
+ * Just gets numberings for "en" locale. <p>
+ * Has <b>OK</b> status if not <code>null</code> value returned
+ * and no runtime exceptions occured.
+ */
+ public void _getDefaultContinuousNumberingLevels() {
+ PropertyValue[][] lev = oObj.getDefaultContinuousNumberingLevels(loc) ;
+
+ tRes.tested("getDefaultContinuousNumberingLevels()", lev != null) ;
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java b/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java
new file mode 100644
index 000000000000..5f41ac199f10
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDocumentIndex.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XDocumentIndex;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XDocumentIndex</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getServiceName()</code></li>
+ * <li><code> update()</code></li>
+ * </ul> <p>
+ *
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'TextDoc'</code> (of type <code>XTextDocument</code>):
+ * the text document for creating and inserting index mark.</li>
+ * <ul> <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XDocumentIndex
+ */
+public class _XDocumentIndex extends MultiMethodTest {
+
+ public XDocumentIndex oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the retruned service name
+ * is equal to 'com.sun.star.text.DocumentIndex'.
+ */
+ public void _getServiceName() {
+ String serv = oObj.getServiceName();
+ tRes.tested("getServiceName()",
+ serv.equals("com.sun.star.text.DocumentIndex"));
+ }
+
+ /**
+ * Gets the document from relation and insert a new index mark.
+ * Then it stores the text content of document index before
+ * update and after.<p>
+ *
+ * Has <b> OK </b> status if index content is changed and
+ * new index contains index mark inserted. <p>
+ */
+ public void _update() {
+ boolean bOK = true;
+
+ try {
+ XTextDocument xTextDoc = (XTextDocument)
+ tEnv.getObjRelation("TextDoc");
+ XText xText = xTextDoc.getText();
+ XTextRange xTR = xText.getEnd();
+ xTR.setString("IndexMark");
+
+ XMultiServiceFactory xDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+
+ Object idxMark = xDocMSF.createInstance
+ ("com.sun.star.text.DocumentIndexMark");
+ XTextContent xTC = (XTextContent) UnoRuntime.queryInterface
+ (XTextContent.class, idxMark);
+ xText.insertTextContent(xTR, xTC, true);
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't insert index mark.");
+ e.printStackTrace(log);
+ bOK = false ;
+ }
+
+ String contentBefore = oObj.getAnchor().getString();
+ log.println("Content before: '" + contentBefore + "'");
+
+ oObj.update();
+
+ try {
+ Thread.sleep(1000);
+ }
+ catch (InterruptedException ex) {
+ }
+
+
+ String contentAfter = oObj.getAnchor().getString();
+ log.println("Content after: '" + contentAfter + "'");
+
+ bOK &= !contentAfter.equals(contentBefore);
+ bOK &= contentAfter.indexOf("IndexMark") > -1;
+
+ tRes.tested("update()",bOK);
+ }
+
+
+
+} // finish class _XDocumentIndex
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XEndnotesSupplier.java b/qadevOOo/tests/java/ifc/text/_XEndnotesSupplier.java
new file mode 100644
index 000000000000..3abe0fc168fc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XEndnotesSupplier.java
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XEndnotesSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.text.XEndnotesSupplier;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.text.XEndnotesSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getEndnotes()</code></li>
+ * <li><code> getEndnoteSettings()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XEndnotesSupplier
+ */
+public class _XEndnotesSupplier extends MultiMethodTest {
+
+ public static XEndnotesSupplier oObj = null; // oObj filled by MultiMethodTest
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the collection returned has at least
+ * one element.
+ */
+ public void _getEndnotes() {
+ boolean res = false;
+
+ XIndexAccess the_endnotes = oObj.getEndnotes();
+ res = the_endnotes.hasElements();
+
+ tRes.tested("getEndnotes()",res);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getEndnoteSettings() {
+ boolean res = false;
+
+ XPropertySet the_props = oObj.getEndnoteSettings();
+ res = ( the_props != null );
+
+ tRes.tested("getEndnoteSettings()",res);
+ }
+
+} // finish class _XEndnotesSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XFootnote.java b/qadevOOo/tests/java/ifc/text/_XFootnote.java
new file mode 100644
index 000000000000..73638a48a431
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XFootnote.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFootnote.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XFootnote;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import util.XInstCreator;
+
+
+/**
+ * Testing <code>com.sun.star.text.XFootnote</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getLabel()</code></li>
+ * <li><code> setLabel()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XFootnote
+ */
+public class _XFootnote extends MultiMethodTest {
+
+ public XFootnote oObj = null; // oObj filled by MultiMethodTest
+
+ XInstCreator info = null; // instance creator
+ XInterface oInt = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getLabel(){
+
+ boolean result;
+
+ // testing getLabel
+ log.println("Testing getLabel() ... ");
+ String oldLabel = oObj.getLabel();
+ log.println("getLabel: Old Value: " + oldLabel);
+ result = (oldLabel != null);
+ if (result) {
+ log.println(" ... getLabel() - OK");
+ }
+ else {
+ log.println(" ... getLabel() - FAILED");
+ }
+ tRes.tested("getLabel()", result);
+
+ } // finished getLabel
+
+
+ /**
+ * Sets a new label, then using <code>getLabel</code> method
+ * checks if the label was set. <p>
+ *
+ * Has <b>OK</b> status if set and get values are equal.
+ */
+ public void _setLabel(){
+
+ boolean result;
+ String str = "New XFootnote Label";
+
+ // testing getLabel
+ log.println("Testing setLabel() ... ");
+ log.println("New label : " + str);
+
+ String oldLabel = oObj.getLabel();
+ log.println("Old label was: " + oldLabel);
+ oObj.setLabel(str);
+
+ String res = oObj.getLabel();
+
+ log.println("verify setLabel result");
+ result = (res.equals(str));
+ if (result) {
+ log.println(" ... setLabel() - OK");
+ }
+ else {
+ log.println(" ... setLabel() - FAILED");
+ }
+ tRes.tested("setLabel()", result);
+
+ log.println("restoring the old label value");
+ oObj.setLabel(oldLabel);
+ } // finished setLabel
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XFootnotesSupplier.java b/qadevOOo/tests/java/ifc/text/_XFootnotesSupplier.java
new file mode 100644
index 000000000000..b2c60552c654
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XFootnotesSupplier.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFootnotesSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.text.XFootnotesSupplier;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XFootnotesSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getFootnotes()</code></li>
+ * <li><code> getFootnoteSettings()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XFootnotesSupplier
+ */
+public class _XFootnotesSupplier extends MultiMethodTest {
+ public XFootnotesSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getFootnotes(){
+ boolean result = true;
+ XIndexAccess footnotes = null;
+
+ log.println("testing getFootnotes() ... ");
+
+ footnotes = oObj.getFootnotes();
+ result = footnotes != null;
+ tRes.tested("getFootnotes()", result);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getFootnoteSettings(){
+ boolean result = true;
+ XPropertySet footnoteSettings = null;
+
+ log.println("testing getFootnoteSettings() ... ");
+
+ footnoteSettings = oObj.getFootnoteSettings();
+ result = footnoteSettings != null;
+
+ tRes.tested("getFootnoteSettings()", result);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_XLineNumberingSupplier.java b/qadevOOo/tests/java/ifc/text/_XLineNumberingSupplier.java
new file mode 100644
index 000000000000..5a89b6f66509
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XLineNumberingSupplier.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XLineNumberingSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.text.XLineNumberingSupplier;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XLineNumberingSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getLineNumberingRules()</code></li>
+ * <li><code> setLineNumberingRules()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XLineNumberingSupplier
+ */
+public class _XLineNumberingSupplier extends MultiMethodTest {
+
+ public static XLineNumberingSupplier oObj = null;
+
+ public PropertyValue[][] lineNumberingSettings = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getLineNumberingRules() {
+ boolean res = false;
+ lineNumberingSettings = oObj.getLineNumberingRules();
+ res = lineNumberingSettings != null ;
+ tRes.tested("getLineNumberingRules()",res);
+ }
+
+} // finish class _XLineNumberingSupplier
+
diff --git a/qadevOOo/tests/java/ifc/text/_XPageCursor.java b/qadevOOo/tests/java/ifc/text/_XPageCursor.java
new file mode 100644
index 000000000000..1013fffec42f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XPageCursor.java
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPageCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XPageCursor;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextDocument;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.text.XPageCursor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> jumpToFirstPage()</code></li>
+ * <li><code> jumpToLastPage()</code></li>
+ * <li><code> jumpToPage()</code></li>
+ * <li><code> getPage()</code></li>
+ * <li><code> jumpToNextPage()</code></li>
+ * <li><code> jumpToPreviousPage()</code></li>
+ * <li><code> jumpToEndOfPage()</code></li>
+ * <li><code> jumpToStartOfPage()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'TEXTDOC'</code> (of type <code>XTextDocument</code>):
+ * is used to insert text to document to fill at least two pages. </li>
+ * <ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XPageCursor
+ */
+public class _XPageCursor extends MultiMethodTest {
+
+ public XPageCursor oObj = null; // oObj filled by MultiMethodTest
+ short count = 0;
+
+ /**
+ * First adds text to the document using relation to fill at least two
+ * pages. Then obtains the number of current page. <p>
+ *
+ * Has <b>OK</b> status if the returned value is positive.
+ */
+ public void _getPage(){
+ log.println( "test for getPage()" );
+ XTextDocument myText = (XTextDocument)tEnv.getObjRelation( "TEXTDOC" );
+ XText aText = myText.getText();
+ XTextCursor myCursor = aText.createTextCursor();
+
+ try{
+ for (int i = 0; i < 10; i++){
+ for (int j = 0; j < 20; j++){
+ aText.insertString(myCursor, "The quick brown fox ",false);
+ aText.insertString(myCursor, "jumps over the lazy dog ",
+ false);
+ }
+ aText.insertControlCharacter(myCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false);
+ }
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println( "Exception :" );
+ e.printStackTrace(log);
+ }
+
+ count = oObj.getPage();
+ tRes.tested("getPage()", count > 0 );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _jumpToEndOfPage(){
+ log.println( "test for jumpToEndOfPage()" );
+ tRes.tested("jumpToEndOfPage()", oObj.jumpToEndOfPage());
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _jumpToFirstPage(){
+ log.println( "test for jumpToFirstPage()" );
+ tRes.tested("jumpToFirstPage()", oObj.jumpToFirstPage());
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _jumpToLastPage(){
+ log.println( "test for jumpToLastPage()" );
+ tRes.tested("jumpToLastPage()", oObj.jumpToLastPage());
+ }
+
+ /**
+ * Firts jumps to the first page to have at least one
+ * next page, then call the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _jumpToNextPage(){
+ oObj.jumpToFirstPage() ;
+ log.println( "test for jumpToNextPage()" );
+ tRes.tested("jumpToNextPage()", oObj.jumpToNextPage());
+ }
+
+ /**
+ * Tries to jump to the page with number 1. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _jumpToPage(){
+ short n = 1;
+ log.println( "test for jumpToPage()" );
+ tRes.tested("jumpToPage()", oObj.jumpToPage(n));
+ }
+
+ /**
+ * Firts jumps to the last page to have at least one
+ * previous page, then call the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _jumpToPreviousPage(){
+ log.println( "test for jumpToPreviousPage()" );
+ oObj.jumpToLastPage();
+ tRes.tested("jumpToPreviousPage()", oObj.jumpToPreviousPage());
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _jumpToStartOfPage(){
+ log.println( "test for jumpToStartOfPage()" );
+ tRes.tested("jumpToStartOfPage()", oObj.jumpToStartOfPage());
+ }
+} // finish class _XPageCursor
+
diff --git a/qadevOOo/tests/java/ifc/text/_XPagePrintable.java b/qadevOOo/tests/java/ifc/text/_XPagePrintable.java
new file mode 100644
index 000000000000..53f09ddb77f3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XPagePrintable.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPagePrintable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.text.XPagePrintable;
+import lib.MultiMethodTest;
+import util.utils;
+
+/**
+ * Testing <code>com.sun.star.text.XPagePrintable</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getPagePrintSettings()</code></li>
+ * <li><code> setPagePrintSettings()</code></li>
+ * <li><code> printPages()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XPagePrintable
+ */
+public class _XPagePrintable extends MultiMethodTest {
+
+ public static XPagePrintable oObj = null;
+ public PropertyValue[] PrintSettings = new PropertyValue[0];
+
+ /**
+ * Types of print settings properties by order they returned by
+ * <code>getPagePrintSettings()</code>.
+ */
+ public String[] types = new String[]{"Short","Short","Integer","Integer",
+ "Integer","Integer","Integer","Integer","Boolean"};
+
+ /**
+ * Calls the method and examines the returned array of properties. <p>
+ *
+ * Has <b>OK</b> status if all properties' types are correspond
+ * to their expected values of the <code>types</code> array.
+ *
+ * @see #types
+ */
+ public void _getPagePrintSettings() {
+ boolean res = true;
+ PrintSettings = oObj.getPagePrintSettings();
+
+ for (int i=0;i<PrintSettings.length;i++) {
+ String the_type = PrintSettings[i].Value.getClass().toString();
+ if (!the_type.endsWith(types[i])) {
+ log.println("Name: "+PrintSettings[i].Name);
+ log.println("Value: "+PrintSettings[i].Value);
+ log.println("Type"+the_type);
+ log.println("Expected: java.lang."+types[i]);
+ res = false;
+ }
+ }
+
+ tRes.tested("getPagePrintSettings()",res);
+ }
+
+ /**
+ * Changes a property 'IsLandscape' in existsing print settings,
+ * and sets these settings back. <p>
+ *
+ * Has <b>OK</b> status if settings gotten again has the changed
+ * 'IsLandscape' property value. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getPagePrintSettings() </code> : to have existing
+ * print settings. </li>
+ * </ul>
+ */
+ public void _setPagePrintSettings() {
+ requiredMethod("getPagePrintSettings()");
+ boolean res = true;
+
+ Boolean landscape = (Boolean) PrintSettings[8].Value;
+ Boolean newlandscape = new Boolean(!landscape.booleanValue());
+ PrintSettings[8].Value = newlandscape;
+ oObj.setPagePrintSettings(PrintSettings);
+ res = (oObj.getPagePrintSettings()[8].Value.equals(newlandscape));
+
+ tRes.tested("setPagePrintSettings()",res);
+ }
+
+ /**
+ * Creates print options for printing into file situated in the SOffice
+ * temporary directory. If the file already exists it is deleted.
+ * Then calls the method. <p>
+ *
+ * Has <b>OK</b> status if the file to which printing must be performed
+ * is exists.
+ */
+ public void _printPages() {
+ boolean res = true;
+
+ try {
+ PropertyValue[] PrintOptions = new PropertyValue[1];
+ PropertyValue firstProp = new PropertyValue();
+ firstProp.Name = "FileName";
+ log.println("Printing to :"+utils.getOfficeTemp(tParam.getMSF())+
+ "XPagePrintable.prt");
+ firstProp.Value = utils.getOfficeTemp(tParam.getMSF())+
+ "XPagePrintable.prt";
+ firstProp.State = com.sun.star.beans.PropertyState.DEFAULT_VALUE;
+ PrintOptions[0] = firstProp;
+ java.io.File aFile = new java.io.File(utils.getOfficeTempDir(
+ tParam.getMSF())+"XPagePrintable.prt");
+ if (aFile.exists()) aFile.delete() ;
+ oObj.printPages(PrintOptions);
+ res = aFile.exists();
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception while checking 'printPages'");
+ res = false;
+ ex.printStackTrace(log);
+ }
+
+ tRes.tested("printPages()",res);
+ }
+
+} // finish class _XPagePrintable
+
diff --git a/qadevOOo/tests/java/ifc/text/_XParagraphCursor.java b/qadevOOo/tests/java/ifc/text/_XParagraphCursor.java
new file mode 100644
index 000000000000..2659a33fa1d8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XParagraphCursor.java
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XParagraphCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XParagraphCursor;
+import lib.MultiMethodTest;
+import util.XInstCreator;
+
+/**
+ * Testing <code>com.sun.star.text.XParagraphCursor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> isStartOfParagraph()</code></li>
+ * <li><code> isEndOfParagraph()</code></li>
+ * <li><code> gotoStartOfParagraph()</code></li>
+ * <li><code> gotoEndOfParagraph()</code></li>
+ * <li><code> gotoNextParagraph()</code></li>
+ * <li><code> gotoPreviousParagraph()</code></li>
+ * </ul> <p>
+ *
+ * <b>Prerequisites :</b> the text must have at least
+ * two paragraphs. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XParagraphCursor
+ */
+public class _XParagraphCursor extends MultiMethodTest {
+
+ public XParagraphCursor oObj = null; // oObj filled by MultiMethodTest
+ XInstCreator info = null; // instance creator
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _gotoEndOfParagraph(){
+ log.println( "test for gotoEndOfParagraph()" );
+ if (oObj.isEndOfParagraph()) log.println("This is the end of the paragraph");
+ else log.println("This isn't the end of the paragraph");
+ log.println("gotoEndOfParagraph()");
+ boolean result = oObj.gotoEndOfParagraph(false);
+ tRes.tested("gotoEndOfParagraph()", result );
+ if (oObj.isEndOfParagraph()) log.println("This is the end of the paragraph");
+ else log.println("This isn't the end of the paragraph");
+ if (!result) log.println("But 'gotoEndOfParagraph()' returns false");
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code>gotoPreviousParagraph()</code> : to be sure next paragraph
+ * exists. </li>
+ * </ul>
+ */
+ public void _gotoNextParagraph(){
+ requiredMethod( "gotoPreviousParagraph()" );
+ log.println( "test for gotoNextParagraph()" );
+ tRes.tested("gotoNextParagraph()", oObj.gotoNextParagraph(false) );
+ }
+
+ /**
+ * First moves the cursor to the next paragraph to be sure
+ * that previous paragraph exists and then calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _gotoPreviousParagraph(){
+ //requiredMethod( "gotoNextParagraph()" );
+ oObj.gotoNextParagraph(false);
+ log.println( "test for gotoPreviousParagraph()" );
+ tRes.tested("gotoPreviousParagraph()", oObj.gotoPreviousParagraph(false) );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _gotoStartOfParagraph(){
+ log.println( "test for gotoStartOfParagraph()" );
+ tRes.tested("gotoStartOfParagraph()", oObj.gotoStartOfParagraph(false) );
+ }
+
+ /**
+ * Moves the cursor to the end of paragraph then check if it is
+ * at the end. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _isEndOfParagraph(){
+ oObj.gotoEndOfParagraph(false);
+ log.println( "test for isEndOfParagraph()" );
+ tRes.tested("isEndOfParagraph()", oObj.isEndOfParagraph() );
+ }
+
+ /**
+ * Moves the cursor to the start of paragraph then check if it is
+ * at the start. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value.
+ */
+ public void _isStartOfParagraph(){
+ oObj.gotoStartOfParagraph(false);
+ log.println( "test for isStartOfParagraph()" );
+ tRes.tested("isStartOfParagraph()", oObj.isStartOfParagraph() );
+ }
+
+ } // finish class _XParagraphCursor
+
diff --git a/qadevOOo/tests/java/ifc/text/_XReferenceMarksSupplier.java b/qadevOOo/tests/java/ifc/text/_XReferenceMarksSupplier.java
new file mode 100644
index 000000000000..129d4157b397
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XReferenceMarksSupplier.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XReferenceMarksSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.text.XReferenceMarksSupplier;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XReferenceMarksSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getReferenceMarks()</code></li>
+ * </ul> <p>
+ *
+ * <b>Prerequisites: </b> the reference mark collection
+ * must contain an element named 'SwXTextDocument' <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XReferenceMarksSupplier
+ */
+public class _XReferenceMarksSupplier extends MultiMethodTest {
+
+ public static XReferenceMarksSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if there is an element
+ * named 'SwXTextDocument' in the returned collection.
+ */
+ public void _getReferenceMarks() {
+ boolean res = false;
+ XNameAccess the_marks = oObj.getReferenceMarks();
+ res = the_marks.hasByName("SwXTextDocument");
+ tRes.tested("getReferenceMarks()",res);
+ }
+
+} // finish class _XReferenceMarksSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java b/qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java
new file mode 100644
index 000000000000..182d49eff3ac
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRelativeTextContentInsert.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XRelativeTextContentInsert;
+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;
+import lib.MultiMethodTest;
+import util.XInstCreator;
+
+/**
+ * Testing <code>com.sun.star.text.XRelativeTextContentInsert</code>
+ * interface methods :
+ * <ul>
+ * <li><code> insertTextContentBefore()</code></li>
+ * <li><code> insertTextContentAfter()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'PARA'</code> (of type <code>XInstCreator</code>):
+ * the creator which can create instances of
+ * <code>com.sun.star.text.Paragraph</code> service. </li>
+ * <li> <code>'XTEXTINFO'</code> (of type <code>XInstCreator</code>):
+ * the creator which can create instances of soem text content
+ * service (objects which implement <code>XTextContent</code>).
+ * </li>
+ * <ul> <p>
+ *
+ * Tested component <b>must implement</b> <code>XText</code>
+ * interface for proper testing. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XRelativeTextContentInsert
+ */
+public class _XRelativeTextContentInsert extends MultiMethodTest {
+
+ public XRelativeTextContentInsert oObj = null;
+ public XTextContent content = null;
+
+ /**
+ * First an instance of <code>Paragraph</code> service created
+ * using relation and inserted into text. Then an instance
+ * of text content is created and inserted after the paragraph. <p>
+ *
+ * Has <b>OK</b> status if no exceptions occured.
+ */
+ public void _insertTextContentAfter() {
+
+ try {
+ XInstCreator para = (XInstCreator)tEnv.getObjRelation( "PARA" );
+ XInterface oInt = para.createInstance();
+ XTextContent new_content = (XTextContent) oInt;
+ XText theText = (XText)
+ UnoRuntime.queryInterface(XText.class,oObj);
+ XTextCursor oCursor = theText.createTextCursor();
+ XInstCreator info = (XInstCreator)
+ tEnv.getObjRelation( "XTEXTINFO" );
+ oInt = info.createInstance();
+ content = (XTextContent) oInt;
+ theText.insertTextContent(oCursor, content, false);
+ oObj.insertTextContentAfter(new_content,content);
+ tRes.tested("insertTextContentAfter()",true);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured while checking "+
+ "insertTextContentAfter()");
+ ex.printStackTrace(log);
+ tRes.tested("insertTextContentAfter()",false);
+ }
+
+
+ } // end _insertTextContentAfter()
+
+ /**
+ * An instance of text content is created using relation
+ * and inserted before the paragraph which was added into
+ * text in <code>insertTextContentAfter</code> method test. <p>
+ *
+ * Has <b>OK</b> status if no exceptions occured. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertTextContentAfter() </code> : here the
+ * <code>Paragraph</code> instance is inserted. </li>
+ * </ul>
+ */
+ public void _insertTextContentBefore() {
+ requiredMethod("insertTextContentAfter()");
+ try {
+ XInstCreator para = (XInstCreator)tEnv.getObjRelation( "PARA" );
+ XInterface oInt = para.createInstance();
+ XTextContent new_content = (XTextContent) oInt;
+ oObj.insertTextContentBefore(new_content,content);
+ tRes.tested("insertTextContentBefore()",true);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured while checking "+
+ "insertTextContentBefore()");
+ ex.printStackTrace(log);
+ tRes.tested("insertTextContentBefore()",false);
+ }
+
+
+ } // end _insertTextContentBefore()
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_XSentenceCursor.java b/qadevOOo/tests/java/ifc/text/_XSentenceCursor.java
new file mode 100644
index 000000000000..2251d43765c1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XSentenceCursor.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSentenceCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XSentenceCursor;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XSentenceCursor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> isStartOfSentence()</code></li>
+ * <li><code> isEndOfSentence()</code></li>
+ * <li><code> gotoNextSentence()</code></li>
+ * <li><code> gotoPreviousSentence()</code></li>
+ * <li><code> gotoStartOfSentence()</code></li>
+ * <li><code> gotoEndOfSentence()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XSentenceCursor
+ */
+public class _XSentenceCursor extends MultiMethodTest {
+
+ public XSentenceCursor oObj = null; // oObj filled by MultiMethodTest
+
+ /**
+ * First goes to next sentence (to be sure that previous exists),
+ * then calls the method. <p>
+ *
+ * Has <b>OK</b> status if the method returns <code>true</code>.
+ */
+ public void _gotoPreviousSentence(){
+ oObj.gotoNextSentence(false);
+ oObj.gotoNextSentence(false);
+ tRes.tested("gotoPreviousSentence()", oObj.gotoPreviousSentence(false) );
+ }
+
+ /**
+ * First goes to previous sentence (to be sure that next exists),
+ * then calls the method. <p>
+ *
+ * Has <b>OK</b> status if the method returns <code>true</code>.
+ */
+ public void _gotoNextSentence(){
+ oObj.gotoPreviousSentence(false) ;
+ oObj.gotoPreviousSentence(false) ;
+ tRes.tested("gotoNextSentence()", oObj.gotoNextSentence(false) );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> gotoPreviousSentence() </code> : to be sure the
+ * cursor is in range of some sentence. </li>
+ * </ul>
+ */
+ public void _gotoEndOfSentence(){
+ requiredMethod( "gotoPreviousSentence()" );
+ tRes.tested("gotoEndOfSentence()", oObj.gotoEndOfSentence(false) );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> gotoPreviousSentence() </code> : to be sure the
+ * cursor is in range of some sentence. </li>
+ * </ul>
+ */
+ public void _gotoStartOfSentence(){
+ requiredMethod( "gotoPreviousSentence()" );
+ tRes.tested("gotoStartOfSentence()", oObj.gotoStartOfSentence(false) );
+ }
+
+ /**
+ * First moves the cursor to the start of sentence and then calls
+ * the method. <p>
+ *
+ * Has <b>OK</b> status if the method returns <code>true</code>.
+ */
+ public void _isStartOfSentence(){
+ oObj.gotoStartOfSentence(false) ;
+ tRes.tested("isStartOfSentence()", oObj.isStartOfSentence() );
+ }
+
+ /**
+ * First moves the cursor to the end of sentence and then calls
+ * the method. <p>
+ *
+ * Has <b>OK</b> status if the method returns <code>true</code>.
+ */
+ public void _isEndOfSentence(){
+ oObj.gotoEndOfSentence(false) ;
+ tRes.tested("isEndOfSentence()", oObj.isEndOfSentence() );
+ }
+
+ } // finish class _XSentenceCursor
+
diff --git a/qadevOOo/tests/java/ifc/text/_XSimpleText.java b/qadevOOo/tests/java/ifc/text/_XSimpleText.java
new file mode 100644
index 000000000000..c9844c8b3e1f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XSimpleText.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSimpleText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import lib.MultiMethodTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.text.XSimpleText</code>
+* interface methods :
+* <ul>
+* <li><code> createTextCursor()</code></li>
+* <li><code> createTextCursorByRange()</code></li>
+* <li><code> insertString()</code></li>
+* <li><code> insertControlCharacter()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.text.XSimpleText
+*/
+public class _XSimpleText extends MultiMethodTest {
+
+ XTextCursor oCursor = null;
+ public XSimpleText oObj = null;
+
+ /**
+ * Creates text cursor. <p>
+ * Has <b> OK </b> status if not null value returned. <p>
+ */
+ public void _createTextCursor() {
+
+ log.println( "Testing createTextCursor()" );
+ oCursor = oObj.createTextCursor();
+ tRes.tested( "createTextCursor()", oCursor != null );
+ }
+
+ /**
+ * Inserts a string at the cursor position.<p>
+ * Has <b> OK </b> status if the whole result string has a string
+ * inserted as its substring. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createTextCursor() </code> : to have a cursor
+ * where text should be inserted. </li>
+ * </ul>
+ */
+ public void _insertString() {
+ requiredMethod("createTextCursor()");
+ log.println( "Testing insertString)" );
+ String sStr = getInterfaceName() ;
+ oObj.insertString( oCursor, sStr, false );
+ String gStr = oObj.getText().getString() ;
+
+ tRes.tested( "insertString()", gStr != null &&
+ gStr.indexOf(sStr) >= 0) ;
+ }
+
+ /**
+ * Inserts paragraph break character into text and then checks
+ * if this character is present in the result string. <p>
+ * Has <b> OK </b> status if the result string has
+ * paragraph break character. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createTextCursor </code> : to have a cursor object. </li>
+ * </ul>
+ */
+ public void _insertControlCharacter() {
+ boolean bOK = true;
+
+ requiredMethod("createTextCursor()");
+ log.println( "Testing insertControlCharacter()" );
+ try {
+ oObj.insertControlCharacter( oCursor,
+ ControlCharacter.PARAGRAPH_BREAK, false);
+ oObj.insertControlCharacter( oCursor,
+ ControlCharacter.LINE_BREAK, false);
+ oObj.insertString(oObj.createTextCursor(),"newLine",false);
+ }
+ catch(com.sun.star.lang.IllegalArgumentException e ) {
+ // Some exception.FAILED
+ Status.failed( e.toString() );
+ bOK = false;
+ }
+ String gStr = oObj.getString() ;
+
+ tRes.tested( "insertControlCharacter()", bOK && gStr != null &&
+ gStr.indexOf("\n") > -1);
+ }
+
+ /**
+ * Creates another text cursor using existing cursor's range. <p>
+ * Has <b> OK </b> status if not null value returned. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createTextCursor </code> : to have a cursor object. </li>
+ * </ul>
+ */
+ public void _createTextCursorByRange() {
+
+ requiredMethod("createTextCursor()");
+ oCursor.gotoStart(false);
+ log.println( "Testing createTextCursorByRange()" );
+ XTextCursor oTCursor = oObj.createTextCursorByRange(oCursor);
+ tRes.tested("createTextCursorByRange()", oTCursor != null) ;
+ }
+} // finish class _XSimpleText
+
diff --git a/qadevOOo/tests/java/ifc/text/_XText.java b/qadevOOo/tests/java/ifc/text/_XText.java
new file mode 100644
index 000000000000..12c897f89381
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XText.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.Status;
+import util.XInstCreator;
+
+/**
+ * Testing <code>com.sun.star.text.XText</code>
+ * interface methods :
+ * <ul>
+ * <li><code> insertTextContent()</code></li>
+ * <li><code> removeTextContent()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'XTEXTINFO'</code> (of type <code>lib.XInstCreator</code>):
+ * creator which can create instances of <code>XTextContent</code>
+ * implementations. </li>
+ * <ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XText
+ */
+public class _XText extends MultiMethodTest {
+
+ public static XText oObj = null; // oObj filled by MultiMethodTest
+ XTextCursor oCursor = null; // textcursor
+ XInstCreator info = null; // instance creator
+ XInterface oInt = null; // instance to insert and remove
+
+ /**
+ * First an instance of text content is created using relation
+ * and inserted into text. Then the number of contents is checked
+ * using the relation. Second a <code>null</code> content is tried
+ * to insert. <p>
+ *
+ * Has <b> OK </b> status if in the first case after inserting number
+ * of content objects is greater than zero and in the second
+ * case <code>IllegalArgumentException</code> is thrown. <p>
+ */
+ public void _insertTextContent() {
+ boolean result = false;
+ info = (XInstCreator)tEnv.getObjRelation( "XTEXTINFO" );
+ oInt = info.createInstance();
+
+ // write to log what we try next
+ log.println( "test for createTextCursor()" );
+ oCursor = oObj.createTextCursor();
+
+ // write to log what we try next
+ log.println( "test for insertTextContent()" );
+ try {
+ oObj.insertTextContent(oCursor, (XTextContent)oInt, false);
+ }
+ catch( com.sun.star.lang.IllegalArgumentException iaE ){
+ Status.failed(iaE.toString());
+ return;
+ }
+
+ // get indexaccess to the tablecollection
+ XIndexAccess xIA = info.getCollection();
+
+ // this comparision works just because it has to be at least one
+ // table at this point regardless which thread inserted it
+ // there is although the possibility that the first threads call
+ // failed, the second not and comparision happens after second threads
+ // otherwise if something fails it should have thrown an exception
+ //tRes.tested("insertTextContent()", xIA.getCount() > 0 );
+
+ if (xIA != null ) {
+ result = (xIA.getCount()>0);
+ } else {
+ result = true;
+ }
+
+ if (!result) log.println("The TextContent wasn't inserted");
+
+
+ // try to insert an invalid TextContent
+ log.println( "test for insertTextContent" );
+ try {
+ oObj.insertTextContent(oCursor, null, false);
+ log.println("The expected Exception doesn't occured");
+ result &= false;
+ }
+ catch( com.sun.star.lang.IllegalArgumentException iaE ){
+ // Some exception.FAILED
+ log.println("Expected Exception occured");
+ String msg = iaE.getMessage();
+ if (msg.equals("")) {
+ log.println("But there is not detailed message");
+ } else {
+ log.println("Detailed message: "+msg);
+ }
+
+ result &= true;
+ }
+
+ tRes.tested("insertTextContent()", result );
+ }
+
+
+ /**
+ * Removes the text contet added before. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertTextContent() </code> : inserts the content
+ * to be removed in this test. </li>
+ * </ul>
+ */
+ public void _removeTextContent() {
+
+ // leads to a method which should be called previously
+ requiredMethod( "insertTextContent()" );
+
+ // write to log what we try next
+ log.println( "test for removeTextContent" );
+ try {
+ oObj.removeTextContent( (XTextContent)oInt );
+ //oObj.removeTextContent( (XTextContent)oInt );
+ }
+ catch( com.sun.star.container.NoSuchElementException nseE ){
+ // Some exception.FAILED
+ Status.failed( nseE.toString() );
+ return;
+ }
+
+ // no exception occured so it works
+ tRes.tested( "removeTextContent()", true );
+
+ }
+} // finish class _XText
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextColumns.java b/qadevOOo/tests/java/ifc/text/_XTextColumns.java
new file mode 100644
index 000000000000..7d49f098d2b2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextColumns.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextColumns.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.TextColumn;
+import com.sun.star.text.XTextColumns;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XTextColumns</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getReferenceValue()</code></li>
+ * <li><code> getColumnCount()</code></li>
+ * <li><code> setColumnCount()</code></li>
+ * <li><code> getColumns()</code></li>
+ * <li><code> setColumns()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextColumns
+ */
+public class _XTextColumns extends MultiMethodTest {
+
+ public XTextColumns oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * positive value.
+ */
+ public void _getColumnCount(){
+
+ short howmuch = oObj.getColumnCount();
+ tRes.tested("getColumnCount()",howmuch >=0);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getColumns(){
+ TextColumn[] cols = oObj.getColumns();
+ tRes.tested("getColumns()",cols != null);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * positive value.
+ */
+ public void _getReferenceValue(){
+
+ int ref = oObj.getReferenceValue();
+ tRes.tested("getReferenceValue()",ref >0);
+ }
+
+ /**
+ * Sets the column count property to some value
+ * then checks it by <code>getColumnCount</code> method. <p>
+ *
+ * Has <b>OK</b> status if set and get values are equal.
+ */
+ public void _setColumnCount(){
+
+ oObj.setColumnCount((short) 3);
+ short howmuch = oObj.getColumnCount();
+ tRes.tested("setColumnCount()",howmuch == 3);
+ }
+
+ /**
+ * Sets columns to some array
+ * then checks it by <code>getColumns</code> method. <p>
+ *
+ * Has <b>OK</b> status if set and get arays are equal.
+ */
+ public void _setColumns(){
+
+ TextColumn newCol = new TextColumn(5,1,1);
+ TextColumn[] cols = {newCol};
+ oObj.setColumns(cols);
+ TextColumn[] gCols = oObj.getColumns();
+ tRes.tested("setColumns()",util.ValueComparer.equalValue(cols, gCols));
+ }
+
+} // finish class _XTextColumns
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextContent.java b/qadevOOo/tests/java/ifc/text/_XTextContent.java
new file mode 100644
index 000000000000..30877ce97369
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextContent.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextContent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextRange;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XTextContent</code>
+ * interface methods :
+ * <ul>
+ * <li><code> attach()</code></li>
+ * <li><code> getAnchor()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'CONTENT'</code> <b>optional</b>
+ * (of type <code>XTextContent</code>):
+ * if this relation exists than it is used as the
+ * tested object. </li>
+ * <li> <code>'TEXT'</code> <b>optional</b>
+ * (of type <code>XText</code>):
+ * the relation must be specified if the 'CONTENT'
+ * relation exists. From this relation an anchor
+ * for <code>attach()</code> method is obtained.</li>
+ * <ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextContent
+ */
+public class _XTextContent extends MultiMethodTest {
+ public XTextContent oObj = null;
+ public XTextRange oAnchor = null;
+
+ /**
+ * Tries to get the anchor of the text content
+ * an XTextRange is returned. <p>
+ * The test is OK if an not null text range is returned
+ */
+ public void _getAnchor() {
+ log.println("getAnchor()");
+ oAnchor = oObj.getAnchor();
+ tRes.tested("getAnchor()", oAnchor != null ) ;
+
+ } // end getAnchor()
+
+ /**
+ * Tries to attach the text content to the test range
+ * gotten with getAnchor(). If relations are found
+ * then they are are used for testing. <p>
+ *
+ * The test is OK if the method works without error.
+ * @see #_getAnchor()
+ */
+ public void _attach() {
+ requiredMethod("getAnchor()");
+ try {
+ XTextContent aContent = (XTextContent) tEnv.getObjRelation("CONTENT");
+ XTextRange aRange = (XTextRange) tEnv.getObjRelation("RANGE");
+
+ if ( aContent !=null) {
+ aContent.attach(aRange);
+ } else {
+ oObj.attach(aRange);
+ }
+ tRes.tested("attach()", true ) ;
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {
+ String noAttach = (String) tEnv.getObjRelation("NoAttach");
+ if (noAttach != null) {
+ log.println("Exception expected for "+noAttach);
+ log.println("This Component doesn't support attach");
+ tRes.tested("attach()",true);
+ } else {
+ ex.printStackTrace(log);
+ tRes.tested("attach()",false);
+ }
+ } catch (com.sun.star.uno.RuntimeException re) {
+ String noAttach = (String) tEnv.getObjRelation("NoAttach");
+ if (noAttach != null) {
+ log.println("Exception expected for "+noAttach);
+ log.println("This Component doesn't support attach");
+ tRes.tested("attach()",true);
+ } else {
+ re.printStackTrace(log);
+ tRes.tested("attach()",false);
+ }
+ }
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextCursor.java b/qadevOOo/tests/java/ifc/text/_XTextCursor.java
new file mode 100644
index 000000000000..8678b7f63e44
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextCursor.java
@@ -0,0 +1,276 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XTextCursor;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.text.XTextCursor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> collapseToStart()</code></li>
+ * <li><code> collapseToEnd()</code></li>
+ * <li><code> isCollapsed()</code></li>
+ * <li><code> goLeft()</code></li>
+ * <li><code> goRight()</code></li>
+ * <li><code> gotoStart()</code></li>
+ * <li><code> gotoEnd()</code></li>
+ * <li><code> gotoRange()</code></li>
+ * </ul> <p>
+ *
+ * During this test the component text is changed,
+ * that's why it must be stored before methods' tests,
+ * and restored after. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextCursor
+ */
+public class _XTextCursor extends MultiMethodTest {
+
+ public XTextCursor oObj = null; // oObj filled by MultiMethodTest
+ String oldText = null ;
+
+ /**
+ * Stores component's text.
+ */
+ public void before() {
+ oObj.gotoStart(false);
+ oObj.gotoEnd(true);
+ oldText = oObj.getString() ;
+ }
+
+ /**
+ * First some text is set (for component to has at least some
+ * text), cursor is expanded to the whole text (to be not collapsed),
+ * the <code>collapseToEnd</code> is called. Then current cursor
+ * text is examined. <p>
+ *
+ * Has <b>OK</b> status if the current cursor text is an
+ * empty string.
+ */
+ public void _collapseToEnd(){
+ boolean bCol = false;
+
+ oObj.setString("XTextCursor");
+ oObj.gotoStart(false);
+ oObj.gotoEnd(true);
+ oObj.collapseToEnd();
+ bCol = oObj.getString().equals("");
+ tRes.tested("collapseToEnd()", bCol );
+ }
+
+ /**
+ * First some text is set (for component to has at least some
+ * text), cursor is expanded to the whole text (to be not collapsed),
+ * the <code>collapseToStart</code> is called. Then current cursor
+ * text is examined. <p>
+ *
+ * Has <b>OK</b> status if the current cursor text is an
+ * empty string.
+ */
+ public void _collapseToStart(){
+ boolean bCol = false;
+ oObj.setString("XTextCursor");
+ oObj.gotoStart(false);
+ oObj.gotoEnd(true);
+
+ oObj.collapseToStart();
+ bCol = oObj.getString().equals("");
+ tRes.tested("collapseToStart()", bCol );
+ }
+
+ /**
+ * First the cursor is moved to the end of text (to have a space
+ * for left cursor moving, and moves the cursor left by a number
+ * of characters. <p>
+ *
+ * Has <b>OK</b> status if the method returns <code>true</code>,
+ * and the current cursor string has the same length as number
+ * of characters the cursor was moved by.
+ */
+ public void _goLeft(){
+ boolean bLeft = false;
+ short n = 5;
+
+ oObj.gotoEnd(false);
+ bLeft = oObj.goLeft(n, true);
+ String gStr = oObj.getString() ;
+ log.println("'" + gStr + "'") ;
+ bLeft &= gStr.length() == n ;
+
+ tRes.tested("goLeft()", bLeft );
+ }
+
+ /**
+ * First the cursor is moved to the start of text (to have a space
+ * for right cursor moving, and moves the cursor right by a number
+ * of characters. <p>
+ *
+ * Has <b>OK</b> status if the method returns <code>true</code>,
+ * and the current cursor string has the same length as number
+ * of characters the cursor was moved by.
+ */
+ public void _goRight(){
+ boolean bRight = false;
+ short n = 5;
+
+ oObj.gotoStart(false);
+ bRight = oObj.goRight(n, true);
+
+ String gStr = oObj.getString() ;
+ log.println("'" + gStr + "'") ;
+ bRight &= gStr.length() == n ;
+
+ tRes.tested("goRight()", bRight );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method <code>goRight()</code>
+ * returns <code>false</code> (cursor can't move to the right).
+ */
+ public void _gotoEnd(){
+ boolean bEnd = false;
+ short n = 1;
+
+ oObj.gotoEnd(false);
+ bEnd = !oObj.goRight(n, false) ;
+
+ tRes.tested("gotoEnd()", bEnd );
+ }
+
+ /**
+ * First the whole text is set to a string, and cursor
+ * is moved to the range situated at the start of the
+ * text. <p>
+ *
+ * Has <b>OK</b> status if some characters to the right
+ * of the current cursor position are the beginning of
+ * the text.
+ */
+ public void _gotoRange(){
+ boolean bRange = false;
+
+ oObj.gotoStart(false);
+ oObj.gotoEnd(true);
+ oObj.setString("XTextCursor,XTextCursor");
+ oObj.gotoRange(oObj.getStart(),false);
+ oObj.goRight((short) 5, true);
+ bRange = oObj.getString().equals("XText");
+
+ if (!bRange) log.println("getString() returned '" +
+ oObj.getString() + "'") ;
+
+ tRes.tested("gotoRange()", bRange );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method <code>goLeft()</code>
+ * returns <code>false</code> (cursor can't move to the left).
+ */
+ public void _gotoStart(){
+ boolean bStart = false;
+ short n = 1;
+
+ oObj.gotoStart(false);
+ bStart = !oObj.goLeft(n, false) ;
+
+ tRes.tested("gotoStart()", bStart );
+ }
+
+ /**
+ * First the cusor is moved to start without expanding
+ * (must be collapsed), and then it's expanded to the
+ * whole text (must not be collapsed). <p>
+ *
+ * Has <b>OK</b> status if in the first case method
+ * <code>isCollapsed</code> returns <code>true</code>,
+ * and in the second <code>false</code>
+ */
+ public void _isCollapsed(){
+ boolean bCol = false;
+ short n = 1;
+
+ oObj.gotoStart(false);
+ bCol = oObj.isCollapsed();
+
+ oObj.gotoEnd(true);
+ bCol &= !oObj.isCollapsed() ;
+
+ tRes.tested("isCollapsed()", bCol );
+ }
+
+ /**
+ * Restores the text of the component to the
+ * state it was before this interafce test.
+ */
+ public void after() {
+ oObj.gotoStart(false);
+ oObj.gotoEnd(true);
+ oObj.setString(oldText) ;
+ }
+
+} // finish class _XTextCursor
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextDocument.java b/qadevOOo/tests/java/ifc/text/_XTextDocument.java
new file mode 100644
index 000000000000..2a2eac588dc2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextDocument.java
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextDocument;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XTextDocument</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getText()</code></li>
+ * <li><code> reformat()</code></li>
+ * </ul> <p>
+ * Test is multithread compilant. <p>
+ * @see com.sun.star.text.XTextDocument
+ */
+public class _XTextDocument extends MultiMethodTest {
+
+ public XTextDocument oObj = null;
+ public XText myText = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getText(){
+ myText = oObj.getText();
+ tRes.tested("getText()", myText != null );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _reformat(){
+ oObj.reformat();
+ tRes.tested("reformat()", true );
+ }
+
+} // finish class _XTextDocument
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextEmbeddedObjectsSupplier.java b/qadevOOo/tests/java/ifc/text/_XTextEmbeddedObjectsSupplier.java
new file mode 100644
index 000000000000..17c52ed94813
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextEmbeddedObjectsSupplier.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextEmbeddedObjectsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.text.XTextEmbeddedObjectsSupplier;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XTextEmbeddedObjectsSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getEmbeddedObjects()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextEmbeddedObjectsSupplier
+ */
+public class _XTextEmbeddedObjectsSupplier extends MultiMethodTest {
+
+ public XTextEmbeddedObjectsSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getEmbeddedObjects(){
+ boolean bResult = false;
+ XNameAccess oNA = oObj.getEmbeddedObjects();
+ bResult = oNA != null ;
+ tRes.tested("getEmbeddedObjects()", bResult );
+ }
+
+ } // finish class _XTextEmbeddedObjectsSupplier
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextField.java b/qadevOOo/tests/java/ifc/text/_XTextField.java
new file mode 100644
index 000000000000..595a3aca09e3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextField.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XTextField;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XTextField</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getPresentation()</code></li>
+ * </ul> <p>
+ * Test is multithread compilant. <p>
+ * @see com.sun.star.text.XTextField
+ */
+public class _XTextField extends MultiMethodTest{
+ public XTextField oObj = null;
+
+ /**
+ * Calls the method with <code>true</code> and <code>false</code>
+ * parameter. <p>
+ * Has <b>OK</b> status if in both cases not <code>null</code>
+ * value returned.
+ */
+ public void _getPresentation() {
+
+ boolean result = true;
+
+ // begin test here
+ log.println("getting presentetion with bShowCommand flag...");
+ result &= oObj.getPresentation(true) != null;
+ log.println("getting presentetion without bShowCommand flag...");
+ result &= oObj.getPresentation(false) != null;
+
+ tRes.tested( "getPresentation()", result );
+
+ } // end getPresentation()
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextFrame.java b/qadevOOo/tests/java/ifc/text/_XTextFrame.java
new file mode 100644
index 000000000000..b5623d64f4bf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextFrame.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextFrame.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextFrame;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.text.XTextFrame</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getText()</code></li>
+ * </ul> <p>
+ *
+ * The frame <b>must contain</b> the text 'The FrameText'
+ * for proper interface testing. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextFrame
+ */
+public class _XTextFrame extends MultiMethodTest {
+
+ public XTextFrame oObj = null;
+
+ /**
+ * Gets the text of the frame. <p>
+ *
+ * Has <b>OK</b> status if the text is equal to 'The FrameText'.
+ */
+ public void _getText() {
+
+ log.println("Testing getText ...");
+ XText oFrameText = oObj.getText();
+ String Content = oFrameText.getString();
+ boolean ging = Content.equals("The FrameText");
+ tRes.tested( "getText()",Content.equals("The FrameText") );
+ }
+
+} // finish class _XTextFrame
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextGraphicObjectsSupplier.java b/qadevOOo/tests/java/ifc/text/_XTextGraphicObjectsSupplier.java
new file mode 100644
index 000000000000..44fd50837bcc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextGraphicObjectsSupplier.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextGraphicObjectsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.text.XTextGraphicObjectsSupplier;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XTextGraphicObjectsSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getGraphicObjects()</code></li>
+ * </ul> <p>
+ *
+ * The component <b>must have</b> the graphic object with
+ * name 'SwXTextDocument'. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextGraphicObjectsSupplier
+ */
+public class _XTextGraphicObjectsSupplier extends MultiMethodTest {
+
+ public static XTextGraphicObjectsSupplier oObj = null;
+
+ /**
+ * Gets graphic objects collection from the component, and checks
+ * if the object with name 'SwXTextDocument' exists. <p>
+ * Has <b>OK</b> status if the object exists.
+ */
+ public void _getGraphicObjects() {
+ boolean res = false;
+
+ XNameAccess the_graphics = oObj.getGraphicObjects();
+ res = the_graphics.hasByName("SwXTextDocument");
+
+ tRes.tested("getGraphicObjects()",res);
+ }
+
+} // finish class _XTextGraphicObjectsSupplier
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextRange.java b/qadevOOo/tests/java/ifc/text/_XTextRange.java
new file mode 100644
index 000000000000..d5d1cd2d6876
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextRange.java
@@ -0,0 +1,213 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextRange;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.text.XTextRange</code>
+* interface methods :
+* <ul>
+* <li><code> getText()</code></li>
+* <li><code> getStart()</code></li>
+* <li><code> getEnd()</code></li>
+* <li><code> getString()</code></li>
+* <li><code> setString()</code></li>
+* </ul> <p>
+* First the content is set to 'Middle' string value, then
+* start range is retrieved and its content is set to 'Start'
+* and end range is set to 'End'. Finally the whole TextRange
+* is checked and it must be 'StartMiddleEnd'. <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.text.XTextRange
+*/
+public class _XTextRange extends MultiMethodTest {
+
+ public XTextRange oObj = null; // oObj is filled by setField()
+ // in MultiMethodTest
+ XTextRange oStartRange = null; // startrange of textrang
+ XTextRange oEndRange = null; // endrange of textrang
+ String startStr = null; // string in startrange
+ String endStr = null; // string in endrange
+
+ /**
+ * Retrieves the start range and sets its context to
+ * 'Start' string. <p>
+ * Has <b>OK</b> status if the whole range string starts
+ * with 'Start' substring. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setString </code> </li>
+ * </ul>
+ */
+ public void _getStart() {
+
+ XText the_text = (XText) tEnv.getObjRelation("XTEXT");
+
+ if (the_text != null) {
+ the_text.setString("");
+ }
+
+ String exp="";
+
+ oObj.setString("MiddleEnd");
+
+ oStartRange = oObj.getStart();
+ oStartRange.setString("Start");
+
+ if (the_text !=null) {
+ exp = the_text.getString();
+ } else exp = oObj.getText().getString();
+
+ log.println("Start: "+exp);
+
+ tRes.tested( "getStart()", oStartRange != null &&
+ exp.startsWith("Start"));
+
+ }
+
+ /**
+ * Retrieves the end range and sets its context to
+ * 'End' string. <p>
+ * Has <b>OK</b> status if the whole range string ends
+ * with 'End' substring. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setString </code> </li>
+ * </ul>
+ */
+ public void _getEnd() {
+ XText the_text = (XText) tEnv.getObjRelation("XTEXT");
+
+ if (the_text != null) {
+ the_text.setString("");
+ }
+
+ String exp="";
+ oObj.setString("StartMiddle");
+
+ oEndRange = oObj.getEnd();
+ oEndRange.setString("End");
+
+ if (the_text !=null) {
+ exp = the_text.getString();
+ } else exp = oObj.getText().getString();
+
+ log.println("End: "+exp);
+
+ tRes.tested( "getEnd()", oEndRange != null &&
+ exp.endsWith("End"));
+ }
+
+ /**
+ * Gets the text of the range and retrieves its String content. <p>
+ * Has <b>OK</b> status if the string returned equals to
+ * 'StartMiddleEnd' value. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setString </code> to get finally the string expected.</li>
+ * <li> <code> getStart </code> to get finally the string expected.</li>
+ * <li> <code> getEnd </code> to get finally the string expected.</li>
+ * </ul>
+ */
+ public void _getText() {
+ requiredMethod("setString()");
+ requiredMethod("getStart()");
+ requiredMethod("getEnd()");
+
+ XText txt = oObj.getText() ;
+
+ tRes.tested( "getText()", txt != null &&
+ txt.getString().equals("StartMiddleEnd"));
+ }
+
+ /**
+ * Gets the String of the range. <p>
+ * Has <b>OK</b> status if the string returned equals to
+ * 'StartMiddleEnd' value. <p>
+ */
+ public void _getString() {
+
+ oObj.setString("StartMiddleEnd");
+ String gStr = oObj.getString() ;
+
+ tRes.tested( "getString()", gStr != null &&
+ gStr.equals("StartMiddleEnd"));
+
+ }
+
+ /**
+ * Sets the string content of the range to 'Middle' value. <p>
+ * Has <b>OK</b> status if <code>getString</code> method returns
+ * 'Middle' value.
+ */
+ public void _setString() {
+ oObj.setString("Middle") ;
+
+ tRes.tested("setString()", "Middle".equals(oObj.getString())) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java b/qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java
new file mode 100644
index 000000000000..768db3bec841
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextRangeCompare.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+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.XTextRange;
+import com.sun.star.text.XTextRangeCompare;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.text.XTextRangeCompare</code>
+ * interface methods :
+ * <ul>
+ * <li><code> compareRegionStarts()</code></li>
+ * <li><code> compareRegionEnds()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'TEXTDOC'</code> <b>optional</b>
+ * (must implement <code>XTextDocument</code>):
+ * can be used to obtain <code>Text</code> of the document from
+ * which cursors can be created.
+ * If the relation does not exist, the relation <code>TEXT</code>
+ * must be specified. </li>
+ * <li> <code>'TEXT'</code> <b>optional</b>
+ * (of type <code>XText</code>):
+ * used to create text cursor.
+ * If the relation does not exist, the relation <code>TEXTDOC</code>
+ * must be specified. </li>
+ * <ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextRangeCompare
+ */
+public class _XTextRangeCompare extends MultiMethodTest {
+
+ public XTextRangeCompare oObj = null;
+
+
+ String nameStr = null;
+
+ XTextRange oRange = null;
+ XTextCursor cursor1 = null;
+ XTextCursor cursor2 = null;
+ String startStr = null;
+ String endStr = null;
+ XText oText = null;
+
+ /**
+ * Retrieves <code>XText</code> interface from relation 'TEXTDOC'
+ * or from 'TEXT'.
+ * @throws StatusException If neither 'TEXTDOC' nore 'TEXT'
+ * relation exists.
+ */
+ public void before() {
+ nameStr = this.getClass().getName();
+
+ XInterface oIfc = (XInterface)tEnv.getObjRelation("TEXTDOC");
+ if (oIfc!=null) {
+ XTextDocument oTDoc = (XTextDocument)UnoRuntime.queryInterface(
+ XTextDocument.class, oIfc);
+ oText = oTDoc.getText();
+ }
+ XText aText = (XText) tEnv.getObjRelation("TEXT");
+ if (aText != null) {
+ oText = aText;
+ }
+
+ if (oText == null) {
+ throw new StatusException(Status.failed
+ ("Neither 'TEXTDOC' nore 'TEXT' relation not found")) ;
+ }
+ }
+
+ /**
+ * One cursor is created and to its position a paragraph
+ * inserted, then second cursor created and to its position
+ * a paragraph inserted. After that two cusors' ends are
+ * compared. <p>
+ *
+ * Has <b>OK</b> status if the compare returns 1, i.e.
+ * the second cursor end is before the first.
+ */
+ public void _compareRegionEnds() {
+ boolean bResult = false;
+ short n = 0;
+ log.println( "testing compareRegionEnds()" );
+
+ try{
+ cursor1 = oText.createTextCursor();
+ oText.insertString(cursor1, nameStr, false);
+ oText.insertControlCharacter(cursor1,
+ ControlCharacter.PARAGRAPH_BREAK, false);
+ cursor2 = oText.createTextCursor();
+ oText.insertString(cursor2, nameStr + nameStr, false);
+ oText.insertControlCharacter(cursor2,
+ ControlCharacter.PARAGRAPH_BREAK, false);
+ }catch(com.sun.star.lang.IllegalArgumentException e){
+ log.println( "Exception occurs while inserting strings: " );
+ e.printStackTrace(log);
+ }
+
+ try{
+ n = oObj.compareRegionEnds(cursor2, cursor1);
+ log.println( "Result (short) : " + n );
+ }catch(com.sun.star.lang.IllegalArgumentException e){
+ log.println( "Exception: " + e);
+ }
+
+ if (n == 1){bResult = true;}
+ tRes.tested( "compareRegionEnds()", bResult );
+ }
+
+ /**
+ * One cursor is created and to its position a paragraph
+ * inserted, then second cursor created and to its position
+ * a paragraph inserted. After that two cusors' starts are
+ * compared. <p>
+ *
+ * Has <b>OK</b> status if the compare returns 1, i.e.
+ * the second cursor start is before the first.
+ */
+ public void _compareRegionStarts() {
+ boolean bResult = false;
+ short n = 0;
+
+ try{
+ cursor1 = oText.createTextCursor();
+ oText.insertString(cursor1, nameStr, false);
+ oText.insertControlCharacter(cursor1,
+ ControlCharacter.PARAGRAPH_BREAK, false);
+ cursor2 = oText.createTextCursor();
+ oText.insertString(cursor2, nameStr + nameStr, false);
+ oText.insertControlCharacter(cursor2,
+ ControlCharacter.PARAGRAPH_BREAK, false);
+ }catch(com.sun.star.lang.IllegalArgumentException e){
+ log.println( "Exception occurs while inserting strings: " + e);
+ }
+ try{
+ n = oObj.compareRegionStarts(cursor2, cursor1);
+ log.println( "Result (short) : " + n );
+ }catch(com.sun.star.lang.IllegalArgumentException e){
+ log.println( "Exception: " + e);
+ }
+ if (n == 1){bResult = true;}
+ tRes.tested( "compareRegionStarts()", bResult );
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextRangeMover.java b/qadevOOo/tests/java/ifc/text/_XTextRangeMover.java
new file mode 100644
index 000000000000..cad7fab0faef
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextRangeMover.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextRangeMover.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XTextRange;
+import com.sun.star.text.XTextRangeMover;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.text.XTextRangeMover</code>
+ * interface methods :
+ * <ul>
+ * <li><code> moveTextRange()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'RangeForMove'</code> (of type <code>XTextRange</code>):
+ * the range to be moved. </li>
+ * <li> <code>'XTextRange'</code> (of type <code>XTextRange</code>):
+ * the range that includes moving range. </li>
+ * <ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextRangeMover
+ */
+public class _XTextRangeMover extends MultiMethodTest {
+
+ public XTextRangeMover oObj = null;
+
+ XTextRange xTextRange = null;
+ XTextRange oMoveRange = null;
+
+ /**
+ * Moves the range obtained from relation 'RangeForMove' by 1 paragraph
+ * and compares index of moved string in the whole text obtained
+ * from relation 'XTextRange'. <p>
+ * Has <b>OK</b> status if index of moved range is changed after method call.
+ */
+ public void _moveTextRange(){
+ oMoveRange = (XTextRange) tEnv.getObjRelation("RangeForMove");
+ xTextRange = (XTextRange) tEnv.getObjRelation("XTextRange");
+
+ if (oMoveRange == null) {
+ throw new StatusException(
+ Status.failed("Couldn't get relation 'RangeForMove'"));
+ }
+
+ if (xTextRange == null) {
+ throw new StatusException(
+ Status.failed("Couldn't get relation 'XTextRange'"));
+ }
+
+ log.println("Content before moving:");
+ log.println(xTextRange.getString());
+ log.println("Text range for moving:");
+ log.println(oMoveRange.getString());
+ int indexBefore = xTextRange.getString().indexOf(oMoveRange.getString());
+ oObj.moveTextRange(oMoveRange,(short) 1);
+ log.println("Content after moving:");
+ log.println(xTextRange.getString());
+ int indexAfter = xTextRange.getString().indexOf(oMoveRange.getString());
+
+ boolean res = indexBefore != indexAfter;
+ log.println("Index before moving:" + indexBefore);
+ log.println("Index after moving:" + indexAfter);
+
+ tRes.tested("moveTextRange()", res);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextSection.java b/qadevOOo/tests/java/ifc/text/_XTextSection.java
new file mode 100644
index 000000000000..d848a91ceef0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextSection.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextSection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XTextSection;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XTextSection</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getParentSection()</code></li>
+ * <li><code> getChildSections()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextSection
+ */
+public class _XTextSection extends MultiMethodTest {
+
+ public static XTextSection oObj = null;
+ public XTextSection child = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns non zero legth array.
+ */
+ public void _getChildSections(){
+ boolean bResult = false;
+ XTextSection oSection[] = null;
+ XTextSection oSect[] = oObj.getChildSections();
+ if (oSect.length > 0){
+ bResult = true;
+ child = oSect[0];
+ }
+ tRes.tested("getChildSections()", bResult);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getParentSection(){
+ requiredMethod("getChildSections()");
+ boolean bResult = false;
+ bResult = (child.getParentSection() != null);
+ tRes.tested("getParentSection()", bResult);
+ }
+
+
+} // finish class _XTextSection
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextTable.java b/qadevOOo/tests/java/ifc/text/_XTextTable.java
new file mode 100644
index 000000000000..f9e9f6b63f74
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextTable.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextTable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XTextTable;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.text.XTextTable</code>
+ * interface methods :
+ * <ul>
+ * <li><code> initialize()</code></li>
+ * <li><code> getRows()</code></li>
+ * <li><code> getColumns()</code></li>
+ * <li><code> getCellByName()</code></li>
+ * <li><code> getCellNames()</code></li>
+ * <li><code> createCursorByCellName()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'NROW'</code> : the number of rows in table
+ * </li>
+ * <li> <code>'NCOL'</code> : the number of columns in table
+ * </li>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XTextTable
+ */
+public class _XTextTable extends MultiMethodTest {
+
+ public XTextTable oObj = null; // oObj filled by MultiMethodTest
+ int nRow;
+ int nCol;
+
+ String cellNamesList[] = null ;
+
+ protected void before() {
+ Integer num_row = (Integer)tEnv.getObjRelation("NROW");
+ if (num_row == null) {
+ throw new StatusException
+ (Status.failed("Couldn't get relation 'NROW'"));
+ }
+ Integer num_col = (Integer)tEnv.getObjRelation("NCOL");
+ if (num_col == null) {
+ throw new StatusException
+ (Status.failed("Couldn't get relation 'NCOL'"));
+ }
+ nRow = num_row.intValue();
+ nCol = num_col.intValue();
+ }
+
+ /**
+ * The method is not called directly here, because it must
+ * be called before being inserted to the document. <p>
+ *
+ * Always has <b> OK </b> status. <p>
+ */
+ public void _initialize() {
+
+ // initialize()
+ log.println( "test for initialize()" );
+ tRes.tested( "initialize()", true);
+ }
+
+ /**
+ * Test calls the method passing as cell name the first
+ * element from names returned by <code>getCellNames</code>
+ * method. <p>
+ *
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getCellNames() </code> : its result used by test. </li>
+ * </ul>
+ */
+ public void _createCursorByCellName(){
+ requiredMethod("getCellNames()") ;
+
+ // createCursorByCellName()
+ log.println( "test for createCursorByCellName()" );
+ tRes.tested( "createCursorByCellName()",
+ oObj.createCursorByCellName( cellNamesList[0] ) != null );
+ }
+
+ /**
+ * Test calls the method passing as cell name the first
+ * element from names returned by <code>getCellNames</code>
+ * method. <p>
+ *
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getCellNames() </code> : its result used by test. </li>
+ * </ul>
+ */
+ public void _getCellByName(){
+ requiredMethod("getCellNames()") ;
+
+ // getCellByName()
+ log.println( "test for getCellByName()" );
+ tRes.tested( "getCellByName()",
+ oObj.getCellByName( cellNamesList[0] ) != null );
+ }
+
+ /**
+ * Obtains cell names of the table. <p>
+ *
+ * Has <b>OK</b> status if number of elements in the returned
+ * array is equal to [row number] * [column number]
+ * and if the first name is 'A1'.
+ */
+ public void _getCellNames(){
+ // getCellNames()
+ log.println( "test for getCellNames()" );
+ cellNamesList = oObj.getCellNames();
+
+ boolean result = cellNamesList.length == ( nRow * nCol ) ;
+ result &= cellNamesList[0].equals( "A1" ) ;
+
+ tRes.tested( "getCellNames()", result ) ;
+ }
+
+ /**
+ * Obtains columns of the table. <p>
+ *
+ * Has <b>OK</b> status if the number of element of returned
+ * collection is equal to real number of columns in the table.
+ */
+ public void _getColumns(){
+ // getColumns()
+ log.println( "test for getColumns()" );
+ tRes.tested( "getColumns()", nCol == oObj.getColumns().getCount() );
+ }
+
+ /**
+ * Obtains rows of the table. <p>
+ *
+ * Has <b>OK</b> status if the number of element of returned
+ * collection is equal to real number of rows in the table.
+ */
+ public void _getRows(){
+ // getRows()
+ log.println( "test for getRows()" );
+ tRes.tested( "getRows()", nRow == oObj.getRows().getCount() );
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextTableCursor.java b/qadevOOo/tests/java/ifc/text/_XTextTableCursor.java
new file mode 100644
index 000000000000..8e29aff303dc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextTableCursor.java
@@ -0,0 +1,327 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextTableCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.table.XCell;
+import com.sun.star.text.XTextTableCursor;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.text.XTextTableCursor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getRangeName()</code></li>
+ * <li><code> gotoCellByName()</code></li>
+ * <li><code> goLeft()</code></li>
+ * <li><code> goRight()</code></li>
+ * <li><code> goUp()</code></li>
+ * <li><code> goDown()</code></li>
+ * <li><code> gotoStart()</code></li>
+ * <li><code> gotoEnd()</code></li>
+ * <li><code> mergeRange()</code></li>
+ * <li><code> splitRange()</code></li>
+ * </ul> <p>
+ *
+ * <b>Prerequisites : </b> the table must have a size
+ * 2x2 and current cursor position must be in the upper
+ * left cell. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ *
+ * After test completion object environment has to be recreated
+ * because after merging and splitting cells their names
+ * differ from initial.
+ *
+ * @see com.sun.star.text.XTextTableCursor
+ */
+public class _XTextTableCursor extends MultiMethodTest {
+
+ public XTextTableCursor oObj = null; // oObj filled by MultiMethodTest
+
+ XCell oCell = null;
+
+ /**
+ * Moves the cursor to upper-left cell and checks
+ * its range name. <p>
+ *
+ * Has <b>OK</b> status if the name returned is 'A1'.
+ */
+ public void _getRangeName(){
+ log.println( "test for getRangeName()" );
+ oObj.gotoStart(false);
+ String oCellName = oObj.getRangeName();
+ log.println( "CellName = " + oCellName );
+
+ tRes.tested("getRangeName()", oCellName.equals("A1") );
+ }
+
+ /**
+ * Calls the method which moves the cursor down by 1 cell,
+ * after that returns cursor to the old position. <p>
+ *
+ * Has <b>OK</b> status if the method returns
+ * <code>true</code>.
+ */
+ public void _goDown(){
+ boolean bDown = false;
+ log.println( "test for goDown()" );
+ short i = 1;
+
+ bDown = oObj.goDown(i,false);
+
+ tRes.tested("goDown()", bDown );
+ oObj.goUp(i,false);
+ }
+
+ /**
+ * Calls the method which moves the cursor to the right by 1 cell,
+ * after that returns cursor to the old position. <p>
+ *
+ * Has <b>OK</b> status if the method returns
+ * <code>true</code>.
+ */
+ public void _goRight(){
+ boolean bRight = false;
+ log.println( "test for goRight()" );
+ short i = 1;
+
+ bRight = oObj.goRight(i,false);
+
+ tRes.tested("goRight()", bRight );
+ oObj.goLeft(i,false);
+ }
+
+ /**
+ * Calls the method which moves the cursor to the left by 1 cell,
+ * after that returns cursor to the old position. <p>
+ *
+ * Has <b>OK</b> status if the method returns
+ * <code>true</code>.
+ */
+ public void _goLeft(){
+ boolean bLeft = false;
+ log.println( "test for goLeft()" );
+ short i = 1;
+
+ oObj.goRight(i,false);
+ bLeft = oObj.goLeft(i,false);
+
+ tRes.tested("goLeft()", bLeft );
+ }
+
+ /**
+ * Calls the method which moves the cursor up by 1 cell,
+ * after that returns cursor to the old position. <p>
+ *
+ * Has <b>OK</b> status if the method returns
+ * <code>true</code>.
+ */
+ public void _goUp(){
+ boolean bUp = false;
+ log.println( "test for goUp()" );
+ short i = 1;
+
+ oObj.gotoEnd(true);
+
+ bUp = oObj.goUp(i,false);
+ tRes.tested("goUp()", bUp );
+ }
+
+ /**
+ * Moves the cursor to the cell with name 'B1', then
+ * checks the current range name. <p>
+ * Has <b>OK</b> status if the returned range name is
+ * 'B1'.
+ */
+ public void _gotoCellByName(){
+ log.println( "test for gotoCellByName()" );
+
+ oObj.gotoCellByName("B1",false);
+ String oCellName = oObj.getRangeName();
+
+ tRes.tested("gotoCellByName()", oCellName.equals("B1") );
+ }
+
+ /**
+ * Moves cursor to the start (upper-left cell). Then
+ * checks the current range name. <p>
+ *
+ * Has <b>OK</b> status if current range name is 'A1'.
+ */
+ public void _gotoStart(){
+ log.println( "test for gotoStart()" );
+
+ oObj.gotoStart(false);
+ String oCellName = oObj.getRangeName();
+
+ tRes.tested("gotoStart()", oCellName.equals("A1") );
+ }
+
+ /**
+ * Moves cursor to the end (lower-right cell). Then
+ * checks the current range name. <p>
+ *
+ * Has <b>OK</b> status if current range name is 'B2'
+ * (the table is assumed to be of size 2x2).
+ */
+ public void _gotoEnd(){
+ log.println( "test for gotoEnd()" );
+
+ oObj.gotoEnd(false);
+ String oCellName = oObj.getRangeName();
+
+ tRes.tested("gotoEnd()", oCellName.equals("B2") );
+ }
+
+ /**
+ * Selects all cells in the table and merges them.
+ * Finally move the cursor to the end and checks
+ * current range name.<p>
+ *
+ * Has <b>OK</b> status if the end cell has a name
+ * 'A1'.
+ *
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getRangeName(), gotoStart(), gotoEnd()
+ * goLeft(), goRight(), goUp(), goDown(), gotoCellByName()</code>
+ * : these methods must be completed before all cells of the
+ * table are merged into one cell </li>
+ * </ul>
+ */
+ public void _mergeRange(){
+ executeMethod("getRangeName()") ;
+ executeMethod("gotoStart()") ;
+ executeMethod("gotoEnd()") ;
+ executeMethod("goLeft()") ;
+ executeMethod("goRight()") ;
+ executeMethod("goUp()") ;
+ executeMethod("goDown()") ;
+ executeMethod("gotoCellByName()") ;
+
+ boolean bMerge = false;
+ log.println( "test for mergeRange()" );
+
+ oObj.gotoStart(false);
+ oObj.gotoEnd(true);
+ bMerge = oObj.mergeRange();
+
+ oObj.gotoEnd(false);
+
+ String curName = oObj.getRangeName() ;
+ bMerge &= "A1".equals(curName) ;
+
+ tRes.tested("mergeRange()", bMerge );
+ }
+
+ /**
+ * First splits the cell horyzontally. Then the end cell
+ * name is checked. Second split all cells vertically and
+ * again the end cell name is checked<p>
+ *
+ * Has <b> OK </b> status if in the first case the end cell name
+ * is not 'A1', and in the second case the end cell name is not
+ * equal to the name gotten in the first case. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> mergeRange() </code> : to have one cell in a table
+ * which this test splits. </li>
+ * </ul>
+ */
+ public void _splitRange(){
+ requiredMethod("mergeRange()") ;
+
+ boolean bSplit = true ;
+ log.println( "test for splitRange" ) ;
+ short i = 1 ;
+
+ bSplit &= oObj.splitRange(i, true) ;
+
+ oObj.gotoEnd(false);
+ String horName = oObj.getRangeName() ;
+ log.println("The end cell after horiz. split : " + horName) ;
+ bSplit &= !"A1".equals(horName) ;
+
+ oObj.gotoStart(false);
+ oObj.gotoEnd(true);
+ bSplit &= oObj.splitRange(i, false) ;
+
+ oObj.gotoEnd(false);
+ String vertName = oObj.getRangeName() ;
+ log.println("The end cell after vert. split : " + vertName) ;
+ bSplit &= !horName.equals(vertName) ;
+
+ tRes.tested("splitRange()", bSplit ) ;
+ }
+
+ /**
+ * Forces object environment recreation.
+ */
+ public void after() {
+ disposeEnvironment() ;
+ }
+
+ } // finish class _XTextTableCursor
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextTablesSupplier.java b/qadevOOo/tests/java/ifc/text/_XTextTablesSupplier.java
new file mode 100644
index 000000000000..d0b46aba2a24
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextTablesSupplier.java
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextTablesSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.text.XTextTablesSupplier;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.text.XTextTablesSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getTextTables()</code></li>
+ * </ul> <p>
+ * The table collection tested <b>must</b> have a table
+ * with name 'SwXTextDocument'. <p>
+ * Test is multithread compilant. <p>
+ * @see com.sun.star.text.XTextTablesSupplier
+ */
+public class _XTextTablesSupplier extends MultiMethodTest {
+
+ public static XTextTablesSupplier oObj = null;
+
+ /**
+ * Get the collection of tables. Then check it. <p>
+ * Has <b>OK</b> status if returned collection contains
+ * element with name 'SwXTextDocument'.
+ */
+ public void _getTextTables() {
+ boolean res = false;
+
+ XNameAccess the_tables = oObj.getTextTables();
+ res = the_tables.hasByName("SwXTextDocument");
+
+ tRes.tested("getTextTables()",res);
+ }
+
+} // finish class _XTextTablesSupplier
+
diff --git a/qadevOOo/tests/java/ifc/text/_XTextViewCursorSupplier.java b/qadevOOo/tests/java/ifc/text/_XTextViewCursorSupplier.java
new file mode 100644
index 000000000000..15a578089d2c
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XTextViewCursorSupplier.java
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextViewCursorSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XTextViewCursor;
+import com.sun.star.text.XTextViewCursorSupplier;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XTextViewCursorSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getViewCursor()</code></li>
+ * </ul> <p>
+ * Test is multithread compilant. <p>
+ * @see com.sun.star.text.XTextViewCursorSupplier
+ */
+public class _XTextViewCursorSupplier extends MultiMethodTest {
+
+ public XTextViewCursorSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getViewCursor(){
+
+ XTextViewCursor oTVC = oObj.getViewCursor();
+ tRes.tested("getViewCursor()", oTVC != null);
+
+ } // finish _getViewCursor()
+
+} // finish class _XTextViewCursorSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/text/_XWordCursor.java b/qadevOOo/tests/java/ifc/text/_XWordCursor.java
new file mode 100644
index 000000000000..5f60e009a7e8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/text/_XWordCursor.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XWordCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:06 $
+ *
+ * The Contents of this file are made availab
+ * le subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.text;
+
+import com.sun.star.text.XWordCursor;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.text.XWordCursor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> isStartOfWord()</code></li>
+ * <li><code> isEndOfWord()</code></li>
+ * <li><code> gotoNextWord()</code></li>
+ * <li><code> gotoPreviousWord()</code></li>
+ * <li><code> gotoEndOfWord()</code></li>
+ * <li><code> gotoStartOfWord()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.text.XWordCursor
+ */
+public class _XWordCursor extends MultiMethodTest {
+
+ public XWordCursor oObj = null; // oObj filled by MultiMethodTest
+
+ /**
+ * Moves the cursor to start of the text.
+ */
+ public void before() {
+ oObj.gotoStart(false);
+ }
+
+ /**
+ * First moves the cursor to the next word to be sure that
+ * at least one word is situated before. Then moves cursor
+ * to the previous word and checks the value returned. <p>
+ *
+ * Has <b>OK</b> status if method returns <code>true</code>.
+ */
+ public void _gotoPreviousWord(){
+ oObj.gotoNextWord(false);
+ tRes.tested("gotoPreviousWord()", oObj.gotoPreviousWord(false) );
+ }
+
+ /**
+ * First moves the cursor to the previous word to be sure that
+ * at least one word is situated after. Then moves cursor
+ * to the next word and checks the value returned. <p>
+ *
+ * Has <b>OK</b> status if method returns <code>true</code>.
+ */
+ public void _gotoNextWord(){
+ oObj.gotoPreviousWord(false) ;
+ tRes.tested("gotoNextWord()", oObj.gotoNextWord(false) );
+ }
+
+ /**
+ * First moves the cursor to the start of the current word,
+ * then to the end and checks the value returned. <p>
+ *
+ * Has <b>OK</b> status if method returns <code>true</code>.
+ */
+ public void _gotoEndOfWord(){
+ oObj.gotoStart(false);
+ tRes.tested("gotoEndOfWord()", oObj.gotoEndOfWord(false) );
+ }
+
+ /**
+ * Move cursor to the start, then to the end. After that the
+ * method is called and returned value is checked. <p>
+ * Has <b>OK</b> status if the method returns <code>true</code>.
+ */
+ public void _isEndOfWord(){
+ log.println("gotoStartOfWord() = " + oObj.gotoStartOfWord(false)) ;
+ log.println("gotoEndOfWord() = " + oObj.gotoEndOfWord(false));
+
+ tRes.tested("isEndOfWord()", oObj.isEndOfWord() );
+ }
+
+ /**
+ * Move cursor to the end, then to the start. After that the
+ * method is called and returned value is checked. <p>
+ * Has <b>OK</b> status if the method returns <code>true</code>.
+ */
+ public void _isStartOfWord(){
+
+ oObj.gotoEndOfWord(false);
+ oObj.gotoStartOfWord(false);
+ tRes.tested("isStartOfWord()", oObj.isStartOfWord() );
+ }
+
+ /**
+ * First moves the cursor to the start of the current word,
+ * then shifts it 2 symbols to the right. After that the
+ * method is called and returned value is checked.<p>
+ *
+ * Has <b>OK</b> status if method returns <code>true</code>.
+ */
+ public void _gotoStartOfWord(){
+ oObj.gotoStartOfWord(false);
+ oObj.goRight((short) 2, false) ;
+ tRes.tested("gotoStartOfWord()", oObj.gotoStartOfWord(false) );
+ }
+
+ } // finish class _XWordCursor
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XCachedContentResultSetFactory.java b/qadevOOo/tests/java/ifc/ucb/_XCachedContentResultSetFactory.java
new file mode 100644
index 000000000000..fa110f03c184
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XCachedContentResultSetFactory.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCachedContentResultSetFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.ucb.XCachedContentResultSetFactory;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.ucb.XCachedContentResultSetFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createCachedContentResultSet()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CachedContentResultSetStub'</code> (of type
+* <code>com.sun.star.sdbc.XResultSet</code>):
+* this must be an imlementation of <code>
+* com.sun.star.ucb.CachedContentResultSetStub</code> service.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XCachedContentResultSetFactory
+*/
+public class _XCachedContentResultSetFactory extends MultiMethodTest {
+
+ /**
+ * Conatins the tested object.
+ */
+ public XCachedContentResultSetFactory oObj;
+ private XResultSet resSetStub = null ;
+
+ /**
+ * Retrieves object relation.
+ * @throws StatusException If relation not found.
+ */
+ public void before() {
+ resSetStub = (XResultSet)
+ tEnv.getObjRelation("CachedContentResultSetStub") ;
+ if (resSetStub == null) {
+ log.println("!!! Relation not found !!!") ;
+ throw new StatusException
+ (Status.failed("!!! Relation not found !!!")) ;
+ }
+ }
+
+ /**
+ * Creates result set from result set stub. After that number
+ * of rows from result set created and its stub are retrieved
+ * using their static representations and comared. <p>
+ * Has <b>OK</b> status if numbers of rows are equal and they are
+ * greater then 0 (because JAR file contains at least one entry).
+ */
+ public void _createCachedContentResultSet() {
+ boolean result = true ;
+
+ XResultSet resSet = oObj.createCachedContentResultSet
+ (resSetStub, null) ;
+
+ if (resSet == null) {
+ log.println("!!! Method returned null !!!") ;
+ result = false ;
+ } else {
+ try {
+ resSetStub.last() ;
+ int stubRowNum = resSetStub.getRow() ;
+
+ resSet.last() ;
+ int setRowNum = resSet.getRow() ;
+
+ result = stubRowNum == setRowNum && setRowNum > 0 ;
+
+ log.println("Number of rows : stub=" + stubRowNum +
+ " set=" + setRowNum) ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("!!! Something wrong with result sets :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("createCachedContentResultSet()", result) ;
+
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XCachedContentResultSetStubFactory.java b/qadevOOo/tests/java/ifc/ucb/_XCachedContentResultSetStubFactory.java
new file mode 100644
index 000000000000..72623fb08bf3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XCachedContentResultSetStubFactory.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCachedContentResultSetStubFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.ucb.XCachedContentResultSetStubFactory;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.ucb.XCachedContentResultSetStubFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createCachedContentResultSetStub()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'ContentResultSet'</code> (of type
+* <code>com.sun.star.sdbc.XResultSet</code>):
+* this must be an imlementation of <code>
+* com.sun.star.ucb.ContentResultSet</code> service.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XCachedContentResultSetStubFactory
+*/
+public class _XCachedContentResultSetStubFactory extends MultiMethodTest {
+
+ /**
+ * Conatins the tested object.
+ */
+ public XCachedContentResultSetStubFactory oObj;
+ private XResultSet resSet = null ;
+
+ /**
+ * Retrieves object relation.
+ * @throws StatusException If relation not found.
+ */
+ public void before() {
+ resSet = (XResultSet) tEnv.getObjRelation("ContentResultSet") ;
+ if (resSet == null) {
+ log.println("!!! Relation not found !!!") ;
+ throw new StatusException(Status.failed("!!! Relation not found !!!")) ;
+ }
+ }
+
+ /**
+ * Creates cached result set stub from static result set. After that number
+ * of rows in cached result set created and its source set are retrieved
+ * and comared. <p>
+ * Has <b>OK</b> status if numbers of rows are equal and they are
+ * greater then 0 (because JAR file contains at least one entry).
+ */
+ public void _createCachedContentResultSetStub() {
+ boolean result = true ;
+
+ XResultSet resSetStub = oObj.createCachedContentResultSetStub
+ (resSet) ;
+
+ if (resSetStub == null) {
+ log.println("!!! Method returned null !!!") ;
+ result = false ;
+ } else {
+ try {
+ resSetStub.last() ;
+ int stubRowNum = resSetStub.getRow() ;
+
+ resSet.last() ;
+ int setRowNum = resSet.getRow() ;
+
+ result = stubRowNum == setRowNum && setRowNum > 0 ;
+
+ log.println("Number of rows : set=" + setRowNum +
+ " stub=" + stubRowNum) ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("!!! Something wrong with result sets :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("createCachedContentResultSetStub()", result) ;
+
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetFactory.java b/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetFactory.java
new file mode 100644
index 000000000000..9a16488d6b19
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetFactory.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCachedDynamicResultSetFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.ucb.XCachedDynamicResultSetFactory;
+import com.sun.star.ucb.XDynamicResultSet;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.ucb.XCachedDynamicResultSetFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createCachedDynamicResultSet()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'CachedDynamicResultSetStub'</code> (of type
+* <code>com.sun.star.sdbc.XDynamicResultSet</code>):
+* this must be an imlementation of <code>
+* com.sun.star.ucb.CachedDynamicResultSetStub</code> service.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XCachedDynamicResultSetFactory
+*/
+public class _XCachedDynamicResultSetFactory extends MultiMethodTest {
+
+ /**
+ * Conatins the tested object.
+ */
+ public XCachedDynamicResultSetFactory oObj;
+ private XDynamicResultSet resSetStub = null ;
+
+ /**
+ * Retrieves object relation.
+ * @throws StatusException If relation not found.
+ */
+ public void before() {
+ resSetStub = (XDynamicResultSet)
+ tEnv.getObjRelation("CachedDynamicResultSetStub") ;
+ if (resSetStub == null) {
+ log.println("!!! Relation not found !!!") ;
+ throw new StatusException
+ (Status.failed("!!! Relation not found !!!")) ;
+ }
+ }
+
+ /**
+ * Creates result set from result set stub. After that number
+ * of rows from result set created and its stub are retrieved
+ * using their static representations and comared. <p>
+ * Has <b>OK</b> status if numbers of rows are equal and they are
+ * greater then 0 (because JAR file contains at least one entry).
+ */
+ public void _createCachedDynamicResultSet() {
+ boolean result = true ;
+
+ XDynamicResultSet resSet = oObj.createCachedDynamicResultSet
+ (resSetStub, null) ;
+
+ if (resSet == null) {
+ log.println("!!! Method returned null !!!") ;
+ result = false ;
+ } else {
+ try {
+ XResultSet resSetS = resSet.getStaticResultSet() ;
+ XResultSet resSetStubS = resSetStub.getStaticResultSet() ;
+
+ resSetStubS.last() ;
+ int stubRowNum = resSetStubS.getRow() ;
+
+ resSetS.last() ;
+ int setRowNum = resSetS.getRow() ;
+
+ result = stubRowNum == setRowNum && setRowNum > 0 ;
+
+ log.println("Number of rows : stub=" + stubRowNum +
+ " set=" + setRowNum) ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("!!! Something wrong with result sets :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.ucb.ListenerAlreadySetException e) {
+ log.println("!!! Can't get static result sets :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("createCachedDynamicResultSet()", result) ;
+
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetStubFactory.java b/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetStubFactory.java
new file mode 100644
index 000000000000..0adb46f425b0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetStubFactory.java
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCachedDynamicResultSetStubFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.ucb.XCachedDynamicResultSetFactory;
+import com.sun.star.ucb.XCachedDynamicResultSetStubFactory;
+import com.sun.star.ucb.XDynamicResultSet;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.ucb.XCachedDynamicResultSetStubFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createCachedDynamicResultSetStub()</code></li>
+* <li><code> connectToCache()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DynamicResultSet'</code> (of type
+* <code>com.sun.star.sdbc.XDynamicResultSet</code>):
+* this must be an imlementation of <code>
+* com.sun.star.ucb.DynamicResultSet</code> service.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XCachedDynamicResultSetStubFactory
+*/
+public class _XCachedDynamicResultSetStubFactory extends MultiMethodTest {
+
+ /**
+ * Conatins the tested object.
+ */
+ public XCachedDynamicResultSetStubFactory oObj;
+ private XDynamicResultSet resSet = null ;
+ private XDynamicResultSet resSetStub = null ;
+
+ /**
+ * Retrieves object relation.
+ * @throws StatusException If relation not found.
+ */
+ public void before() {
+ resSet = (XDynamicResultSet) tEnv.getObjRelation("DynamicResultSet") ;
+ if (resSet == null) {
+ log.println("!!! Relation not found !!!") ;
+ throw new StatusException(Status.failed("!!! Relation not found !!!")) ;
+ }
+ }
+
+ /**
+ * Creates result set stub from result set. After that number
+ * of rows from result set stub created and its source set are retrieved
+ * using their static representations and compared. <p>
+ * Has <b>OK</b> status if numbers of rows are equal and they are
+ * greater then 0 (because JAR file contains at least one entry).
+ */
+ public void _createCachedDynamicResultSetStub() {
+ boolean result = true ;
+
+ resSetStub = oObj.createCachedDynamicResultSetStub(resSet) ;
+
+ if (resSetStub == null) {
+ log.println("!!! Method returned null !!!") ;
+ result = false ;
+ } else {
+ try {
+ XResultSet resSetS = resSet.getStaticResultSet() ;
+ XResultSet resSetStubS = resSetStub.getStaticResultSet() ;
+
+ resSetStubS.last() ;
+ int stubRowNum = resSetStubS.getRow() ;
+
+ resSetS.last() ;
+ int setRowNum = resSetS.getRow() ;
+
+ result = stubRowNum == setRowNum && setRowNum > 0 ;
+
+ log.println("Number of rows : stub=" + stubRowNum +
+ " set=" + setRowNum) ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("!!! Something wrong with result sets :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.ucb.ListenerAlreadySetException e) {
+ log.println("!!! Can't get static result sets :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("createCachedDynamicResultSetStub()", result) ;
+ }
+
+ /**
+ * Creates an instance of <code>CachedDynamicResultSet</code> service
+ * which is not connected to any stub. Then tries to connect it to
+ * <code>DynaminResultSet</code> created and passed as relation.
+ * Connection is checked by retrieving and comparing of row numbers
+ * of connected set and its source set. <p>
+ * Has <b>OK</b> status if row numbers are equal and they are
+ * greater then 0 (because JAR file contains at least one entry).
+ */
+ public void _connectToCache() {
+ boolean result = true ;
+
+ XCachedDynamicResultSetFactory setFac = null ;
+
+ try {
+ Object fac = tParam.getMSF().createInstance
+ ("com.sun.star.ucb.CachedDynamicResultSetFactory") ;
+
+ setFac = (XCachedDynamicResultSetFactory) UnoRuntime.queryInterface
+ (XCachedDynamicResultSetFactory.class, fac) ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Cant instantiate a service") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ XDynamicResultSet rmtSet = setFac.createCachedDynamicResultSet(null, null) ;
+
+ try {
+ oObj.connectToCache(resSet, rmtSet, null, null) ;
+ } catch (com.sun.star.ucb.ListenerAlreadySetException e) {
+ log.println("!!! Unexpected exception :" + e) ;
+ result = false ;
+ } catch (com.sun.star.ucb.AlreadyInitializedException e) {
+ log.println("!!! Unexpected exception :" + e) ;
+ result = false ;
+ }
+
+ if (result) {
+ // checking connection to the source
+ try {
+ XResultSet statRmtSet = rmtSet.getStaticResultSet() ;
+ XResultSet statResSet = resSet.getStaticResultSet() ;
+
+ statRmtSet.last() ;
+ int rmtRowNum = statRmtSet.getRow() ;
+
+ statResSet.last() ;
+ int resRowNum = statResSet.getRow() ;
+
+ result = rmtRowNum == resRowNum && resRowNum > 0 ;
+
+ log.println("Number of rows : destination=" + rmtRowNum +
+ " source=" + resRowNum) ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("!!! Something wrong with result sets :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.ucb.ListenerAlreadySetException e) {
+ log.println("!!! Something wrong with result sets :") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ }
+
+ tRes.tested("connectToCache()", result) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java b/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java
new file mode 100644
index 000000000000..1d528ec90263
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java
@@ -0,0 +1,282 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCommandProcessor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.ucb.Command;
+import com.sun.star.ucb.CommandAbortedException;
+import com.sun.star.ucb.CommandInfo;
+import com.sun.star.ucb.GlobalTransferCommandArgument;
+import com.sun.star.ucb.NameClash;
+import com.sun.star.ucb.TransferCommandOperation;
+import com.sun.star.ucb.UnsupportedCommandException;
+import com.sun.star.ucb.XCommandInfo;
+import com.sun.star.ucb.XCommandProcessor;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+/**
+* Tests <code>XCommandProcessor</code>. The TestCase can pass (but doesn't have
+* to) "XCommandProcessor.AbortCommand" relation, to specify command to abort in
+* <code>abort()</code> test.
+*
+* Testing <code>com.sun.star.ucb.XCommandProcessor</code>
+* interface methods :
+* <ul>
+* <li><code> createCommandIdentifier()</code></li>
+* <li><code> execute()</code></li>
+* <li><code> abort()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XCommandProcessor.AbortCommand'</code> <b>optional</b>
+* (of type <code>com.sun.star.ucb.Command</code>):
+* specify command to abort in <code>abort()</code> test.
+* If the relation is not specified the 'GlobalTransfer'
+* command is used.</li>
+* <ul> <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code>poliball.gif</code> : this file is required in case
+* if the relation <code>'XCommandProcessor.AbortCommand'</code>
+* is not specified. This file is used by 'GlobalTransfer'
+* command as a source file for copying.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XCommandProcessor
+*/
+public class _XCommandProcessor extends MultiMethodTest {
+
+ /**
+ * Conatins the tested object.
+ */
+ public XCommandProcessor oObj;
+
+ /**
+ * Contains the command id returned by <code>createCommandIdentifier()
+ * </code>. It is used in <code>abort()</code> test.
+ */
+ int cmdId;
+
+ /**
+ * Tests <code>createCommandIdentifier()</code>. Calls it for two times
+ * and checks returned values. <p>
+ * Has <b>OK</b> status if values are unique correct idenifiers: not 0.
+ */
+ public void _createCommandIdentifier() {
+ log.println("creating a command line identifier");
+
+ int testCmdId = oObj.createCommandIdentifier();
+ cmdId = oObj.createCommandIdentifier();
+
+ if (cmdId == 0 || testCmdId == 0) {
+ log.println("createCommandLineIdentifier() returned 0 - FAILED");
+ }
+
+ if (cmdId == testCmdId) {
+ log.println("the command identifier is not unique");
+ }
+
+ tRes.tested("createCommandIdentifier()",
+ testCmdId != 0 && cmdId != 0 && cmdId != testCmdId);
+ }
+
+ /**
+ * First executes 'geCommandInfo' command and examines returned
+ * command info information. Second tries to execute inproper
+ * command. <p>
+ * Has <b> OK </b> status if in the first case returned information
+ * contains info about 'getCommandInfo' command and in the second
+ * case an exception is thrown. <p>
+ */
+ public void _execute() {
+ String commandName = "getCommandInfo";
+ Command command = new Command(commandName, -1, null);
+
+ Object result;
+
+ log.println("executing command " + commandName);
+ try {
+ result = oObj.execute(command, 0, null);
+ } catch (CommandAbortedException e) {
+ log.println("The command aborted " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ } catch (Exception e) {
+ log.println("Unexpected exception " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ XCommandInfo xCmdInfo = (XCommandInfo)UnoRuntime.queryInterface(
+ XCommandInfo.class, result);
+
+ CommandInfo[] cmdInfo = xCmdInfo.getCommands();
+
+ boolean found = false;
+
+ for (int i = 0; i < cmdInfo.length; i++) {
+ if (cmdInfo[i].Name.equals(commandName)) {
+ found = true;
+ break;
+ }
+ }
+
+ log.println("testing execute with wrong command");
+
+ Command badCommand = new Command("bad command", -1, null);
+
+ try {
+ oObj.execute(badCommand, 0, null);
+ } catch (CommandAbortedException e) {
+ log.println("CommandAbortedException thrown - OK");
+ } catch (UnsupportedCommandException e) {
+ log.println("UnsupportedCommandException thrown - OK");
+ } catch (Exception e) {
+ log.println("Wrong exception thrown " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ tRes.tested("execute()", found);
+ }
+
+ /**
+ * First a separate thread where <code>abort</code> method
+ * is called permanently. Then a "long" command (for example,
+ * "transfer") is started. I case if relation is not
+ * specified 'GlobalTransfer' command starts to
+ * copy a file to temporary directory (if the relation is present
+ * then the its command starts to work). <p>
+ * Has <b> OK </b> status if the command execution is aborted, i.e.
+ * <code>CommandAbortedException</code> is thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createCommandIdentifier() </code> : to have a unique
+ * identifier which is used to abourt started command. </li>
+ * </ul>
+ */
+ public void _abort() {
+ executeMethod("createCommandIdentifier()");
+
+ Command command = (Command)tEnv.getObjRelation(
+ "XCommandProcessor.AbortCommand");
+
+ if (command == null) {
+ String commandName = "globalTransfer";
+
+ String srcURL = util.utils.getFullTestURL("solibrary.jar") ;
+ String tmpURL = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ log.println("Copying '" + srcURL + "' to '" + tmpURL) ;
+
+ GlobalTransferCommandArgument arg = new
+ GlobalTransferCommandArgument(
+ TransferCommandOperation.COPY, srcURL,
+ tmpURL, "", NameClash.OVERWRITE);
+
+ command = new Command(commandName, -1, arg);
+ }
+
+ Thread aborter = new Thread() {
+ public void run() {
+ for (int i = 0; i < 10; i++) {
+ log.println("try to abort command");
+ oObj.abort(cmdId);
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+ };
+
+ aborter.start();
+
+ try {
+ Thread.currentThread().sleep(15);
+ } catch (InterruptedException e) {
+ }
+
+ log.println("executing command");
+ try {
+ oObj.execute(command, cmdId, null);
+ log.println("Command execution completed");
+ log.println("CommandAbortedException is not thrown");
+ log.println("This is OK since there is no command implemented "+
+ "that can be aborted");
+ tRes.tested("abort()", true);
+ } catch (CommandAbortedException e) {
+ tRes.tested("abort()", true);
+ } catch (Exception e) {
+ log.println("Unexpected exception " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ try {
+ aborter.join(5000);
+ aborter.interrupt();
+ } catch(java.lang.InterruptedException e) {
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/ucb/_XContentIdentifierFactory.java b/qadevOOo/tests/java/ifc/ucb/_XContentIdentifierFactory.java
new file mode 100644
index 000000000000..053c2d5dbc59
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XContentIdentifierFactory.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XContentIdentifierFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import lib.MultiMethodTest;
+import util.utils;
+
+import com.sun.star.ucb.XContentIdentifier;
+import com.sun.star.ucb.XContentIdentifierFactory;
+
+/**
+* Testing <code>com.sun.star.ucb.XContentIdentifierFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createContentIdentifier()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.ucb.XContentIdentifierFactory
+*/
+public class _XContentIdentifierFactory extends MultiMethodTest {
+ /**
+ * Contains the tested object.
+ */
+ public XContentIdentifierFactory oObj;
+
+ /**
+ * Calls the tested method with a file url and
+ * gets an identifier. <p>
+ * Has <b> OK </b> status if content identifier an provider sheme are
+ * proper. <p>
+ */
+ public void _createContentIdentifier() {
+ // creating a content identifier string - tmp url
+ String tmpDir = utils.getOfficeTemp(tParam.getMSF());
+
+ String contentId = utils.getFullURL(tmpDir);
+
+ // the scheme is file
+ String scheme = "file";
+
+ XContentIdentifier identifier = oObj.createContentIdentifier(contentId);
+
+ // verifying results
+ String resId = identifier.getContentIdentifier();
+ String resScheme = identifier.getContentProviderScheme();
+
+ tRes.tested("createContentIdentifier()", contentId.equals(resId)
+ && scheme.equals(resScheme));
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/ucb/_XContentProvider.java b/qadevOOo/tests/java/ifc/ucb/_XContentProvider.java
new file mode 100644
index 000000000000..c5ca027b7a7f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XContentProvider.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XContentProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+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 lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.ucb.XContentProvider</code>
+* interface methods :
+* <ul>
+* <li><code> queryContent()</code></li>
+* <li><code> compareContentIds()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'FACTORY'</code> (of type
+* <code>com.sun.star.ucb.XContentIdentifierFactory</code>):
+* a suitable factory which can produce content identifiers </li>
+* <li> <code>'CONTENT1'</code> (<b>optional</b>) (of type <code>String</code>):
+* name of the suitable content for provider tested. If relation
+* is not specified the 'vnd.sun.star.help://' name will be used.</li>
+* <li> <code>'CONTENT2'</code> (<b>optional</b>) (of type <code>String</code>):
+* another name of the suitable content for provider tested. If relation
+* is not specified the 'vnd.sun.star.writer://' name will be used.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XContentProvider
+*/
+public class _XContentProvider extends MultiMethodTest {
+
+ public static XContentProvider oObj = null;
+ protected XContentIdentifierFactory CIF = null ;
+ protected String content1 = "vnd.sun.star.help://" ;
+ protected String content2 = "vnd.sun.star.writer://" ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ CIF = (XContentIdentifierFactory) tEnv.getObjRelation("FACTORY");
+ String tmp = (String) tEnv.getObjRelation("CONTENT1") ;
+ if (tmp != null) content1 = tmp ;
+ tmp = (String) tEnv.getObjRelation("CONTENT2") ;
+ if (tmp != null) content2 = tmp ;
+
+ if (CIF == null) throw new StatusException(
+ Status.failed("'FACTORY' relation is not found.")) ;
+ }
+
+ /**
+ * Tries to query for some content suitable for this provider. <p>
+ * Has <b>OK</b> status if not null value is returned.
+ */
+ public void _queryContent() {
+ try {
+ XContentIdentifierFactory CIF = (XContentIdentifierFactory)
+ tEnv.getObjRelation("FACTORY");
+ String aURL = content1;
+ log.println("Trying to query "+aURL);
+ XContentIdentifier CI = CIF.createContentIdentifier(aURL);
+ XContent aContent = oObj.queryContent(CI);
+ boolean res = true;
+ Object nc = tEnv.getObjRelation("NoCONTENT");
+ if (nc == null) {
+ res = aContent != null;
+ }
+ tRes.tested("queryContent()",res);
+ } catch (com.sun.star.ucb.IllegalIdentifierException e) {
+ log.println("Exception while checking 'queryContent'");
+ e.printStackTrace(log);
+ tRes.tested("queryContent()",false);
+ }
+ }
+
+ /**
+ * Creates two different content identifiers. First two different
+ * identifiers compared, then two same identifiers. <p>
+ * Has <b>OK</b> status if in the first case <code>false</code>
+ * returned, and in the second - <code>true</code>.
+ */
+ public void _compareContentIds() {
+ XContentIdentifierFactory CIF = (XContentIdentifierFactory)
+ tEnv.getObjRelation("FACTORY");
+ String aURL = content1 ;
+ XContentIdentifier CI = CIF.createContentIdentifier(aURL);
+ aURL = content2 ;
+ XContentIdentifier CI2 = CIF.createContentIdentifier(aURL);
+ int compare = oObj.compareContentIds(CI,CI2);
+ boolean res = (compare != 0);
+ if (!res) {
+ log.println("Didn't work with differnt IDs");
+ log.println(compare+" was returned");
+ }
+ compare = oObj.compareContentIds(CI,CI);
+ res &= (compare == 0);
+ if (!res) {
+ log.println("Didn't work with equal IDs");
+ log.println(compare+" was returned");
+ }
+ tRes.tested("compareContentIds()",res);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XContentProviderFactory.java b/qadevOOo/tests/java/ifc/ucb/_XContentProviderFactory.java
new file mode 100644
index 000000000000..bf5f2bb47c0e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XContentProviderFactory.java
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XContentProviderFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.ucb.XContentProvider;
+import com.sun.star.ucb.XContentProviderFactory;
+import lib.MultiMethodTest;
+
+
+/**
+* Testing <code>com.sun.star.ucb.XContentProviderFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createContentProvider()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XContentProviderFactory
+*/
+public class _XContentProviderFactory extends MultiMethodTest {
+
+ public static XContentProviderFactory oObj = null;
+
+ /**
+ * Creates a propvider. <p>
+ * Has <b> OK </b> status if the returned value is not
+ * <code>null</code>. <p>
+ */
+ public void _createContentProvider() {
+ XContentProvider CP = oObj.createContentProvider
+ ("com.sun.star.ucb.ContentProviderFactory");
+ tRes.tested("createContentProvider()",CP != null);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XContentProviderManager.java b/qadevOOo/tests/java/ifc/ucb/_XContentProviderManager.java
new file mode 100644
index 000000000000..a7fb93ae8837
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XContentProviderManager.java
@@ -0,0 +1,311 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XContentProviderManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.ContentProviderInfo;
+import com.sun.star.ucb.DuplicateProviderException;
+import com.sun.star.ucb.XContentProvider;
+import com.sun.star.ucb.XContentProviderManager;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Tests XContentProviderManager. The test registers two ContentProviders, calls
+* queryXXX methods to verify results, and deregisters them.
+*
+* Testing <code>com.sun.star.ucb.XContentProviderManager</code>
+* interface methods :
+* <ul>
+* <li><code> registerContentProvider()</code></li>
+* <li><code> deregisterContentProvider()</code></li>
+* <li><code> queryContentProviders()</code></li>
+* <li><code> queryContentProvider()</code></li>
+* </ul> <p>
+* The test registers two ContentProviders, calls
+* queryXXX methods to verify results, and deregisters them. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XContentProviderManager
+*/
+public class _XContentProviderManager extends MultiMethodTest {
+ /**
+ * Contains the tested object.
+ */
+ public XContentProviderManager oObj;
+
+ /**
+ * The test scheme name.
+ */
+ static final String myScheme = "test-scheme";
+
+ /**
+ * First content provider. It will be hidden by <code>contentProvider
+ * </code>, registred with the same <code>myScheme</code> to test
+ * the "hiding" behaviour.
+ */
+ XContentProvider firstContentProvider;
+
+ /**
+ * The main content provider.
+ */
+ XContentProvider contentProvider;
+
+ /**
+ * <code>ContentProvider</code>s information which are in the manager
+ * before registering the testing providers.
+ */
+ ContentProviderInfo[] initialProvidersInfo;
+
+ /**
+ * Creates two testing providers.
+ *
+ * @see #firstContentProvider
+ * @see #contentProvider
+ */
+ public void before() {
+ XMultiServiceFactory xMSF = tParam.getMSF();
+
+ log.println("creating testing content providers");
+ try {
+ firstContentProvider = (XContentProvider)UnoRuntime.queryInterface(
+ XContentProvider.class, xMSF.createInstance(
+ "com.sun.star.ucb.FileContentProvider"));
+
+ contentProvider = (XContentProvider)UnoRuntime.queryInterface(
+ XContentProvider.class, xMSF.createInstance(
+ "com.sun.star.ucb.FileContentProvider"));
+ } catch (Exception e) {
+ log.println("Can't create content providers " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+
+ /**
+ * At the beginning call <code>queryContentProviders</code> method
+ *
+ * to have info about providers existing before new adding.
+ * It adds two testing contents providers, both for the same scheme.
+ * The second one is added two times: first, in non-replacing mode, to test
+ * <code>DuplicateProviderException</code>, and second, in replacing mode,
+ * to hide the first provider. <p>
+ *
+ * The evaluation of results are performed later, in
+ * <code>queryContentProvider()</code>.
+ *
+ * Has <b> OK </b> status if in the first provider is registered
+ * without exceptions, the second throws
+ * <code>DuplicateProviderException</code> in non-replacing mode,
+ * and no exceptions in replacing mode. <p>
+ *
+ * @see #_queryContentProvider
+ */
+ public void _registerContentProvider() {
+ // querying providfers info before inserting them, to verify results
+ initialProvidersInfo = oObj.queryContentProviders();
+
+ log.println("registering the first provider");
+ try {
+ oObj.registerContentProvider(firstContentProvider, myScheme,false);
+ } catch (DuplicateProviderException e) {
+ log.println("Unexpected exception thrown " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception ", e);
+ }
+
+ log.println("registering the second provider in non-replacing mode");
+ try {
+ oObj.registerContentProvider(contentProvider, myScheme, false);
+ Status.failed("registerContentProvider(.., .., false)");
+ } catch (DuplicateProviderException e) {
+ log.println("DuplicateProviderException thrown - OK");
+ }
+
+ XContentProvider result;
+
+ log.println("registering the second provider in the replace mode");
+ try {
+ result = oObj.registerContentProvider(contentProvider, myScheme, true);
+ } catch (DuplicateProviderException e) {
+ log.println("Unexpected exception thrown " + e.getMessage());
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception ", e);
+ }
+
+ // check the result is the first provider
+ tRes.tested("registerContentProvider()",
+ result.equals(firstContentProvider));
+ }
+
+ /**
+ * It calls the method (after registering providers) and compares
+ * its result with the result before registering.
+ *
+ * Has <b> OK </b> status if the number of providers increases
+ * by one after registering custom provider.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerContentProvider() </code> : to compare number
+ * of providers. </li>
+ * </ul>
+ * @see #_registerContentProvider
+ */
+ public void _queryContentProviders() {
+ executeMethod("registerContentProvider()");
+
+ ContentProviderInfo[] providersInfo = oObj.queryContentProviders();
+ // verifying that the number of providers increased by 1
+ tRes.tested("queryContentProviders()",
+ providersInfo.length == initialProvidersInfo.length + 1);
+ }
+
+ /**
+ * It queries for added custom provider using its scheme
+ * and verifies its result with
+ * <code>queryContentProviders()</code> result and with
+ * custom provider created in <code>registerContentProvider()</code>.
+ * Also verifies <code>registerContentProvider()</code>. <p>
+ *
+ * Has <b>OK</b> status if the provider returned is found within
+ * all providers and is equal to provider created before.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerContentProvider() </code> </li>
+ * </ul>
+ */
+ public void _queryContentProvider() {
+ executeMethod("registerContentProvider()");
+
+ XContentProvider result = oObj.queryContentProvider
+ ("http://www.sun.com");
+
+ log.println("finding queryContentProvider() result");
+ boolean found = false;
+
+ ContentProviderInfo[] providersInfo = oObj.queryContentProviders();
+
+ for (int i = 0; i < providersInfo.length; i++) {
+ if (result.equals(providersInfo[i].ContentProvider)
+ /*&& myScheme.equals(providersInfo[i].Scheme)*/) {
+ found = true;
+ break;
+ }
+ }
+
+ boolean gotTheRightOne = util.ValueComparer.equalValue
+ (result,contentProvider);
+
+ tRes.tested("queryContentProvider()", found);
+
+ gotTheRightOne = result.equals(contentProvider);
+
+ }
+
+ /**
+ * At first one provider is deregistered, after that provider
+ * is queried, the second provider must be returned for the
+ * specified scheme. Then the second provider is deregistered.
+ * Now <code>null</code> value must be retruned by the method
+ * <code>queryContentProvider</code> on the specified scheme. <p>
+ *
+ * Has <b>OK</b> status if in the first case the second provider
+ * remains registered, and after its removing no providers remain
+ * registered for the scheme specified.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerContentProvider() </code> : two providers
+ * must be registered. </li>
+ * </ul>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> queryContentProvider() </code> : to run this test
+ * finally. </li>
+ * <li> <code> queryContentProviders() </code> : to run this test
+ * finally. </li>
+ * </ul>
+ */
+ public void _deregisterContentProvider() {
+ executeMethod("queryContentProvider()");
+ executeMethod("queryContentProviders()");
+ requiredMethod("registerContentProvider()");
+
+ log.println("deregistering the second provider");
+ oObj.deregisterContentProvider(contentProvider, myScheme);
+
+ XContentProvider res = oObj.queryContentProvider(myScheme);
+
+ log.println("deregistering the first provider");
+ oObj.deregisterContentProvider(firstContentProvider, myScheme);
+
+ res = oObj.queryContentProvider(myScheme);
+
+ // verifying that no provider is returned
+ tRes.tested("deregisterContentProvider()", res == null);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/ucb/_XDataContainer.java b/qadevOOo/tests/java/ifc/ucb/_XDataContainer.java
new file mode 100644
index 000000000000..22d3121a8637
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XDataContainer.java
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDataContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.ucb.XDataContainer;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ucb.XDataContainer</code>
+* interface methods :
+* <ul>
+* <li><code> getContentType()</code></li>
+* <li><code> setContentType()</code></li>
+* <li><code> getData()</code></li>
+* <li><code> setData()</code></li>
+* <li><code> getDataURL()</code></li>
+* <li><code> setDataURL()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XDataContainer
+*/
+public class _XDataContainer extends MultiMethodTest {
+
+ public static XDataContainer oObj = null; // oObj filled by MultiMethodTest
+ private byte[] data = new byte[] {34, 35, 36} ;
+ private String dataURL = null;
+
+ /**
+ * Sets the content type to some value. <p>
+ * Has <b>OK</b> status if no runtime exseptions occured.
+ */
+ public void _setContentType() {
+ oObj.setContentType("image/jpeg") ;
+ tRes.tested("setContentType()", true) ;
+ }
+
+ /**
+ * Check if values 'set' and 'get' are equal. <p>
+ * Has <b>OK</b> status if they are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setContentType() </code> </li>
+ * </ul>
+ */
+ public void _getContentType() {
+ requiredMethod("setContentType()") ;
+
+ String type = oObj.getContentType() ;
+ tRes.tested("getContentType()", "image/jpeg".equals(type)) ;
+ }
+
+ /**
+ * Sets the data to some byte array. <p>
+ * Has <b>OK</b> status if no runtime exseptions occured.
+ */
+ public void _setData() {
+ oObj.setData(data) ;
+ tRes.tested("setData()", true) ;
+ }
+
+ /**
+ * Check if arrays 'set' and 'get' are equal. <p>
+ * Has <b>OK</b> status if they are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setData() </code> </li>
+ * </ul>
+ */
+ public void _getData() {
+ requiredMethod("setData()") ;
+
+ byte[] gData = oObj.getData() ;
+ boolean res = true ;
+ if (res = (gData != null && gData.length == data.length)) {
+ for (int i = 0; i < data.length; i++) {
+ res &= data[i] == gData[i] ;
+ }
+ }
+
+ tRes.tested("getData()", res) ;
+ }
+
+ /**
+ * Sets the data URL to some URL. <p>
+ * Has <b>OK</b> status if no runtime exseptions occured.
+ */
+ public void _setDataURL() {
+ dataURL = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ oObj.setDataURL(dataURL) ;
+ tRes.tested("setDataURL()", true) ;
+ }
+
+ /**
+ * Check if URLs 'set' and 'get' are equal. <p>
+ * Has <b>OK</b> status if they are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setDataURL() </code> </li>
+ * </ul>
+ */
+ public void _getDataURL() {
+ requiredMethod("setDataURL()") ;
+
+ String gURL = oObj.getDataURL() ;
+ tRes.tested("getDataURL()", dataURL.equals(gURL)) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XFileIdentifierConverter.java b/qadevOOo/tests/java/ifc/ucb/_XFileIdentifierConverter.java
new file mode 100644
index 000000000000..1c20f985c45b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XFileIdentifierConverter.java
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFileIdentifierConverter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.ucb.XFileIdentifierConverter;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ucb.XFileIdentifierConverter</code>
+* interface methods :
+* <ul>
+* <li><code> getFileProviderLocality()</code></li>
+* <li><code> getFileURLFromSystemPath()</code></li>
+* <li><code> getSystemPathFromFileURL()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XFileIdentifierConverter
+*/
+public class _XFileIdentifierConverter extends MultiMethodTest {
+
+ /**
+ * Contains the tested object.
+ */
+ public XFileIdentifierConverter oObj;
+
+ /**
+ * Gets the locality for SOffice temporary directory. <p>
+ * Has <b> OK </b> status if the method returns value greater
+ * than 0 (as office temp directory is supposed to be in the
+ * same location). <p>
+ */
+ public void _getFileProviderLocality() {
+ String baseURL = util.utils.getOfficeTemp(tParam.getMSF());
+ log.println("Using: "+baseURL);
+ int loc = oObj.getFileProviderLocality(baseURL);
+ log.println("Getting: "+loc);
+ tRes.tested("getFileProviderLocality()",loc > 0);
+ }
+
+ /**
+ * Tries to convert URL of SOffice temp directory to system
+ * dependent path. <p>
+ * Has <b> OK </b> status if the method returns system dependent
+ * representation of the URL passed. <p>
+ */
+ public void _getSystemPathFromFileURL() {
+ String baseURL = util.utils.getOfficeTemp(tParam.getMSF());
+ log.println("Using (Base): "+baseURL);
+ String sysURL = util.utils.getOfficeTempDirSys(tParam.getMSF());
+ log.println("Using (System): "+sysURL);
+ String get = oObj.getSystemPathFromFileURL(baseURL);
+ log.println("Getting: "+get);
+ //sysURL = sysURL.substring(0,sysURL.length()-1);
+ tRes.tested("getSystemPathFromFileURL()",get.equals(sysURL));
+ }
+
+ /**
+ * Tries to convert system dependent path of SOffice temp
+ * directory to URL representation. <p>
+ * Has <b> OK </b> status if the method returns URL representation
+ * of the system dependent path passed. <p>
+ */
+ public void _getFileURLFromSystemPath() {
+ String baseURL = util.utils.getOfficeTemp(tParam.getMSF());
+ log.println("Using (Base): "+baseURL);
+ String sysURL = util.utils.getOfficeTempDirSys(tParam.getMSF());
+ log.println("Using (System): "+sysURL);
+ String get = oObj.getFileURLFromSystemPath(sysURL,sysURL);
+ log.println("Getting: "+get);
+ tRes.tested("getFileURLFromSystemPath()",get.equals(baseURL));
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/ucb/_XParameterizedContentProvider.java b/qadevOOo/tests/java/ifc/ucb/_XParameterizedContentProvider.java
new file mode 100644
index 000000000000..1243001993ff
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XParameterizedContentProvider.java
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XParameterizedContentProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.ucb.XContentProvider;
+import com.sun.star.ucb.XParameterizedContentProvider;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ucb.XParameterizedContentProvider</code>
+* interface methods :
+* <ul>
+* <li><code> registerInstance()</code></li>
+* <li><code> deregisterInstance()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XParameterizedContentProvider
+*/
+public class _XParameterizedContentProvider extends MultiMethodTest {
+
+ public static XParameterizedContentProvider oObj = null;
+
+ /**
+ * Registers an instance with some arguments. <p>
+ * Has <b>OK</b> status if the method returns non <code>null</code>
+ * provider.
+ */
+ public void _registerInstance() {
+ try {
+ XContentProvider CP = oObj.registerInstance(
+ "\"vnd.sun.star.pkg://file\".*",
+ "uno:pipe,name=ucb_soffice;<PIPE>;urp;UCB.Factory",
+ true);
+ tRes.tested("registerInstance()",CP != null);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while checking 'registerInstance'");
+ e.printStackTrace(log);
+ tRes.tested("registerInstance()",false);
+ }
+ }
+
+ /**
+ * Deregisters the instance registered before. <p>
+ * Has <b>OK</b> status if the method returns non <code>null</code>
+ * provider. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerInstance() </code> : to deregister it here. </li>
+ * </ul>
+ */
+ public void _deregisterInstance() {
+ requiredMethod("registerInstance()");
+ try {
+ XContentProvider CP = oObj.deregisterInstance(
+ "\"vnd.sun.star.pkg://file\".*",
+ "uno:pipe,name=ucb_soffice;<PIPE>;urp;UCB.Factory");
+ tRes.tested("deregisterInstance()",CP != null);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while checking 'deregisterInstance'");
+ e.printStackTrace(log);
+ tRes.tested("deregisterInstance()",false);
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XPropertyMatcherFactory.java b/qadevOOo/tests/java/ifc/ucb/_XPropertyMatcherFactory.java
new file mode 100644
index 000000000000..347be35f0e81
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XPropertyMatcherFactory.java
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPropertyMatcherFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.ucb.RuleOperator;
+import com.sun.star.ucb.RuleTerm;
+import com.sun.star.ucb.SearchCriterium;
+import com.sun.star.ucb.XPropertyMatcher;
+import com.sun.star.ucb.XPropertyMatcherFactory;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ucb.XPropertyMatcherFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createPropertyMatcher()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XPropertyMatcherFactory
+*/
+public class _XPropertyMatcherFactory extends MultiMethodTest {
+
+ public static XPropertyMatcherFactory oObj = null;
+
+ /**
+ * Tries to create <code>XPropertyMatcher</code> implementation. <p>
+ * Has <b>OK</b> status if not null alue returned.
+ */
+ public void _createPropertyMatcher() {
+ RuleTerm term = new RuleTerm() ;
+
+ term.Property = "ContentType" ;
+ term.Operand = "vnd.sun.star.fsys" ;
+ term.Operator = RuleOperator.CONTAINS ;
+
+ SearchCriterium crit = new SearchCriterium(new RuleTerm[] {term}) ;
+
+ XPropertyMatcher matcher = oObj.createPropertyMatcher
+ (new SearchCriterium[] {crit}) ;
+
+ tRes.tested("createPropertyMatcher()", matcher != null) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XPropertySetRegistryFactory.java b/qadevOOo/tests/java/ifc/ucb/_XPropertySetRegistryFactory.java
new file mode 100644
index 000000000000..2877007fd903
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XPropertySetRegistryFactory.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPropertySetRegistryFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.ucb.XPropertySetRegistry;
+import com.sun.star.ucb.XPropertySetRegistryFactory;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ucb.XPropertySetRegistryFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createPropertySetRegistry()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XPropertySetRegistryFactory
+*/
+public class _XPropertySetRegistryFactory extends MultiMethodTest {
+
+ public static XPropertySetRegistryFactory oObj = null;
+
+ /**
+ * Test calls the method with empty string argument. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _createPropertySetRegistry() {
+ XPropertySetRegistry PSR = oObj.createPropertySetRegistry("");
+ tRes.tested("createPropertySetRegistry()",PSR != null);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XRemoteContentProviderAcceptor.java b/qadevOOo/tests/java/ifc/ucb/_XRemoteContentProviderAcceptor.java
new file mode 100644
index 000000000000..22d825808bd1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XRemoteContentProviderAcceptor.java
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRemoteContentProviderAcceptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.ucb.XRemoteContentProviderAcceptor;
+import com.sun.star.ucb.XRemoteContentProviderDoneListener;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.ucb.XRemoteContentProviderAcceptor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> addRemoteContentProvider()</code></li>
+ * <li><code> removeRemoteContentProvider()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.ucb.XRemoteContentProviderAcceptor
+ */
+public class _XRemoteContentProviderAcceptor extends MultiMethodTest {
+
+ public XRemoteContentProviderAcceptor oObj = null;
+
+ /**
+ * The simple <code>XRemoteContentProviderDoneListener</code>
+ * implementation.
+ */
+ public class DoneListener implements XRemoteContentProviderDoneListener {
+
+ public void doneWithRemoteContentProviders
+ (XRemoteContentProviderAcceptor xRCPA) {
+ }
+ public void disposing (com.sun.star.lang.EventObject obj) {}
+
+ };
+
+ XRemoteContentProviderDoneListener aDoneListener = new DoneListener();
+
+ /**
+ * Adds a remote provider. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>.
+ */
+ public void _addRemoteContentProvider() {
+ boolean res = false;
+
+ String[] template = new String[]{"file"};
+ res = oObj.addRemoteContentProvider("ContentID",tParam.getMSF(),
+ template,aDoneListener);
+
+ tRes.tested("addRemoteContentProvider()",res);
+ }
+
+ /**
+ * Removes the remote provider added before. <p>
+ * Has <b> OK </b> status if the method returns <code>true</code>.
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addRemoteContentProvider() </code> : rovider must
+ * be added first </li>
+ * </ul>
+ */
+ public void _removeRemoteContentProvider() {
+ requiredMethod("addRemoteContentProvider()") ;
+
+ boolean res = false;
+
+ res = oObj.removeRemoteContentProvider("ContentID");
+ tRes.tested("removeRemoteContentProvider()",res);
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XRemoteContentProviderActivator.java b/qadevOOo/tests/java/ifc/ucb/_XRemoteContentProviderActivator.java
new file mode 100644
index 000000000000..36e5a9868839
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XRemoteContentProviderActivator.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRemoteContentProviderActivator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.ucb.XContentProviderManager;
+import com.sun.star.ucb.XRemoteContentProviderAcceptor;
+import com.sun.star.ucb.XRemoteContentProviderActivator;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.ucb.XRemoteContentProviderActivator</code>
+ * interface methods :
+ * <ul>
+ * <li><code> activateRemoteContentProviders()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'RCPA'</code>
+ * (of type <code>XRemoteContentProviderAcceptor</code>):
+ * this acceptor is used to add a provider first before
+ * its activation. </li>
+ * <ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.ucb.XRemoteContentProviderActivator
+ */
+public class _XRemoteContentProviderActivator extends MultiMethodTest {
+
+ public XRemoteContentProviderActivator oObj = null;
+
+ /**
+ * First the relation is retrieved and a remote provider is
+ * added to the acceptor. Then it is activated and
+ * removed. <p>
+ * Has <b> OK </b> status if <code>activateRemoteContentProviders</code>
+ * method returns not <code>null</code> value. <p>
+ */
+ public void _activateRemoteContentProviders() {
+ boolean res = false;
+
+ XRemoteContentProviderAcceptor xRCPA = (XRemoteContentProviderAcceptor)
+ tEnv.getObjRelation("RCPA");
+ String[] template = new String[]{"file"};
+ xRCPA.addRemoteContentProvider("ContentID",tParam.getMSF(),template,null);
+ XContentProviderManager CPM = oObj.activateRemoteContentProviders();
+ res = (CPM != null);
+ xRCPA.removeRemoteContentProvider("ContentID");
+
+ tRes.tested("activateRemoteContentProviders()",res);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java
new file mode 100644
index 000000000000..2e2ddf6f4bf5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java
@@ -0,0 +1,574 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSimpleFileAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.task.XInteractionHandler;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.DateTime;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.ucb.XSimpleFileAccess</code>
+* interface methods. <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code>XSimpleFileAccess/XSimpleFileAccess.txt</code> :
+* text file of length 17 and 2000 year created .</li>
+* <li> <code>XSimpleFileAccess/XSimpleFileAccess2.txt</code> :
+* text file for <code>openFileReadWrite</code> method test.</li>
+* <ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'InteractionHandler'</code>
+* (of type <code>XInteractionHandler</code>)
+* instance of <code>com.sun.star.sdb.InteractionHandler</code>
+* </li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XSimpleFileAccess
+*/
+public class _XSimpleFileAccess extends MultiMethodTest {
+
+ public static XSimpleFileAccess oObj = null;
+
+ /**
+ * Copies <b>XSimpleFileAccess.txt</b> to a new file, checks
+ * if it was successfully copied and then deletes it. <p>
+ * Has <b> OK </b> status if after method call new copy of file
+ * exists and no exceptions were thrown. <p>
+ */
+ public void _copy() {
+ try {
+ String copiedFile = "";
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String dirnameTo = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ String filename = dirname+"XSimpleFileAccess.txt";
+ copiedFile = dirnameTo + "XSimpleFileAccess_copy.txt";
+
+ if (oObj.exists(copiedFile))
+ oObj.kill(copiedFile);
+
+ oObj.copy(filename,copiedFile);
+ tRes.tested("copy()",oObj.exists(copiedFile));
+ oObj.kill(copiedFile);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'copy()'");
+ ex.printStackTrace(log);
+ tRes.tested("copy()",false);
+ }
+
+ } //EOF copy()
+
+ /**
+ * Copies <b>XSimpleFileAccess.txt</b> to a new file, tries to
+ * rename it, then checks
+ * if it was successfully renamed and then deletes it. <p>
+ * Has <b> OK </b> status if after method call new file
+ * exists and no exceptions were thrown. <p>
+ */
+ public void _move() {
+ try {
+ String copiedFile = "";
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String dirnameTo = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ String filename = dirname+"XSimpleFileAccess.txt";
+ copiedFile = dirnameTo + "XSimpleFileAccess_copy.txt";
+
+ if (oObj.exists(copiedFile))
+ oObj.kill(copiedFile);
+
+ oObj.copy(filename,copiedFile);
+ filename = copiedFile;
+ copiedFile = dirnameTo + "XSimpleFileAccess_move.txt";
+ oObj.move(filename,copiedFile);
+ tRes.tested("move()",oObj.exists(copiedFile));
+ oObj.kill(copiedFile);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'move()'");
+ ex.printStackTrace(log);
+ tRes.tested("move()",false);
+ }
+
+ } //EOF move()
+
+ /**
+ * Copies <b>XSimpleFileAccess.txt</b> to a new file, deletes it
+ * and checks if it isn't exist. <p>
+ * Has <b> OK </b> status if after method call new copy of file
+ * doesn't exist and no exceptions were thrown. <p>
+ */
+ public void _kill() {
+ try {
+ String copiedFile = "";
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String dirnameTo = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ String filename = dirname+"XSimpleFileAccess.txt";
+ copiedFile = dirnameTo + "XSimpleFileAccess_copy.txt";
+
+ if (oObj.exists(copiedFile))
+ oObj.kill(copiedFile);
+
+ oObj.copy(filename,copiedFile);
+ oObj.kill(copiedFile);
+ tRes.tested("kill()",!oObj.exists(copiedFile));
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'kill()'");
+ ex.printStackTrace(log);
+ tRes.tested("kill()",false);
+ }
+
+ } //EOF kill()
+
+ /**
+ * Tries to check if <b>XSimpleFileAccess</b> is folder. <p>
+ * Has <b>OK</b> status if the method returns <code>true</code>
+ */
+ public void _isFolder() {
+ try {
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ tRes.tested("isFolder()",oObj.isFolder(dirname));
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'isFolder()'");
+ ex.printStackTrace(log);
+ tRes.tested("isFolder()",false);
+ }
+
+ } //EOF isFolder()
+
+ /**
+ * Copies <b>XSimpleFileAccess.txt</b> to a new file, sets
+ * 'READONLY' attribute and checks it. Second clears 'READONLY'
+ * attribute and checks it again. The copy of file is deleted
+ * finally.<p>
+ *
+ * Has <b> OK </b> status if in the first case method returns
+ * <code></code>, and in the second case - <code>false</code>
+ * and no exceptions were thrown. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setReadOnly </code> </li>
+ * </ul>
+ */
+ public void _isReadOnly() {
+ requiredMethod("setReadOnly()");
+ try {
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String filename = dirname+"XSimpleFileAccess.txt";
+ boolean result = true;
+
+ String dirnameTo = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ String readonlyCopy = dirnameTo + "XSimpleFileAccess_copy.txt" ;
+
+ if (oObj.exists(readonlyCopy))
+ oObj.kill(readonlyCopy);
+
+ oObj.copy(filename, readonlyCopy);
+
+ oObj.setReadOnly(readonlyCopy, true);
+ result &= oObj.isReadOnly(readonlyCopy);
+ oObj.setReadOnly(readonlyCopy, false);
+ result &= !oObj.isReadOnly(readonlyCopy);
+
+ oObj.kill(readonlyCopy);
+ tRes.tested("isReadOnly()",result);
+ } catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'isReadOnly()'");
+ ex.printStackTrace(log);
+ tRes.tested("isReadOnly()",false);
+ }
+
+ } //EOF isReadOnly()
+
+
+ /**
+ * Copies <b>XSimpleFileAccess.txt</b> to a new file, sets
+ * 'READONLY' attribute and checks it. Second clears 'READONLY'
+ * attribute and checks it again. The copy of file is deleted
+ * finally.<p>
+ *
+ * Has <b> OK </b> status if in the first case method returns
+ * <code></code>, and in the second case - <code>false</code>
+ * and no exceptions were thrown. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setReadOnly </code> </li>
+ * </ul>
+ */
+ public void _setReadOnly() {
+ boolean result = true ;
+
+ try {
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String filename = dirname+"XSimpleFileAccess.txt";
+
+ String dirnameTo = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ String readonlyCopy = dirnameTo + "XSimpleFileAccess_copy.txt" ;
+
+ if (oObj.exists(readonlyCopy))
+ oObj.kill(readonlyCopy);
+
+ oObj.copy(filename, readonlyCopy);
+
+ oObj.setReadOnly(readonlyCopy, true);
+ result &= oObj.isReadOnly(readonlyCopy) ;
+ oObj.setReadOnly(readonlyCopy, false);
+ result &= !oObj.isReadOnly(readonlyCopy) ;
+ tRes.tested("setReadOnly()", result);
+
+ oObj.kill(readonlyCopy);
+ }
+ catch (Exception ex) {
+ log.println("Exception occured while testing 'setReadOnly()'");
+ ex.printStackTrace(log);
+ tRes.tested("setReadOnly()",false);
+ }
+ } //EOF setReadOnly()
+
+ /**
+ * Creates folder and then checks if it was successfully created. <p>
+ * Has <b>OK</b> status if folder was created and no exceptions
+ * were thrown.
+ */
+ public void _createFolder() {
+ try {
+ String tmpdirname = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ String newFolder = tmpdirname+"SimpleSubFolder";
+
+ if (oObj.exists(newFolder))
+ oObj.kill(newFolder);
+
+ oObj.createFolder(newFolder);
+ tRes.tested("createFolder()",oObj.isFolder(newFolder));
+ oObj.kill(newFolder);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'createFolder()'");
+ ex.printStackTrace(log);
+ tRes.tested("createFolder()",false);
+ }
+
+ } //EOF createFolder()
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <b>XSimpleFileAccess.txt</b>
+ * file tested.<p>
+ * Has <b> OK </b> status if the method returns <code>17</code>
+ * and no exceptions were thrown. <p>
+ */
+ public void _getSize() {
+ try {
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String filename = dirname+"XSimpleFileAccess.txt";
+ int fSize = oObj.getSize(filename);
+ tRes.tested("getSize()", fSize == 17 );
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'getSize()'");
+ ex.printStackTrace(log);
+ tRes.tested("getSize()",false);
+ }
+
+ } //EOF getSize()
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <b>XSimpleFileAccess.txt</b>
+ * file tested.<p>
+ * Has <b> OK </b> status if the method returns String
+ * <code>'application/vnd.sun.staroffice.fsys-file'</code>
+ * and no exceptions were thrown. <p>
+ */
+ public void _getContentType() {
+ try {
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String filename = dirname+"XSimpleFileAccess.txt";
+ String fType = oObj.getContentType(filename);
+ tRes.tested("getContentType()",
+ "application/vnd.sun.staroffice.fsys-file".equals(fType) );
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'getContentType()'");
+ ex.printStackTrace(log);
+ tRes.tested("getContentType()",false);
+ }
+
+ } //EOF getContentType()
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <b>XSimpleFileAccess.txt</b>
+ * file tested.<p>
+ * Has <b> OK </b> status if the method returns date with
+ * 2001 year and no exceptions were thrown. <p>
+ */
+ public void _getDateTimeModified() {
+ try {
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String filename = dirname+"XSimpleFileAccess.txt";
+ DateTime fTime = oObj.getDateTimeModified(filename);
+
+ java.io.File the_file = new java.io.File(filename);
+ long lastModified = the_file.lastModified();
+ java.util.Date lastMod = new java.util.Date(lastModified);
+
+ //compare the dates gained by java with those gained by this method
+ boolean res = true;
+ boolean partResult = (fTime.Day == lastMod.getDay());
+ if (!partResult) {
+ log.println("Wrong Day");
+ log.println("Expected: "+lastMod.getDay());
+ log.println("Gained: "+fTime.Day);
+ log.println("------------------------------");
+ }
+ partResult = (fTime.Month == lastMod.getMonth());
+ if (!partResult) {
+ log.println("Wrong Month");
+ log.println("Expected: "+lastMod.getMonth());
+ log.println("Gained: "+fTime.Month);
+ log.println("------------------------------");
+ }
+
+ partResult = (fTime.Year == lastMod.getYear());
+ if (!partResult) {
+ log.println("Wrong Year");
+ log.println("Expected: "+lastMod.getYear());
+ log.println("Gained: "+fTime.Year);
+ log.println("------------------------------");
+ }
+
+ tRes.tested("getDateTimeModified()", res);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'getDateTimeModified()'");
+ ex.printStackTrace(log);
+ tRes.tested("getDateTimeModified()",false);
+ }
+
+ } //EOF getDateTimeModified()
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <b>XSimpleFileAccess</b>
+ * directory used.<p>
+ * Has <b> OK </b> status if the method returns non zero length
+ * array and no exceptions were thrown. <p>
+ */
+ public void _getFolderContents() {
+ try {
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String[] cont = oObj.getFolderContents(dirname,false);
+ tRes.tested("getFolderContents()", cont.length>0);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'getFolderContents()'");
+ ex.printStackTrace(log);
+ tRes.tested("getFolderContents()",false);
+ }
+
+ } //EOF getFolderContents()
+
+ /**
+ * First it check file <b>XSimpleFileAccess.txt</b> for
+ * existence, second file <b>I_do_not_exists.txt</b> is checked
+ * for existence. <p>
+ * Has <b> OK </b> status if in the first case method returns
+ * <code>true</code> and in the second - <code>flase</code>
+ * and no exceptions were thrown. <p>
+ */
+ public void _exists() {
+ try {
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String filename = dirname+"XSimpleFileAccess.txt";
+ String wrongname = dirname+"I_do_not_exists.txt";
+ tRes.tested("exists()",
+ oObj.exists(filename) && !oObj.exists(wrongname));
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'exists()'");
+ ex.printStackTrace(log);
+ tRes.tested("exists()",false);
+ }
+
+ } //EOF exists()
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <b>XSimpleFileAccess.txt</b>
+ * file used.<p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value and no exceptions were thrown. <p>
+ */
+ public void _openFileRead() {
+ try {
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String filename = dirname+"XSimpleFileAccess.txt";
+ com.sun.star.io.XInputStream iStream = oObj.openFileRead(filename);
+ tRes.tested("openFileRead()", iStream != null);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'openFileRead()'");
+ ex.printStackTrace(log);
+ tRes.tested("openFileRead()",false);
+ }
+
+ } //EOF openFileRead()
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <b>XSimpleFileAccess.txt</b>
+ * file used.<p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value and no exceptions were thrown. <p>
+ */
+ public void _openFileWrite() {
+ try {
+ String tmpdirname = util.utils.getOfficeTemp(tParam.getMSF()) ;
+
+ String copiedFile = tmpdirname+"XSimpleFileAccess_openWrite.txt";
+
+ if (oObj.exists(copiedFile))
+ oObj.kill(copiedFile);
+
+ com.sun.star.io.XOutputStream oStream =
+ oObj.openFileWrite(copiedFile);
+ tRes.tested("openFileWrite()", oStream != null);
+
+ oStream.closeOutput();
+ oObj.kill(copiedFile);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'openFileWrite()'");
+ ex.printStackTrace(log);
+ tRes.tested("openFileWrite()",false);
+ }
+
+ } //EOF openFileWrite()
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <b>XSimpleFileAccess2.txt</b>
+ * file used.<p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value and no exceptions were thrown. <p>
+ */
+ public void _openFileReadWrite() {
+ try {
+ String dirnameTo = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ String copiedFile = dirnameTo + "XSimpleFileAccess2.txt" ;
+
+ if (oObj.exists(copiedFile))
+ oObj.kill(copiedFile);
+
+ com.sun.star.io.XStream aStream =
+ oObj.openFileReadWrite(copiedFile);
+ tRes.tested("openFileReadWrite()", aStream != null);
+
+ aStream.getInputStream().closeInput();
+ aStream.getOutputStream().closeOutput();
+
+ oObj.kill(copiedFile);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'openFileReadWrite()'");
+ ex.printStackTrace(log);
+ tRes.tested("openFileReadWrite()",false);
+ }
+
+ } //EOF openFileReadWrite()
+
+ /**
+ * Test calls the method and checks that no exceptions were thrown.
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _setInteractionHandler() {
+ XInteractionHandler handler = null;
+ Object oHandler = tEnv.getObjRelation("InteractionHandler");;
+
+ if (oHandler == null)
+ throw new StatusException
+ (Status.failed("Reelation InteractionHandler not found"));
+
+ try {
+ handler = (XInteractionHandler)UnoRuntime.queryInterface
+ (XInteractionHandler.class, oHandler);
+ oObj.setInteractionHandler(handler);
+ tRes.tested("setInteractionHandler()", true);
+ } catch (Exception ex) {
+ log.println("Exception occured while testing 'setInteractionHandler()'");
+ ex.printStackTrace(log);
+ tRes.tested("setInteractionHandler()", false);
+ }
+
+ } //EOF setInteractionHandler()
+
+} // finish class _XSimpleFileAccess
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java
new file mode 100644
index 000000000000..dfafb6672cbe
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSimpleFileAccess2.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+import com.sun.star.io.XInputStream;
+import com.sun.star.ucb.XSimpleFileAccess2;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ucb.XSimpleFileAccess2</code>
+* interface methods. <p>
+* @see com.sun.star.ucb.XSimpleFileAccess2
+*/
+public class _XSimpleFileAccess2 extends MultiMethodTest {
+
+ public static XSimpleFileAccess2 oObj = null;
+
+ /**
+ * Writes <b>XSimpleFileAccess_new.txt</b> to disk, checks
+ * if it was successfully created and then deletes it. <p>
+ * Has <b> OK </b> status if after method call the file
+ * exists and no exceptions were thrown. <p>
+ */
+ public void _writeFile() {
+ boolean result = true;
+ try {
+ String dirnameTo = util.utils.getOfficeTemp(tParam.getMSF()) ;
+ String fileURL = dirnameTo + "XSimpleFileAccess_new.txt";
+ String dirname = util.utils.getFullTestURL("XSimpleFileAccess");
+ String filename = dirname+"XSimpleFileAccess.txt";
+ XInputStream iStream = oObj.openFileRead(filename);
+ oObj.writeFile(fileURL,iStream);
+ shortWait();
+ result = oObj.exists(fileURL);
+ oObj.kill(fileURL);
+ tRes.tested("writeFile()",result);
+ }
+ catch (com.sun.star.ucb.CommandAbortedException ex) {
+ log.println("CommandAbortedException occured while testing "+
+ "'writeFile()'");
+ ex.printStackTrace(log);
+ tRes.tested("writeFile()",false);
+ }
+ catch (com.sun.star.uno.Exception ex) {
+ log.println("Exception occured while testing 'writeFile()'");
+ ex.printStackTrace(log);
+ tRes.tested("writeFile()",false);
+ }
+
+ } //EOF writeFile()
+
+ /**
+ * Sleeps for 1 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 _XSimpleFileAccess
+
diff --git a/qadevOOo/tests/java/ifc/ucb/_XSortedDynamicResultSetFactory.java b/qadevOOo/tests/java/ifc/ucb/_XSortedDynamicResultSetFactory.java
new file mode 100644
index 000000000000..8dde798a12c7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ucb/_XSortedDynamicResultSetFactory.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSortedDynamicResultSetFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ucb;
+
+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.ucb.XSortedDynamicResultSetFactory;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ucb.XSortedDynamicResultSetFactory</code>
+* interface methods :
+* <ul>
+* <li><code> createSortedDynamicResultSet()</code></li>
+* </ul> <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code>solibrary.jar</code> : is used to retrieve
+* content of its root directory.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ucb.XSortedDynamicResultSetFactory
+*/
+public class _XSortedDynamicResultSetFactory extends MultiMethodTest {
+
+ /**
+ * Conatins the tested object.
+ */
+ public XSortedDynamicResultSetFactory oObj;
+
+ /**
+ * Creates sorted dynamic result set from result set. For this
+ * a dynamic result set is to be created. It is created by
+ * retrieving content list from JAR archive.
+ * Has <b>OK</b> status if numbers of rows are equal and they are
+ * greater then 0 (because JAR file contains at least one entry).
+ */
+ public void _createSortedDynamicResultSet() {
+ boolean result = true ;
+
+ XMultiServiceFactory xMSF = tParam.getMSF();
+ 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("solibrary.jar") ;
+ 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 = (XDynamicResultSet) cmdProc.execute(cmd, 0, null) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ }
+
+ XDynamicResultSet sortedSet = oObj.createSortedDynamicResultSet
+ (dynResSet, new NumberedSortingInfo[0], null) ;
+
+ int rowCount = -1 ;
+ if (sortedSet != null) {
+ XResultSet set = null ;
+ try {
+ set = sortedSet.getStaticResultSet() ;
+ } catch (com.sun.star.ucb.ListenerAlreadySetException e) {
+ e.printStackTrace(log);
+ }
+
+ try {
+ set.last() ;
+ rowCount = set.getRow();
+ log.println("Number of rows in result set: " + rowCount);
+ } catch (com.sun.star.sdbc.SQLException e) {
+ log.println("Exception occured while accessing "+
+ "sorted result set :");
+ e.printStackTrace(log);
+ }
+ } else {
+ log.println("Null returned !!!");
+ result &= false ;
+ }
+
+ result &= rowCount > 0 ;
+
+ tRes.tested("createSortedDynamicResultSet()", result) ;
+ }
+
+
+}
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_FilePicker.java b/qadevOOo/tests/java/ifc/ui/dialogs/_FilePicker.java
new file mode 100644
index 000000000000..1fc6c761aac8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_FilePicker.java
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * $RCSfile: _FilePicker.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import lib.MultiPropertyTest;
+
+public class _FilePicker extends MultiPropertyTest {
+
+
+} // EOF Calendar
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java
new file mode 100644
index 000000000000..1100d0919680
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XControlAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.ui.dialogs.*;
+import lib.*;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.ui.XFilePicker</code>
+* interface methods :
+* <ul>
+* <li><code> setControlProperty()</code></li>
+* <li><code> getControlProperty()</code></li>
+* </ul> <p>
+*
+* For testing this interface the component must implement
+* <code>com.sun.star.ui.dialogs.XControlInformation</code>
+* interface. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFolderPicker
+*/
+public class _XControlAccess extends MultiMethodTest {
+
+ public XControlAccess oObj = null;
+ private XControlInformation xCI = null ;
+ private String[] supControls = null ;
+ private String[][] supProperties = null ;
+
+ /**
+ * Tries to query <code>com.sun.star.ui.dialogs.XControlInformation</code>
+ * interface, and obtain properties' names of each available
+ * control. <p>
+ *
+ * @throw StatusException if interface is not supported or
+ * properties couldn't be get.
+ */
+ protected void before() {
+ xCI = (XControlInformation) UnoRuntime.queryInterface
+ (XControlInformation.class, oObj);
+
+ if (xCI == null) throw new StatusException
+ (Status.failed("XControlInformation not supported")) ;
+
+ supControls = xCI.getSupportedControls();
+ supProperties = new String[supControls.length][];
+ for (int i = 0; i < supControls.length; i++) {
+ try {
+ supProperties[i] =
+ xCI.getSupportedControlProperties(supControls[i]);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException
+ ("Exception while init.", e) ;
+ }
+ }
+ }
+
+ /**
+ * Tries to change each property of each control.
+ * Has <b>OK</b> status if values are properly changed.
+ */
+ public void _setControlProperty() {
+ boolean result = true ;
+ String error = "";
+
+ for (int i = 0; i < supControls.length; i++) {
+ log.println("Checking properties for control " + supControls[i]);
+ for (int j = 0; j < supProperties[i].length; j++) {
+ log.println("\t" + supProperties[i][j]);
+ try {
+ Object oldVal = oObj.getControlProperty(supControls[i],
+ supProperties[i][j]);
+ Object newVal = util.ValueChanger.changePValue(oldVal);
+ if (supProperties[i][j].startsWith("Help")) {
+ newVal = "HID:133";
+ }
+ oObj.setControlProperty
+ (supControls[i], supProperties[i][j], newVal) ;
+ Object resVal = oObj.getControlProperty(supControls[i],
+ supProperties[i][j]);
+ log.println("\t Old:" + oldVal + ",New:" + newVal
+ + ",Result:" + resVal);
+ if (!util.ValueComparer.equalValue(newVal, resVal)) {
+ error += "####Property '"+supProperties[i][j]+
+ " of "+supControls[i]+" didn't work\n\r"+
+ "\t Old:" + oldVal + ",New:" + newVal
+ + ",Result:" + resVal+ "\n\r";
+ }
+ result &= util.ValueComparer.equalValue(newVal, resVal);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Unexpected exception:" );
+ e.printStackTrace(log);
+ result = false ;
+ }
+ }
+ }
+
+ log.println(error);
+
+ tRes.tested("setControlProperty()", result) ;
+ tRes.tested("getControlProperty()", result) ;
+ }
+
+ /**
+ * Does nothing. Testing performed in <code>setControlProperty</code>
+ * method test.
+ */
+ public void _getControlProperty() {}
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XControlInformation.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlInformation.java
new file mode 100644
index 000000000000..d298b7a41d51
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlInformation.java
@@ -0,0 +1,225 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XControlInformation.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.ui.dialogs.XControlInformation;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ui.XControlInformation</code>
+* interface methods :
+* <ul>
+* <li><code> getSupportedControls()</code></li>
+* <li><code> isControlSupported()</code></li>
+* <li><code> getSupportedControlProperties()</code></li>
+* <li><code> isControlPropertySupported()</code></li>
+* </ul> <p>
+*
+* @see com.sun.star.ui.XFolderPicker
+*/
+public class _XControlInformation extends MultiMethodTest {
+
+ public XControlInformation oObj = null;
+ private String[] supControls = null ;
+ private String[][] supProperties = null ;
+
+ /**
+ * Gets supported controls and stores them. <p>
+ * Has <b>OK</b> status if not <code>null</code> returned.
+ */
+ public void _getSupportedControls() {
+ supControls = oObj.getSupportedControls();
+
+ tRes.tested("getSupportedControls()", supControls != null) ;
+ }
+
+ /**
+ * For every available control check if it is supported.
+ * Also wrong control name (non-existant and empty) are checked.<p>
+ *
+ * Has <b>OK</b> status if <code>true</code> returned for valid
+ * control names and <code>false</code> for invalid.<p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSupportedControls </code> to have
+ * valid control names</li>
+ * </ul>
+ */
+ public void _isControlSupported() {
+ requiredMethod("getSupportedControls()") ;
+
+ boolean result = true ;
+
+ log.println("Supported controls :");
+ for (int i = 0; i < supControls.length; i++) {
+ log.println(" " + supControls[i]);
+ result &= oObj.isControlSupported(supControls[i]) ;
+ }
+
+ result &= !oObj.isControlSupported("SuchNameMustNotExist");
+ result &= !oObj.isControlSupported("");
+
+ tRes.tested("isControlSupported()", result) ;
+ }
+
+ /**
+ * For each control obtains its properties and stores them. Then tries to
+ * obtain properties for control with invalid name. <p>
+ *
+ * Has <b>OK</b> status if properties arrays are not null and exception
+ * thrown or null returned for control with invalid name <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSupportedControls </code> to have
+ * valid control names</li>
+ * </ul>
+ */
+ public void _getSupportedControlProperties() {
+ requiredMethod("getSupportedControls()") ;
+
+ boolean result = true;
+
+ supProperties = new String[supControls.length][];
+ for (int i = 0; i < supControls.length; i++) {
+ log.println("Getting proeprties for control: " + supControls[i]);
+ try {
+ supProperties[i] =
+ oObj.getSupportedControlProperties(supControls[i]);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Unexpected exception:" + e);
+ result = false ;
+ }
+ result &= supProperties[i] != null;
+ }
+
+ try {
+ Object prop = oObj.getSupportedControlProperties("NoSuchControl") ;
+ result &= prop == null;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Expected exception getting properties " +
+ "for wrong control:" + e);
+ }
+
+ tRes.tested("getSupportedControlProperties()", true) ;
+ }
+
+ /**
+ * <ul>
+ * <li>For each property of each control checks if it is supported.</li>
+ * <li>For each control checks if non-existent property
+ * (with wrong name and with empty name) supported.</li>
+ * <li>Tries to check the property of non-existent control </li>
+ * </ul>
+ * <p>
+ * Has <b>OK</b> status if <code>true</code> returned for the first case,
+ * <code>false</code> for the second, and <code>false</code> or exception
+ * for the third.<p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSupportedControlProperties </code> to have a set of
+ * valid properties </li>
+ * </ul>
+ */
+ public void _isControlPropertySupported() {
+ requiredMethod("getSupportedControlProperties()") ;
+
+ boolean result = true;
+
+ for (int i = 0; i < supControls.length; i++) {
+ log.println("Checking proeprties for control " + supControls[i]);
+ for (int j = 0; j < supProperties[i].length; j++) {
+ log.println(" " + supProperties[i][j]);
+ try {
+ result &= oObj.isControlPropertySupported
+ (supControls[i], supProperties[i][j]) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Unexpected exception:" + e);
+ result = false ;
+ }
+ }
+
+ try {
+ result &= !oObj.isControlPropertySupported
+ (supControls[i], "NoSuchPropertyForThisControl") ;
+ result &= !oObj.isControlPropertySupported
+ (supControls[i], "") ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println
+ ("Unexpected exception (just false must be returned):" + e);
+ result = false ;
+ }
+ }
+
+ try {
+ result &= !oObj.isControlPropertySupported("NoSuchControl", "") ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Expected exception: " + e);
+ }
+
+ tRes.tested("isControlPropertySupported()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java
new file mode 100644
index 000000000000..4f8616c82af8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XExecutableDialog.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.ui.dialogs.XExecutableDialog;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.XCancellable;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.ui.dialogs.XExecutableDialog</code>
+ * interface methods :
+ * <ul>
+ * <li><code> setTitle()</code></li>
+ * <li><code> execute()</code></li>
+ * </ul> <p>
+ *
+ * This interface methods cann't be checked, thereby methods
+ * are just called. <code>execute</code> method is not called
+ * at all as the dialog shown cann't be disposed. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.ui.dialogs.XExecutableDialog
+ */
+public class _XExecutableDialog extends MultiMethodTest {
+
+ public XExecutableDialog oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _setTitle() {
+ oObj.setTitle("The Title");
+ tRes.tested("setTitle()",true);
+ }
+
+ /**
+ * This method is excluded from automated test since
+ * we can't close the dialog. <p>
+ * Always has <b>OK</b> status.
+ */
+ public void _execute() {
+ String aName = tEnv.getTestCase().getObjectName();
+ boolean result = false;
+ if (aName.startsWith("OData") || aName.startsWith("OSQL")) {
+ log.println("dbaccess dialogs can't be closed via API");
+ log.println("therefore they aren't executed");
+ log.println("and the result is set to true");
+ result = true;
+ } else {
+ ExecThread eThread = new ExecThread(oObj);
+ log.println("Starting Dialog");
+ eThread.start();
+ XCancellable canc = (XCancellable)UnoRuntime.queryInterface
+ (XCancellable.class, tEnv.getTestObject());
+ shortWait();
+ if (canc != null) {
+ log.println("Cancelling Dialog");
+ canc.cancel();
+ shortWait();
+ short res = eThread.execRes;
+ log.println("result: "+res);
+ result = (res == 0);
+ } else {
+ tEnv.dispose();
+ result=true;
+ log.println("XCancellable isn't supported and the "+
+ "environment is killed hard");
+ }
+
+
+ }
+ tRes.tested("execute()",result);
+ }
+
+ /**
+ * Calls <code>execute()</code> method in a separate thread.
+ * Necessary to check if this method works
+ */
+ protected class ExecThread extends Thread {
+
+ public short execRes = (short) 17 ;
+ private XExecutableDialog Diag = null ;
+
+ public ExecThread(XExecutableDialog Diag) {
+ this.Diag = Diag ;
+ }
+
+ public void run() {
+ execRes = Diag.execute();
+ System.out.println("HERE: "+execRes);
+ }
+ }
+
+ /**
+ * 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/ifc/ui/dialogs/_XFilePicker.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePicker.java
new file mode 100644
index 000000000000..a7e0145b6db3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePicker.java
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFilePicker.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.ui.dialogs.XFilePicker;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ui.XFilePicker</code>
+* interface methods :
+* <ul>
+* <li><code> setMultiSelectionMode()</code></li>
+* <li><code> setDefaultName()</code></li>
+* <li><code> setDisplayDirectory()</code></li>
+* <li><code> getDisplayDirectory()</code></li>
+* <li><code> getPath()</code></li>
+* </ul> <p>
+* The following predefined files needed to complete the test:
+* <ul>
+* <li> <code>'space-metal.jpg'</code> : just to exist. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFolderPicker
+*/
+public class _XFilePicker extends MultiMethodTest {
+
+ public XFilePicker oObj = null;
+ private String dir = null ;
+ private String fname = "space-metal.jpg" ;
+
+ /**
+ * Sets the current directory to the test document directory. <p>
+ * Has <b>OK</b> status if no exceptions occured.
+ */
+ public void _setDisplayDirectory() {
+ boolean result = true ;
+ dir = util.utils.getFullTestURL("") ;
+
+ log.println("Trying to set dir '" + dir + "'") ;
+ try {
+ oObj.setDisplayDirectory(dir) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Directory '" + dir + "' not found :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("setDisplayDirectory()", result) ;
+ }
+
+ /**
+ * Gets the current directory. <p>
+ * Has <b>OK</b> status if get value is equal to set value
+ * passed to <code>setDisplayDirectory</code> <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setDisplayDirectory </code> </li>
+ * </ul>
+ */
+ public void _getDisplayDirectory() {
+ requiredMethod("setDisplayDirectory()") ;
+
+ String gDir = oObj.getDisplayDirectory() ;
+
+ log.println("Get dir '" + gDir + "'") ;
+
+ tRes.tested("getDisplayDirectory()", dir.equals(gDir)) ;
+ }
+
+ /**
+ * Sets default name to file name existing in test document
+ * directory ('space-metal.jpg'). <p>
+ * Has <b>OK</b> status if no exceptions occured.
+ */
+ public void _setDefaultName() {
+ boolean result = true ;
+
+ try {
+ oObj.setDefaultName(fname) ;
+ } catch (Exception e) {
+ log.println("Exception setting default name :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("setDefaultName()", result) ;
+ }
+
+ /**
+ * Just switch object to MultiSelectionMode. There is no ways
+ * to check this method (only interactively). <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _setMultiSelectionMode() {
+
+ oObj.setMultiSelectionMode(true) ;
+
+ tRes.tested("setMultiSelectionMode()", true) ;
+ }
+
+ /**
+ * Gets completed path from dialog. If <code>execute()</code>
+ * method was not called then zero length array is returned.
+ * So to check actual functionality of this method interactive
+ * testing is required. <p>
+ * Has <b>OK</b> status if zero length array returned (this
+ * occurs if <code>execute()</code>
+ * method was not called yet) or if array contains at least one
+ * element and it equals to <code>[Directory set] +
+ * [Default file name set]</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setDisplayDirectory </code> </li>
+ * <li> <code> setDefaultName </code> </li>
+ * </ul>
+ */
+ public void _getFiles() {
+ requiredMethod("setDisplayDirectory()");
+ requiredMethod("setDefaultName()");
+
+ String[] files = oObj.getFiles();
+
+ if (files.length > 0) {
+ log.println("Path get : '" + files[0] + "'") ;
+
+ tRes.tested("getFiles()", (dir + fname).equals(files[0])) ;
+ } else {
+ log.println("No files were selected or execute() method was not called.") ;
+
+ tRes.tested("getFiles()", true);
+ }
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerControlAccess.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerControlAccess.java
new file mode 100644
index 000000000000..7636efe72aec
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerControlAccess.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFilePickerControlAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.ui.dialogs.XFilePickerControlAccess;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.ValueChanger;
+import util.ValueComparer;
+
+/**
+* Testing <code>com.sun.star.ui.XFilePickerControlAccess</code>
+* interface methods :
+* <ul>
+* <li><code> setValue()</code></li>
+* <li><code> getValue()</code></li>
+* <li><code> setLabel()</code></li>
+* <li><code> getLabel()</code></li>
+* <li><code> getFocused()</code></li>
+* <li><code> enableControl()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XFilePickerControlAccess.ControlID'</code> (of type
+* <code>Short</code>) : control identifier in the extended
+* FilePicker dialog. </li>
+* <li> <code>'XFilePickerControlAccess.ControlValue'</code> (of type
+* <code>Object</code>) <b>optional</b> (but mostly desireable
+* since the control has emtpy initial value):
+* the value which can set for the control . </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFilePickerControlAccess
+*/
+public class _XFilePickerControlAccess extends MultiMethodTest {
+
+ public XFilePickerControlAccess oObj = null;
+ private short cntlID = -1 ;
+ private Object oldVal = null ;
+ private String oldLab = null ;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ Short ID = (Short) tEnv.getObjRelation
+ ("XFilePickerControlAccess.ControlID") ;
+ if (ID == null) {
+ log.println("!!! Relation not found !!!") ;
+ throw new StatusException(Status.failed("Relation not found")) ;
+ }
+
+ cntlID = ID.shortValue() ;
+ }
+
+ /**
+ * Gets the value of the control and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getValue() {
+ boolean result = true ;
+
+ try {
+ oldVal = oObj.getValue(cntlID,(short)0);
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("getValue()", true) ;
+ }
+
+ /**
+ * Changes the value gotten by <code>getValue</code> method,
+ * or gets the value from relation if it exits.
+ * Sets this value and then check if it was properly set. <p>
+ * Has <b>OK</b> status if <code>getValue</code> method returns
+ * the same value which was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getValue </code> </li>
+ * </ul>
+ */
+ public void _setValue() {
+ requiredMethod("getValue()") ;
+ boolean result = true ;
+
+ Object newVal = tEnv.getObjRelation
+ ("XFilePickerControlAccess.ControlValue");
+ if (newVal == null) {
+ newVal = ValueChanger.changePValue(oldVal) ;
+ }
+
+ Object getVal = null ;
+
+ try {
+ oObj.setValue(cntlID, (short)0 , newVal) ;
+ getVal = oObj.getValue(cntlID,(short)0) ;
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ result &= ValueComparer.equalValue(newVal, getVal) ;
+
+ tRes.tested("setValue()", result) ;
+ }
+
+ /**
+ * Gets the label of the control and stores it. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _getLabel() {
+ boolean result = true ;
+
+ try {
+ oldLab = oObj.getLabel(cntlID);
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("getLabel()", oldLab != null) ;
+ }
+
+ /**
+ * Changes the label gotten by <code>getLabel</code> method,
+ * set this label and then check if it was properly set. <p>
+ * Has <b>OK</b> status if <code>getLael</code> method returns
+ * the same value which was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLabel </code> </li>
+ * </ul>
+ */
+ public void _setLabel() {
+ requiredMethod("getLabel()") ;
+ boolean result = true ;
+
+ String newVal = oldLab + "_" ;
+ String getVal = null ;
+
+ try {
+ oObj.setLabel(cntlID, newVal) ;
+ getVal = oObj.getLabel(cntlID) ;
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ result &= newVal.equals(getVal) ;
+
+ tRes.tested("setLabel()", result) ;
+ }
+
+ /**
+ * Disables and then enables the control. Can be checked only
+ * interactively. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _enableControl() {
+ boolean result = true ;
+
+ try {
+ oObj.enableControl(cntlID, false) ;
+ oObj.enableControl(cntlID, true) ;
+ } catch (Exception e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+
+ tRes.tested("enableControl()", result) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java
new file mode 100644
index 000000000000..fa1fde37922d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java
@@ -0,0 +1,264 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFilePickerNotifier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.ui.dialogs.FilePickerEvent;
+import com.sun.star.ui.dialogs.XExecutableDialog;
+import com.sun.star.ui.dialogs.XFilePicker;
+import com.sun.star.ui.dialogs.XFilePickerListener;
+import com.sun.star.ui.dialogs.XFilePickerNotifier;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.XCancellable;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+
+/**
+* Testing <code>com.sun.star.ui.XFilePickerNotifier</code>
+* interface methods :
+* <ul>
+* <li><code> addFilePickerListener()</code></li>
+* <li><code> removeFilePickerListener()</code></li>
+* </ul> <p>
+* The object must implement <code>XFilePicker</code>
+* interface to check if a listener was called. <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFilePickerNotifier
+*/
+public class _XFilePickerNotifier extends MultiMethodTest {
+
+ public XFilePickerNotifier oObj = null;
+ private XFilePicker fps = null ;
+ private String dir1 = null,
+ dir2 = null ;
+ ExecThread eThread = null;
+
+
+ public void after() {
+ XCancellable canc = (XCancellable) UnoRuntime.queryInterface(
+ XCancellable.class, tEnv.getTestObject());
+ shortWait();
+ if (canc != null) {
+ log.println("Cancelling Dialog");
+ canc.cancel();
+ } else {
+ tEnv.dispose();
+ }
+ }
+
+ /**
+ * Listener implementation which sets a flag if some of its
+ * methods was called.
+ */
+ protected class TestListener implements XFilePickerListener {
+ public boolean called = false ;
+
+ public void dialogSizeChanged() {
+ called = true;
+ }
+
+ public void fileSelectionChanged(FilePickerEvent e) {
+ called = true;
+ }
+
+ public void directoryChanged(FilePickerEvent e) {
+ log.println("***** Directory Changed *****");
+ called = true;
+ }
+
+ public String helpRequested(FilePickerEvent e) {
+ called = true;
+ return "help";
+ }
+
+ public void controlStateChanged(FilePickerEvent e) {
+ called = true;
+ }
+
+ public void disposing(EventObject e) {}
+ }
+
+ TestListener listener = new TestListener() ;
+
+ /**
+ * Tries to query object for <code>XFilePicker</code> interface, and
+ * initializes two different URLs for changing file picker directory. <p>
+ * @throw StatusException If object doesn't support <code>XFilePicker</code>
+ * interface.
+ */
+ public void before() {
+ fps = (XFilePicker) UnoRuntime.queryInterface
+ (XFilePicker.class, oObj) ;
+
+ if (fps == null) {
+ log.println("The object doesnt implement XFilePicker") ;
+ throw new StatusException(Status.failed
+ ("The object doesnt implement XFilePicker"));
+ }
+
+ dir1 = util.utils.getOfficeTemp(tParam.getMSF());
+ dir2 = util.utils.getFullTestURL("");
+
+ XExecutableDialog exD = (XExecutableDialog) UnoRuntime.queryInterface(
+ XExecutableDialog.class, tEnv.getTestObject());
+ eThread = new ExecThread(exD);
+ log.println("Starting Dialog");
+ eThread.start();
+ }
+
+ /**
+ * Adds a listener, then tries to change display directory and
+ * checks if the listener was called. <p>
+ * Has <b>OK</b> status if a listener method was called.
+ */
+ public void _addFilePickerListener() {
+ oObj.addFilePickerListener(listener) ;
+
+ try {
+ log.println("***** Setting DisplayDirectory to " + dir1);
+ fps.setDisplayDirectory(dir1) ;
+ log.println("***** Getting: " + fps.getDisplayDirectory());
+ log.println("***** Setting DisplayDirectory to " + dir2);
+ fps.setDisplayDirectory(dir2) ;
+ log.println("***** Getting: " + fps.getDisplayDirectory());
+
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("!!! Exception changing dir !!!") ;
+ e.printStackTrace(log) ;
+ }
+
+ try {
+ Thread.sleep(1000) ;
+ } catch(InterruptedException e) {}
+
+ if (!listener.called) {
+ log.println("Listener wasn't called :-(");
+ }
+
+ tRes.tested("addFilePickerListener()", listener.called) ;
+ }
+
+ /**
+ * Removes the listener and changes display directory. <p>
+ * Has <b>OK</b> status if the listener wasn't called. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addFilePickerListener </code> </li>
+ * </ul>
+ */
+ public void _removeFilePickerListener() {
+ requiredMethod("addFilePickerListener()") ;
+
+ oObj.removeFilePickerListener(listener) ;
+
+ listener.called = false ;
+
+ try {
+ fps.setDisplayDirectory(dir1) ;
+ fps.setDisplayDirectory(dir2) ;
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("!!! Exception changing dir !!!") ;
+ e.printStackTrace(log) ;
+ }
+
+ try {
+ Thread.sleep(1000) ;
+ } catch(InterruptedException e) {}
+
+ tRes.tested("removeFilePickerListener()", !listener.called) ;
+ }
+
+ /**
+ * Calls <code>execute()</code> method in a separate thread.
+ * Necessary to check if this method works
+ */
+ protected class ExecThread extends Thread {
+
+ public short execRes = (short) 17 ;
+ private XExecutableDialog Diag = null ;
+
+ public ExecThread(XExecutableDialog Diag) {
+ this.Diag = Diag ;
+ }
+
+ public void run() {
+ execRes = Diag.execute();
+ System.out.println("HERE: "+execRes);
+ }
+ }
+
+ /**
+ * 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/ifc/ui/dialogs/_XFilePreview.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePreview.java
new file mode 100644
index 000000000000..11ff82462b7f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePreview.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFilePreview.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.ui.dialogs.XFilePreview;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+public class _XFilePreview extends MultiMethodTest {
+
+ public XFilePreview oObj=null;
+
+ /**
+ * _getSupportedImageFormats() gets all formats and
+ * stores them in an Array of short.<br>
+ * Is OK is the resulting Array isn't empty
+ */
+ public void _getSupportedImageFormats() {
+ short[] formats = oObj.getSupportedImageFormats();
+ tRes.tested("getSupportedImageFormats()", formats.length > 0);
+ }
+
+ /**
+ * _getTargetColorDepth() gets the color depth
+ * and stores it in an int.<br>
+ * Is OK is the resulting int isn't 1
+ */
+ public void _getTargetColorDepth() {
+ int CDepth = oObj.getTargetColorDepth();
+ tRes.tested("getTargetColorDepth()",CDepth != 1);
+ }
+
+ /**
+ * _getAvailableWidth() gets the width
+ * and stores it in an int.<br>
+ * Is OK is the resulting int isn't 1
+ */
+ public void _getAvailableWidth() {
+ int the_width = oObj.getAvailableWidth();
+ tRes.tested("getAvailableWidth()", the_width != 1);
+ }
+
+ /**
+ * _getAvailableHeight() gets the width
+ * and stores it in an int.<br>
+ * Is OK is the resulting int isn't 1
+ */
+ public void _getAvailableHeight() {
+ int the_height = oObj.getAvailableHeight();
+ tRes.tested("getAvailableHeight()", the_height != 1);
+ }
+
+ /**
+ * sets the empty image.
+ * Is OK if no exception no exceptions were thrown.
+ */
+ public void _setImage() {
+ boolean bOK = true;
+ try {
+ oObj.setImage
+ (com.sun.star.ui.dialogs.FilePreviewImageFormats.BITMAP,null);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ bOK = false;
+ throw new StatusException( "Can't set empty image", e );
+ }
+ tRes.tested("setImage()", bOK);
+ }
+
+ boolean prev_state;
+
+ /**
+ * _setShowState() sets the state
+ * to the opposite value returned by getShowState.<br>
+ * Is OK is the returned result is false or if
+ * the value that was set is equal to the value
+ * that was returned by getShowState.
+ */
+ public void _setShowState() {
+ requiredMethod("getShowState()");
+ boolean success = oObj.setShowState(!prev_state);
+ boolean res_state = oObj.getShowState();
+ tRes.tested("setShowState()", !success || res_state != prev_state);
+ }
+
+ /**
+ * _getShowState() gets the state
+ * and sets it to the opposite.<br>
+ * Is OK if no exceptions were thrown
+ */
+ public void _getShowState() {
+ prev_state = oObj.getShowState();
+ tRes.tested("getShowState()", true);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java
new file mode 100644
index 000000000000..f8d6de8b3d51
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFilterGroupManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.beans.StringPair;
+import com.sun.star.ui.dialogs.XFilterGroupManager;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ui.dialogs.XFilterGroupManager</code>
+* @see com.sun.star.ui.XFilterGroupManager
+*/
+public class _XFilterGroupManager extends MultiMethodTest {
+
+ public XFilterGroupManager oObj = null;
+
+ /**
+ * Appends a new FilterGroup (for extension 'txt'). <p>
+ * Has <b>OK</b> status if no runtime exceptions ocured.
+ */
+ public void _appendFilterGroup() {
+ boolean res = true;
+ try {
+ StringPair[] args = new StringPair[1];
+ args[0] = new StringPair();
+ args[0].First = "ApiTextFiles";
+ args[0].Second = "txt";
+ oObj.appendFilterGroup("TestFilter", args);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ res=false;
+ }
+
+ tRes.tested("appendFilterGroup()", res) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java
new file mode 100644
index 000000000000..a815696b0d17
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFilterManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.ui.dialogs.XFilterManager;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ui.XFilterManager</code>
+* interface methods :
+* <ul>
+* <li><code> appendFilter()</code></li>
+* <li><code> setCurrentFilter()</code></li>
+* <li><code> getCurrentFilter()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFilterManager
+*/
+public class _XFilterManager extends MultiMethodTest {
+
+ public XFilterManager oObj = null;
+
+ /**
+ * Appends a new filter (for extension 'txt'). <p>
+ * Has <b>OK</b> status if no runtime exceptions ocured.
+ */
+ public void _appendFilter() {
+ boolean res = true;
+ try {
+ oObj.appendFilter("TestFilter", "txt");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ res=false;
+ }
+
+ tRes.tested("appendFilter()", res) ;
+ }
+
+ /**
+ * Sets the current filter to that which was appended before.<p>
+ * Has <b>OK</b> status if no exceptions occured, else one of
+ * <code>appendFilter</code> and <code>setCurrentFilter</code>
+ * methods failed. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> appendFilter </code> </li>
+ * </ul>
+ */
+ public void _setCurrentFilter() {
+ requiredMethod("appendFilter()") ;
+ boolean result = true;
+
+ try {
+ oObj.setCurrentFilter("TestFilter") ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("setCurrentFilter() or appendFilter() failed") ;
+ result = false ;
+ }
+
+ tRes.tested("setCurrentFilter()", result) ;
+ }
+
+ /**
+ * Gets current filter name and compares it filter name set before.<p>
+ * Has <b>OK</b> status if set and get filter names are equal.<p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setCurrentFilter </code> </li>
+ * </ul>
+ */
+ public void _getCurrentFilter() {
+ requiredMethod("setCurrentFilter()") ;
+
+ String gVal = oObj.getCurrentFilter() ;
+
+ tRes.tested("getCurrentFilter()", "TestFilter".equals(gVal)) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFolderPicker.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFolderPicker.java
new file mode 100644
index 000000000000..f7fa36fa0101
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFolderPicker.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFolderPicker.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.ui.dialogs;
+
+import com.sun.star.ui.dialogs.XFolderPicker;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.ui.XFolderPicker</code>
+* interface methods :
+* <ul>
+* <li><code> setDisplayDirectory()</code></li>
+* <li><code> getDisplayDirectory()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.ui.XFolderPicker
+*/
+public class _XFolderPicker extends MultiMethodTest {
+
+ public XFolderPicker oObj = null;
+ private String dir = null ;
+
+ /**
+ * Sets the current directory to SOffice temp dir. <p>
+ * Has <b>OK</b> status if no exceptions occured.
+ */
+ public void _setDisplayDirectory() {
+ boolean result = true ;
+ dir = util.utils.getOfficeTemp(tParam.getMSF()) ;
+
+ log.println("Trying to set dir '" + dir + "'") ;
+ try {
+ oObj.setDisplayDirectory(dir) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Directory '" + dir + "' not found :" + e) ;
+ result = false ;
+ }
+
+ tRes.tested("setDisplayDirectory()", result) ;
+ }
+
+ /**
+ * Gets the current directory. <p>
+ * Has <b>OK</b> status if get value is equal to set value
+ * passed to <code>setDisplayDirectory</code> <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setDisplayDirectory </code> </li>
+ * </ul>
+ */
+ public void _getDisplayDirectory() {
+ requiredMethod("setDisplayDirectory()") ;
+
+ String gDir = oObj.getDisplayDirectory() ;
+
+ log.println("Get dir '" + gDir + "'") ;
+
+ tRes.tested("getDisplayDirectory()", dir.equals(gDir)) ;
+ }
+
+ /**
+ * Gets the directory chosen by the user. <p>
+ * Has <b>OK</b> status if get value is not NULL <p>
+ */
+ public void _getDirectory() {
+
+ String gDir = oObj.getDirectory() ;
+
+ log.println("Get dir '" + gDir + "'") ;
+
+ tRes.tested("getDirectory()", gDir != null) ;
+ }
+
+ /**
+ * Sets the Description for the dialog. <p>
+ * Has <b>OK</b> status if no error occurs <p>
+ */
+ public void _setDescription() {
+
+ oObj.setDescription("XFolderPicker") ;
+ //to visually check if the method works
+ //oObj.execute();
+ tRes.tested("setDescription()", true) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/uno/_XNamingService.java b/qadevOOo/tests/java/ifc/uno/_XNamingService.java
new file mode 100644
index 000000000000..d8a89f30bc9a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/uno/_XNamingService.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNamingService.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.uno;
+
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.XNamingService;
+import lib.MultiMethodTest;
+import lib.StatusException;
+
+
+/**
+* Testing <code>com.sun.star.uno.XNamingService</code>
+* interface methods. <p>
+* This test need the following object relations :
+* <ul>
+* <li> <code>'XNamingService.RegisterObject'</code> :
+* object to be registered.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+*/
+public class _XNamingService extends MultiMethodTest {
+
+ public static XNamingService oObj = null;
+
+ private XInterface regObject = null ;
+
+ /**
+ * Retrieves object relation.
+ * @throws StatusException If the relation not found.
+ */
+ public void before() {
+ regObject = (XInterface)
+ tEnv.getObjRelation("XNamingService.RegisterObject") ;
+ if (regObject == null)
+ throw new StatusException("Can't create object to register",
+ new NullPointerException()) ;
+ }
+
+ /**
+ * Test calls the method and checks that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ */
+ public void _registerObject() throws StatusException{
+ try {
+ oObj.registerObject("MyFactory", regObject) ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception while registering object :" + e) ;
+ tRes.tested("registerObject()", false) ;
+ return ;
+ }
+
+ tRes.tested("registerObject()", true) ;
+ }
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if the method returns the same object
+ * that was registered and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerObject </code> : to get in this test the
+ * object that was registered.</li>
+ * </ul>
+ */
+ public void _getRegisteredObject() {
+ requiredMethod("registerObject()") ;
+
+ try {
+ Object getObject = oObj.getRegisteredObject("MyFactory") ;
+
+ tRes.tested("getRegisteredObject()" ,
+ regObject.equals(getObject)) ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception calling method :" + e) ;
+ tRes.tested("getRegisteredObject()", false) ;
+ return ;
+ }
+ }
+
+ /**
+ * Test calls the method and trying to get revoked object. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and if the method <code>getRegisteredObject</code> returns NULL or
+ * throws expected exception. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> registerObject </code> : to revoke the object registered</li>
+ * </ul>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getRegisteredObject </code> : before object will be
+ * revoked </li>
+ * </ul>
+ */
+ public void _revokeObject() {
+ requiredMethod("registerObject()") ;
+ executeMethod("getRegisteredObject()") ;
+
+ try {
+ oObj.revokeObject("MyFactory");
+ log.println("Object was revoked");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Exception revoking object :" + e) ;
+ tRes.tested("revokeObject()", false) ;
+ }
+
+ boolean res = true;
+
+ try {
+ log.println("Trying to getRegistered object ...");
+ Object objregObj = oObj.getRegisteredObject("MyFactory");
+ log.println("No exception");
+ res &= objregObj == null;
+ if (res) {
+ log.println("But NULL was returned");
+ }
+ } catch(com.sun.star.uno.Exception e) {
+ log.println("Expected exception - OK");
+ }
+
+ tRes.tested("revokeObject()", res);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/util/_PathSettings.java b/qadevOOo/tests/java/ifc/util/_PathSettings.java
new file mode 100644
index 000000000000..43d87f043394
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_PathSettings.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * $RCSfile: _PathSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import lib.MultiPropertyTest;
+import lib.MultiPropertyTest$PropertyTester;
+import util.utils;
+
+/**
+ * Testing <code>com.sun.star.util.PathSettings</code>
+ * service properties :
+ * <ul>
+ * <li><code> Addin </code></li>
+ * <li><code> AutoCorrect </code></li>
+ * <li><code> AutoText </code></li>
+ * <li><code> Backup </code></li>
+ * <li><code> Basic </code></li>
+ * <li><code> Bitmap </code></li>
+ * <li><code> Config </code></li>
+ * <li><code> Dictionary </code></li>
+ * <li><code> Favorites </code></li>
+ * <li><code> Filter </code></li>
+ * <li><code> Gallery </code></li>
+ * <li><code> Graphic </code></li>
+ * <li><code> Help </code></li>
+ * <li><code> Linguistic </code></li>
+ * <li><code> Module </code></li>
+ * <li><code> Palette </code></li>
+ * <li><code> Plugin </code></li>
+ * <li><code> Storage </code></li>
+ * <li><code> Temp </code></li>
+ * <li><code> Template </code></li>
+ * <li><code> UIConfig </code></li>
+ * <li><code> UserConfig </code></li>
+ * <li><code> UserDictionary</code></li>
+ * <li><code> Work </code></li>
+ * </ul> <p>
+ *
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.util.PathSettings
+ */
+public class _PathSettings extends MultiPropertyTest {
+
+ /**
+ * This path list could be empty after SO installation.
+ * And the URL is validated to match the pattern 'file:///*'
+ * thats why the custom changing of this property required.
+ */
+ public void _UIConfig() {
+ testProperty("UIConfig", new PropertyTester() {
+ public Object getNewValue(String propName, Object oldVal) {
+ String path = (String) oldVal;
+ if (path == null) path = "";
+ if (path.length() > 0 && !path.endsWith(";")) {
+ path += ";";
+ }
+ path += utils.getOfficeTemp(tParam.getMSF());
+ return path;
+ }
+ });
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/util/_SearchDescriptor.java b/qadevOOo/tests/java/ifc/util/_SearchDescriptor.java
new file mode 100644
index 000000000000..47c9125780b2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_SearchDescriptor.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * $RCSfile: _SearchDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import lib.MultiPropertyTest;
+
+/**
+ * Testing <code>com.sun.star.util.SearchDescriptor</code>
+ * service properties :
+ * <ul>
+ * <li><code> SearchBackwards</code></li>
+ * <li><code> SearchCaseSensitive</code></li>
+ * <li><code> SearchWords</code></li>
+ * <li><code> SearchRegularExpression</code></li>
+ * <li><code> SearchStyles</code></li>
+ * <li><code> SearchSimilarity</code></li>
+ * <li><code> SearchSimilarityRelax</code></li>
+ * <li><code> SearchSimilarityRemove</code></li>
+ * <li><code> SearchSimilarityAdd</code></li>
+ * <li><code> SearchSimilarityExchange</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.util.SearchDescriptor
+ */
+public class _SearchDescriptor extends MultiPropertyTest {
+
+} //finish class _SearchDescriptor
+
diff --git a/qadevOOo/tests/java/ifc/util/_XCancellable.java b/qadevOOo/tests/java/ifc/util/_XCancellable.java
new file mode 100644
index 000000000000..71314ee4950f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XCancellable.java
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCancellable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XCancellable;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.util.XCancellable</code>
+* interface methods :
+* <ul>
+* <li><code> cancel()</code></li>
+* </ul> <p>
+* @see com.sun.star.util.XCancellable
+*/
+public class _XCancellable extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XCancellable oObj = null ;
+
+ /**
+ * Just calls the method. <p>
+ * Has <b>OK</b> status if no exception has occured. <p>
+ */
+ public void _cancel() {
+ oObj.cancel() ;
+
+ tRes.tested("cancel()", true) ;
+ }
+
+ /**
+ * Forces object recreation.
+ */
+ public void after() {
+ //disposeEnvironment() ;
+ }
+
+} // finish class _XCancellable
+
diff --git a/qadevOOo/tests/java/ifc/util/_XCloneable.java b/qadevOOo/tests/java/ifc/util/_XCloneable.java
new file mode 100644
index 000000000000..f2c87a991ca0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XCloneable.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XCloneable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XCloneable;
+import lib.MultiMethodTest;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XTypeProvider;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Testing <code>com.sun.star.util.XCloneable</code>
+* interface methods :
+* <ul>
+* <li><code> createClone()</code></li>
+* </ul> <p>
+* @see com.sun.star.util.XCloneable
+*/
+public class _XCloneable extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XCloneable oObj = null ;
+ protected XCloneable clone = null;
+
+ /**
+ * calls the method. <p>
+ * Has <b>OK</b> status if no exception has occured. <p>
+ */
+ public void _createClone() {
+ boolean result = true;
+ clone = oObj.createClone();
+
+ //check if the implementaionname equals
+ result &= checkImplementationName(oObj,clone);
+
+ //check ImplementationID
+ result &= checkImplementationID(oObj, clone);
+
+ tRes.tested("createClone()", result) ;
+ }
+
+ protected byte[] getImplementationID(XInterface ifc) {
+ byte[] res = new byte[0];
+ XTypeProvider provider = (XTypeProvider)
+ UnoRuntime.queryInterface(XTypeProvider.class, ifc);
+ if (provider != null) {
+ res = provider.getImplementationId();
+ }
+ return res;
+ }
+
+ protected boolean checkImplementationID(XInterface org, XInterface clone) {
+ boolean res = getImplementationID(org).equals(
+ getImplementationID(clone));
+ if (res && getImplementationID(org).length > 0) {
+ log.println("ImplementationID equals the clone has the same id as the original Object");
+ log.println("------------------------------------------------------------------------");
+ }
+ return !res;
+ }
+
+ protected String getImplementationName(XInterface ifc) {
+ String res = "";
+ XServiceInfo info = (XServiceInfo)
+ UnoRuntime.queryInterface(XServiceInfo.class, ifc);
+ if (info != null) {
+ res = info.getImplementationName();
+ }
+ return res;
+ }
+
+ protected boolean checkImplementationName(XInterface org, XInterface clone) {
+ boolean res = getImplementationName(org).equals(
+ getImplementationName(clone));
+ if (!res) {
+ log.println("ImplementationName differs: ");
+ log.println("Expected: "+getImplementationName(org));
+ log.println("Gained: "+getImplementationName(clone));
+ log.println("----------------------------------------");
+ }
+ return res;
+ }
+
+} // finish class _XCloneable
+
diff --git a/qadevOOo/tests/java/ifc/util/_XFlushable.java b/qadevOOo/tests/java/ifc/util/_XFlushable.java
new file mode 100644
index 000000000000..92268d78833a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XFlushable.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XFlushable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XFlushListener;
+import com.sun.star.util.XFlushable;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.util.XFlushable</code>
+ * interface methods :
+ * <ul>
+ * <li><code> flush()</code></li>
+ * <li><code> addFlushListener()</code></li>
+ * <li><code> removeFlushListener()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.util.XFlushable
+ */
+public class _XFlushable extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XFlushable oObj = null ;
+
+ /**
+ * Simple <code>XFlushListener</code> implementation which
+ * just registers if any calls to its methods were made.
+ */
+ private class MyFlushListener implements XFlushListener{
+ boolean called = false ;
+ public void flushed(com.sun.star.lang.EventObject e) {
+ called = true ;
+ }
+ public void disposing(com.sun.star.lang.EventObject e) {}
+ public void reset() { called = false; }
+ public boolean wasFlushed() { return called; }
+ }
+
+ private MyFlushListener listener1 = new MyFlushListener(),
+ listener2 = new MyFlushListener() ;
+
+ /**
+ * Test call method <code>flush</code> and checks if added listener
+ * was called and removed one wasn't. <p>
+ * Has OK status if no exception has occured. <p>
+ * Methods to be executed before :
+ * {@link #_addFlushListener},
+ * {@link #_removeFlushListener}
+ */
+ public void _flush() {
+ executeMethod("addFlushListener()") ;
+ executeMethod("removeFlushListener()") ;
+
+ oObj.flush() ;
+
+ tRes.tested("flush()", true) ;
+ tRes.tested("addFlushListener()", listener2.wasFlushed()) ;
+ tRes.tested("removeFlushListener()", !listener1.wasFlushed()) ;
+ }
+
+ /**
+ * Test adds two listeners, one of which will be removed then.<p>
+ * Has OK status if the listener was called on <code>flush()</code>
+ * method call.
+ */
+ public void _addFlushListener() {
+ oObj.addFlushListener(listener1) ;
+ oObj.addFlushListener(listener2) ;
+ }
+
+ /**
+ * Test removes one of two listeners added before. <p>
+ * Has OK status if the listener removed wasn't called on
+ * <code>flush()</code> method call.
+ * Methods to be executed before :
+ * {@link #_addFlushListener},
+ */
+ public void _removeFlushListener() {
+ executeMethod("addFlushListener()") ;
+
+ oObj.removeFlushListener(listener1) ;
+ }
+
+} // finish class _XFlushable
+
diff --git a/qadevOOo/tests/java/ifc/util/_XIndent.java b/qadevOOo/tests/java/ifc/util/_XIndent.java
new file mode 100644
index 000000000000..5feba7e08cdb
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XIndent.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XIndent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$$
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XIndent;
+import com.sun.star.beans.XPropertySet;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+* Testing <code>com.sun.star.util.XCancellable</code>
+* interface methods :
+* <ul>
+* <li><code> decrementIndent()</code></li>
+* <li><code> incrementIndent()</code></li>
+* </ul> <p>
+* @see com.sun.star.util.XIndent
+*/
+public class _XIndent extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XIndent oObj = null ;
+
+ protected XPropertySet PropSet = null;
+
+ /**
+ * Ensures that the ObjRelation PropSet is given.
+ */
+ public void before() {
+ PropSet = (XPropertySet) tEnv.getObjRelation("PropSet");
+ if (PropSet == null) {
+ throw new StatusException(Status.failed("No PropertySet given"));
+ }
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the property 'ParaIndent' is incremented afterwards<p>
+ */
+ public void _incrementIndent() {
+ int oldValue = getIndent();
+ oObj.incrementIndent();
+ int newValue = getIndent();
+ tRes.tested("incrementIndent()", oldValue < newValue) ;
+ }
+
+ /**
+ * Calls the method. <p>
+ * Has <b>OK</b> status if the property 'ParaIndent' is decremented afterwards<p>
+ * requires 'incrementIndent()' to be executed first.
+ */
+ public void _decrementIndent() {
+ requiredMethod("incrementIndent()");
+ int oldValue = getIndent();
+ oObj.decrementIndent();
+ int newValue = getIndent();
+ tRes.tested("decrementIndent()", oldValue > newValue) ;
+ }
+
+ public short getIndent() {
+ short ret = 0;
+ try {
+ ret = ((Short) PropSet.getPropertyValue("ParaIndent")).shortValue();
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ }
+ return ret;
+ }
+
+} // finish class _XCancellable
+
diff --git a/qadevOOo/tests/java/ifc/util/_XMergeable.java b/qadevOOo/tests/java/ifc/util/_XMergeable.java
new file mode 100644
index 000000000000..0f05081b98fe
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XMergeable.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XMergeable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XMergeable;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.util.XMergeable</code>
+ * interface methods :
+ * <ul>
+ * <li><code> merge()</code></li>
+ * <li><code> getIsMerged()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.util.XMergeable
+ */
+public class _XMergeable extends MultiMethodTest {
+
+ public XMergeable oObj = null; // oObj filled by MultiMethodTest
+
+ /**
+ * Checks the property <code>IsMerged</code> and sets it
+ * to the opposite value. <p>
+ * Has <b> OK </b> status if the property value has changed. <p>
+ */
+ public void _getIsMerged () {
+
+ boolean isMerged = oObj.getIsMerged();
+ oObj.merge(!isMerged);
+ tRes.tested("getIsMerged()", isMerged != oObj.getIsMerged());
+ }
+
+ /**
+ * Checks the property <code>IsMerged</code> and sets it
+ * to the opposite value. <p>
+ * Has <b> OK </b> status if the property value has changed. <p>
+ */
+ public void _merge () {
+
+ boolean isMerged = oObj.getIsMerged();
+ oObj.merge(!isMerged);
+ tRes.tested("merge()", isMerged != oObj.getIsMerged());
+ }
+} // finisch class _XMergeable
+
+
diff --git a/qadevOOo/tests/java/ifc/util/_XModeSelector.java b/qadevOOo/tests/java/ifc/util/_XModeSelector.java
new file mode 100644
index 000000000000..d56d52f3ae8e
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XModeSelector.java
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XModeSelector.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XModeSelector;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.util.XModeSelector</code>
+* interface methods :
+* <ul>
+* <li><code>setMode()</code></li>
+* <li><code>getMode()</code></li>
+* <li><code>getSupportedModes()</code></li>
+* <li><code>supportsMode()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.util.XModeSelector
+*/
+public class _XModeSelector extends MultiMethodTest {
+ public XModeSelector oObj = null;
+
+ String[] supportedModes;
+ /**
+ * Calls the method and as argument pass one of the supported modes
+ * that was returned by method getSupportedMode.<p>
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _setMode() {
+ requiredMethod("getSupportedModes()");
+ try {
+ oObj.setMode(supportedModes[0]);
+ } catch(com.sun.star.lang.NoSupportException e) {
+ log.println("Method setMode() doesn't support mode '"
+ + supportedModes[0] + "'");
+ tRes.tested("setMode()", false);
+ return ;
+ }
+ tRes.tested("setMode()", true);
+ }
+
+ /**
+ * Calls the method and check returned value.<p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is equal to value that was set by method setMode.
+ */
+ public void _getMode() {
+ requiredMethod("setMode()");
+ String curMode = oObj.getMode();
+ tRes.tested("getMode()", curMode.equals(supportedModes[0]));
+ }
+
+ /**
+ * Calls the method and checks value returned by method.<p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ * and returned value is not null.
+ */
+ public void _getSupportedModes() {
+ supportedModes = oObj.getSupportedModes();
+ tRes.tested("getSupportedModes()", supportedModes != null);
+ }
+
+ /**
+ * Calls the method. First one of the supported modes that was returned
+ * by method getSupportedMode is passed as argument.
+ * Then the method is called again and the mode that is certainly not supported
+ * is passed. Checks up returned values in both cases.<p>
+ * Has <b> OK </b> status if no runtime exceptions occured,
+ * returned value is true in first call and is false in second call.
+ */
+ public void _supportsMode() {
+ requiredMethod("getSupportedModes()");
+ boolean result = oObj.supportsMode(supportedModes[0]) &&
+ ! oObj.supportsMode(supportedModes[0] + "_ForTest");
+ tRes.tested("supportsMode()", result);
+ }
+}// finish class _XModeSelector
+
diff --git a/qadevOOo/tests/java/ifc/util/_XModifyBroadcaster.java b/qadevOOo/tests/java/ifc/util/_XModifyBroadcaster.java
new file mode 100644
index 000000000000..a67d86e25003
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XModifyBroadcaster.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XModifyBroadcaster.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.lang.EventObject;
+import com.sun.star.util.XModifyBroadcaster;
+import com.sun.star.util.XModifyListener;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.util.XModifyBroadcaster</code>
+* interface methods :
+* <ul>
+* <li><code>addModifyListener()</code></li>
+* <li><code>removeModifyListener()</code></li>
+* </ul> <p>
+*
+* Result checking is not performed. Modify
+* listeners are called only in case of
+* interaction with UI. <p>
+*
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.util.XModifyBroadcaster
+*/
+public class _XModifyBroadcaster extends MultiMethodTest {
+ public XModifyBroadcaster oObj = null;
+
+ boolean modified = false;
+
+ protected class TestModifyListener implements XModifyListener {
+ public void disposing ( EventObject oEvent ) {}
+ public void modified (EventObject aEvent ) {
+ modified = true;
+ }
+ }
+
+ private TestModifyListener listener = new TestModifyListener();
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _addModifyListener() {
+ log.println("'Modified' events are called only in case"+
+ " of user interaction.");
+ oObj.addModifyListener(listener);
+ tRes.tested("addModifyListener()", true);
+ }
+
+ /**
+ * Just calls the method. <p>
+ * Has <b> OK </b> status if no runtime exceptions occured
+ */
+ public void _removeModifyListener() {
+ requiredMethod("addModifyListener()");
+ oObj.removeModifyListener(listener);
+ tRes.tested("removeModifyListener()", true);
+ }
+}// finish class _XModifyBroadcaster
+
diff --git a/qadevOOo/tests/java/ifc/util/_XNumberFormatsSupplier.java b/qadevOOo/tests/java/ifc/util/_XNumberFormatsSupplier.java
new file mode 100644
index 000000000000..c5014bc4a391
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XNumberFormatsSupplier.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XNumberFormatsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.util.XNumberFormats;
+import com.sun.star.util.XNumberFormatsSupplier;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.util.XNumberFormatsSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getNumberFormatSettings()</code></li>
+ * <li><code> getNumberFormats()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.util.XNumberFormatsSupplier
+ */
+public class _XNumberFormatsSupplier extends MultiMethodTest {
+
+ public XNumberFormatsSupplier oObj = null;
+
+ /**
+ * Get format settings and checks some properties for existence. <p>
+ *
+ * Has <b> OK </b> status if a number properties inherent to
+ * <code>NumberFormatSettings</code> service exist in the
+ * returned <code>XPropertySet</code>. <p>
+ *
+ * @see com.sun.star.util.NumberFormatSettings
+ */
+ public void _getNumberFormatSettings() {
+ boolean result = true ;
+ XPropertySet props = oObj.getNumberFormatSettings();
+
+ if (props != null) {
+ try {
+ result &= props.getPropertyValue("NullDate") != null &&
+ props.getPropertyValue("StandardDecimals") != null &&
+ props.getPropertyValue("NoZero") != null &&
+ props.getPropertyValue("TwoDigitDateStart") != null ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Some property doesn't exist") ;
+ e.printStackTrace(log) ;
+ result = false ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log) ;
+ result = false ;
+ }
+ } else {
+ log.println("Method returns null") ;
+ result = false ;
+ }
+
+ tRes.tested("getNumberFormatSettings()", result) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getNumberFormats() {
+ XNumberFormats formats = oObj.getNumberFormats();
+
+ tRes.tested("getNumberFormats()", formats != null) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/util/_XRefreshable.java b/qadevOOo/tests/java/ifc/util/_XRefreshable.java
new file mode 100644
index 000000000000..d1c2f41618a7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XRefreshable.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XRefreshable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XRefreshListener;
+import com.sun.star.util.XRefreshable;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.util.XRefreshable</code>
+* interface methods :
+* <ul>
+* <li><code> refresh()</code></li>
+* <li><code> addRefreshListener()</code></li>
+* <li><code> removeRefreshListener()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.util.XRefreshable
+*/
+public class _XRefreshable extends MultiMethodTest {
+
+ public XRefreshable oObj = null;
+
+ final boolean listenerCalled[] = new boolean[1];
+
+
+ /**
+ * <code>XRefreshListener</code> implementation which
+ * sets a flag when <code>refreshed</code> method is
+ * called.
+ */
+ public class MyRefreshListener implements XRefreshListener {
+ public void refreshed (com.sun.star.lang.EventObject e) {
+ listenerCalled[0] = true;
+ }
+
+ public void disposing (com.sun.star.lang.EventObject obj) {}
+ }
+
+ XRefreshListener listener = new MyRefreshListener();
+
+ /**
+ * Just adds a listener. <p>
+ * Always has <b>OK</b> status.
+ */
+ public void _addRefreshListener() {
+
+ oObj.addRefreshListener(listener) ;
+ tRes.tested("addRefreshListener()", true);
+ }
+
+ /**
+ * Calls the method and checks if the listener was called. <p>
+ * Has <b>OK</b> status if listener's flag is set after call.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addRefreshListener </code> : to have a listener added.</li>
+ * </ul>
+ */
+ public void _refresh() {
+
+ requiredMethod("addRefreshListener()");
+
+ oObj.refresh();
+
+ tRes.tested("refresh()", listenerCalled[0]);
+ if (!listenerCalled[0])
+ log.println("RefreshListener wasn't called after refresh");
+
+ }
+
+ /**
+ * Removes the listener added before and calls <code>refresh</code>
+ * method. Listener must not be called. <p>
+ * Has <b>OK</b> status if listener's flag isn't changed.
+ * <ul>
+ * <li> <code> refresh </code> : listener added must be already
+ * tested.</li>
+ * </ul>
+ */
+ public void _removeRefreshListener() {
+ requiredMethod("refresh()");
+ listenerCalled[0] = false;
+
+ oObj.removeRefreshListener(listener) ;
+ oObj.refresh();
+
+ tRes.tested("removeRefreshListener()", !listenerCalled[0]);
+ if (listenerCalled[0])
+ log.println("RefreshListener was called after removing");
+ }
+} // finish class _XRefreshable
+
diff --git a/qadevOOo/tests/java/ifc/util/_XReplaceDescriptor.java b/qadevOOo/tests/java/ifc/util/_XReplaceDescriptor.java
new file mode 100644
index 000000000000..7d632149efa5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XReplaceDescriptor.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XReplaceDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XReplaceDescriptor;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.util.XReplaceDescriptor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getReplaceString()</code></li>
+ * <li><code> setReplaceString()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.util.XReplaceDescriptor
+ */
+public class _XReplaceDescriptor extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XReplaceDescriptor oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getReplaceString(){
+ log.println("test for getReplaceString() ");
+ tRes.tested("getReplaceString()", oObj.getReplaceString()!=null);
+ }
+
+ /**
+ * Set a new string and checks the result. <p>
+ * Has <b> OK </b> status if the string before setting differs
+ * from string after setting. <p>
+ */
+ public void _setReplaceString(){
+ boolean bResult = false;
+ log.println("test for setReplaceString() ");
+ String oldReplaceStr = oObj.getReplaceString();
+ oObj.setReplaceString("XReplaceDescriptor");
+ String cmpReplaceStr = oObj.getReplaceString();
+ tRes.tested("setReplaceString()", !(cmpReplaceStr.equals(oldReplaceStr)));
+ return;
+ }
+
+} // finish class _XReplaceDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/util/_XReplaceable.java b/qadevOOo/tests/java/ifc/util/_XReplaceable.java
new file mode 100644
index 000000000000..d7a09085ed4a
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XReplaceable.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XReplaceable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XReplaceDescriptor;
+import com.sun.star.util.XReplaceable;
+import com.sun.star.util.XSearchDescriptor;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.util.XReplaceable</code>
+ * interface methods :
+ * <ul>
+ * <li><code> createReplaceDescriptor()</code></li>
+ * <li><code> replaceAll()</code></li>
+ * </ul> <p>
+ *
+ * The requipment for the tested object is that it
+ * <b>must containt</b> string 'xTextDoc'. Only
+ * in that case this interface is tested correctly. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.util.XReplaceable
+ */
+public class _XReplaceable extends MultiMethodTest {
+
+ public XReplaceable oObj = null;
+ public XReplaceDescriptor Rdesc = null;
+
+ /**
+ * Creates the descriptor for replacing string 'xTextDoc'
+ * with string '** xTextDoc'. <p>
+ * Has <b> OK </b> status if the returned descriptor is not
+ * <code>null</code>. <p>
+ */
+ public void _createReplaceDescriptor() {
+
+ log.println("testing createReplaceDescriptor() ... ");
+
+ Rdesc = oObj.createReplaceDescriptor();
+ Rdesc.setSearchString("xTextDoc");
+ Rdesc.setReplaceString("** xTextDoc");
+ tRes.tested("createReplaceDescriptor()", Rdesc != null);
+
+ }
+
+ /**
+ * Replaces the text using descriptor created before. Then
+ * search is performed in the target text. <p>
+ *
+ * Has <b> OK </b> status if the string '**' is found in
+ * the text. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createReplaceDescriptor() </code> : replace
+ * descriptor is created. </li>
+ * </ul>
+ */
+ public void _replaceAll() {
+ requiredMethod("createReplaceDescriptor()");
+ oObj.replaceAll(Rdesc);
+ XSearchDescriptor SDesc = oObj.createSearchDescriptor();
+ SDesc.setSearchString("**");
+ boolean res = (oObj.findFirst(SDesc) != null);
+ tRes.tested("replaceAll()",res);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/util/_XSearchDescriptor.java b/qadevOOo/tests/java/ifc/util/_XSearchDescriptor.java
new file mode 100644
index 000000000000..a1dd62b6e21b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XSearchDescriptor.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSearchDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.XSearchDescriptor;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.util.XSearchDescriptor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getSearchString()</code></li>
+ * <li><code> setSearchString()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.util.XSearchDescriptor
+ */
+public class _XSearchDescriptor extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XSearchDescriptor oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getSearchString(){
+ boolean bResult = false;
+ String searchStr = null;
+
+ log.println("test for getSearchString() ");
+ searchStr = oObj.getSearchString();
+
+ if (!(searchStr == null)){ bResult = true; }
+ tRes.tested("getSearchString()", bResult);
+ }
+
+ /**
+ * Set a new string and checks the result. <p>
+ * Has <b> OK </b> status if the string before setting differs
+ * from string after setting. <p>
+ */
+ public void _setSearchString(){
+ boolean bResult = false;
+ String oldSearchStr = null;
+ String cmpSearchStr = null;
+ String newSearchStr = "_XSearchDescriptor";
+ log.println("test for setSearchString() ");
+
+ oldSearchStr = oObj.getSearchString();
+ oObj.setSearchString(newSearchStr);
+ cmpSearchStr = oObj.getSearchString();
+
+ if(!(cmpSearchStr.equals(oldSearchStr))){ bResult = true; }
+ //oObj.setSearchString(oldSearchStr);
+ tRes.tested("setSearchString()", bResult);
+ }
+
+} // finish class _XSearchDescriptor
+
diff --git a/qadevOOo/tests/java/ifc/util/_XSearchable.java b/qadevOOo/tests/java/ifc/util/_XSearchable.java
new file mode 100644
index 000000000000..0ebe018742db
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XSearchable.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSearchable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.util.XSearchDescriptor;
+import com.sun.star.util.XSearchable;
+import lib.MultiMethodTest;
+
+/**
+ * Testing <code>com.sun.star.util.XSearchable</code>
+ * interface methods :
+ * <ul>
+ * <li><code> createSearchDescriptor()</code></li>
+ * <li><code> findAll()</code></li>
+ * <li><code> findFirst()</code></li>
+ * <li><code> findNext()</code></li>
+ * </ul> <p>
+ *
+ * The requipment for the tested object is that it
+ * <b>must containt</b> string 'xTextDoc'. Only
+ * in that case this interface is tested correctly. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.util.XSearchable
+ */
+public class _XSearchable extends MultiMethodTest {
+
+ public XSearchable oObj = null; // oObj filled by MultiMethodTest
+ public XSearchDescriptor Sdesc = null;
+ public Object start = null;
+
+ /**
+ * Creates the search descriptor which searches for
+ * 'xTextDoc' string. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _createSearchDescriptor() {
+
+ log.println("testing createSearchDescriptor() ... ");
+
+ Sdesc = oObj.createSearchDescriptor();
+ Sdesc.setSearchString("xTextDoc");
+ tRes.tested("createSearchDescriptor()", Sdesc != null);
+
+ }
+
+ /**
+ * Performs search using descriptor created before. <p>
+ * Has <b> OK </b> status if the method not <code>null</code>
+ * collections. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createSearchDescriptor() </code> : creates the descriptor
+ * required for search. </li>
+ * </ul>
+ */
+ public void _findAll() {
+
+ requiredMethod("createSearchDescriptor()");
+ log.println("testing findAll()");
+
+ XIndexAccess IA = oObj.findAll(Sdesc);
+ tRes.tested("findAll()", IA != null);
+ return;
+ }
+
+ /**
+ * Performs search using descriptor created before. Storing the
+ * first occurence result. <p>
+ * Has <b> OK </b> status if the method not <code>null</code>
+ * value. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createSearchDescriptor() </code> : creates the descriptor
+ * required for search. </li>
+ * </ul>
+ */
+ public void _findFirst() {
+
+ requiredMethod("createSearchDescriptor()");
+ log.println("testing findFirst()");
+ start = oObj.findFirst(Sdesc);
+ tRes.tested("findFirst()", start != null);
+ }
+
+ /**
+ * Performs search using descriptor and first search result
+ * created before. <p>
+ * Has <b> OK </b> status if the method not <code>null</code>
+ * value. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> findFirst() </code> : to have first search result. </li>
+ * </ul>
+ */
+ public void _findNext() {
+ requiredMethod("findFirst()");
+
+ log.println("testing findNext()");
+ Object xI = oObj.findNext(start,Sdesc);
+ tRes.tested("findNext()", xI != null);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/util/_XSortable.java b/qadevOOo/tests/java/ifc/util/_XSortable.java
new file mode 100644
index 000000000000..e77b7450d3dc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XSortable.java
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSortable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.util.XSortable;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+/**
+ * Testing <code>com.sun.star.util.XSortable</code>
+ * interface methods :
+ * <ul>
+ * <li><code> createSortDescriptor()</code></li>
+ * <li><code> sort()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'SORTCHECKER'</code> : <code>
+* _XSortable.XSortChecker</code> interface implementation
+ * </li>
+ * <ul><p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.util.XSortable
+ */
+public class _XSortable extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XSortable oObj = null;
+ XSortChecker checker = null;
+ PropertyValue[] oPV = null;
+
+ /**
+ * The interface for sort checking.
+ */
+ public static interface XSortChecker {
+ public void prepareToSort();
+ public boolean checkSort(boolean isSortNumbering,
+ boolean isSortAscending);
+ public void setPrintWriter(PrintWriter log);
+ }
+
+
+ protected void before() {
+ checker = (XSortChecker)tEnv.getObjRelation("SORTCHECKER");
+ if (checker == null) throw
+ new StatusException(Status.failed(
+ "Couldn't get relation 'SORTCHECKER'"));
+ checker.setPrintWriter(log);
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the length of the returned array
+ * is greater than zero. <p>
+ */
+ public void _createSortDescriptor(){
+ boolean bResult = false;
+
+ log.println("test for createSortDescriptor() ");
+ oPV = oObj.createSortDescriptor();
+
+ if( oPV.length > 0 ){bResult = true;};
+
+ log.println("Found " + oPV.length + " PropertyValues");
+ tRes.tested("createSortDescriptor()", bResult);
+ }
+
+ /**
+ * Test calls the method using descriptor created before as
+ * parameter. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> createSortDescriptor() </code> : to have a descriptor
+ * for sort. </li>
+ * </ul>
+ */
+ public void _sort(){
+ boolean bResult = false;
+
+ checker.prepareToSort();
+
+ log.println("Sort algorithm: Alphanumeric Order: Ascending");
+ modifyDescriptor(false, true);
+ oObj.sort(oPV);
+ boolean res = checker.checkSort(false, true);
+
+ log.println("Sort algorithm: Alphanumeric Order: Descending");
+ modifyDescriptor(false, false);
+ oObj.sort(oPV);
+ res = checker.checkSort(false, false);
+
+ log.println("Sort algorithm: Numeric Order: Ascending");
+ modifyDescriptor(true, true);
+ oObj.sort(oPV);
+ res = checker.checkSort(true, true);
+
+ log.println("Sort algorithm: Numeric Order: Descending");
+ modifyDescriptor(true, false);
+ oObj.sort(oPV);
+ res = checker.checkSort(true, false);
+
+ tRes.tested("sort()", res);
+ }
+
+ protected void modifyDescriptor(boolean isSortNumeric,
+ boolean isSortAscending) {
+ for(int i = 0; i < oPV.length; i++) {
+ if (oPV[i].Name.equals("IsSortAscending0")) {
+ oPV[i].Value = new Boolean( isSortAscending );
+ }
+ if (oPV[i].Name.equals("IsSortNumeric0")) {
+ oPV[i].Value = new Boolean( isSortNumeric );
+ }
+ if (oPV[i].Name.equals("SortColumns")) {
+ oPV[i].Value = new Boolean( false );
+ }
+ }
+ }
+} // finish class _XSortable
+
diff --git a/qadevOOo/tests/java/ifc/util/_XTextSearch.java b/qadevOOo/tests/java/ifc/util/_XTextSearch.java
new file mode 100644
index 000000000000..91379708fdb1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XTextSearch.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XTextSearch.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.SearchAlgorithms;
+import com.sun.star.util.SearchFlags;
+import com.sun.star.util.SearchOptions;
+import com.sun.star.util.SearchResult;
+import com.sun.star.util.XTextSearch;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.util.XTextSearch</code>
+* interface methods :
+* <ul>
+* <li><code> setOptions()</code></li>
+* <li><code> searchForward()</code></li>
+* <li><code> searchBackward()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.util.XTextSearch
+*/
+public class _XTextSearch extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+ public XTextSearch oObj = null ;
+
+ protected final String str = "acababaabcababadcdaa" ;
+ protected final int startPos = 2 , endPos = 20 ;
+ protected final String searchStr = "(ab)*a(c|d)+" ;
+ protected final int fStartRes = 10, fEndRes = 18 ;
+ protected final int bStartRes = 18, bEndRes = 14 ;
+
+ /**
+ * Sets options for searching regular expression in a string,
+ * ignoring case. <p>
+ * Has <b>OK</b> status if no runtime exceptions occured.
+ */
+ public void _setOptions() {
+
+ SearchOptions opt = new SearchOptions() ;
+ opt.algorithmType = SearchAlgorithms.REGEXP ;
+ opt.searchFlag = SearchFlags.ALL_IGNORE_CASE ;
+ opt.searchString = searchStr ;
+
+ oObj.setOptions(opt) ;
+
+ tRes.tested("setOptions()", true) ;
+ }
+
+
+ /**
+ * Tries to find a substring matching regular expression. <p>
+ * Has <b>OK</b> if the correct substring position returned.
+ */
+ public void _searchForward() {
+ requiredMethod("setOptions()") ;
+
+ SearchResult res = oObj.searchForward(str, startPos, endPos) ;
+
+ log.println("Result of searching '" + searchStr + "' substring in \n'" +
+ str + "' string (" + res.subRegExpressions + " matches):") ;
+
+ for (int i = 0; i < res.subRegExpressions; i++)
+ log.println(" (" + res.startOffset[i] + ", " + res.endOffset[i] + ")") ;
+
+ tRes.tested("searchForward()", res.subRegExpressions > 0 &&
+ res.startOffset[0] == fStartRes && res.endOffset[0] == fEndRes) ;
+ }
+
+ /**
+ * Tries to find a substring matching regular expression walking
+ * backward. <p>
+ * Has <b>OK</b> if the correct substring position returned.
+ */
+ public void _searchBackward() {
+ requiredMethod("setOptions()") ;
+
+ SearchResult res = oObj.searchBackward(str, endPos, startPos) ;
+
+ log.println("Result of searching '" + searchStr + "' substring in \n'" +
+ str + "' string (" + res.subRegExpressions + " matches):") ;
+
+ for (int i = 0; i < res.subRegExpressions; i++)
+ log.println(" (" + res.startOffset[i] + ", " + res.endOffset[i] + ")") ;
+
+ tRes.tested("searchBackward()", res.subRegExpressions > 0 &&
+ res.startOffset[0] == bStartRes && res.endOffset[0] == bEndRes) ;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/util/_XURLTransformer.java b/qadevOOo/tests/java/ifc/util/_XURLTransformer.java
new file mode 100644
index 000000000000..7fdd6b051533
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/util/_XURLTransformer.java
@@ -0,0 +1,491 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XURLTransformer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:13:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.util;
+
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import lib.MultiMethodTest;
+
+/**
+* Testing <code>com.sun.star.util.XURLTransformer</code>
+* interface methods :
+* <ul>
+* <li><code> assemble() </code></li>
+* <li><code> parseStrict() </code></li>
+* <li><code> parseSmart() </code></li>
+* <li><code> getPresentation() </code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.util.XURLTransformer
+*/
+public class _XURLTransformer extends MultiMethodTest {
+
+ public XURLTransformer oObj = null;
+
+ URL url;
+
+ final static String user = "user";
+ final static String password = "password";
+ final static String server = "server";
+ final static String port = "8080";
+ final static String path = "/pub/path";
+ final static String name = "file.txt";
+ final static String arguments = "a=b";
+ final static String mark = "mark";
+
+ final static String expectedCompleteHTTP = "http://"
+ + server + ":" + port + path
+ + "/" + name + "?" + arguments + "#" + mark;
+ final static String expectedCompleteFTP = "ftp://"
+ + user + ":" + password + "@" + server + ":" + port + path
+ + "/" + name;
+
+ /**
+ * First the complete URL (all URL fields are filled) is
+ * passed and assembled. Then incomplete URL (only
+ * <code>Server</code> field is set) is passed. <p>
+ * Has <b> OK </b> status if in the first case <code>true</code>
+ * retruned and <code>Complete</code> field is set and in the
+ * second case <code>false</code> is returned. <p>
+ */
+ public void _assemble(){
+ URL[] url = new URL[1];
+ url[0] = new URL();
+
+ url[0].Protocol = "http://";
+ url[0].Server = server;
+ url[0].Port = new Integer(port).shortValue();
+ url[0].Path = path;
+ url[0].Name = name;
+ url[0].Arguments = arguments;
+ url[0].Mark = mark;
+ url[0].Main = "http://" + server + ":" +
+ port + path + "/" + name;
+
+ boolean res = true;
+
+ log.print("assemble http-URL: ");
+ boolean complete = oObj.assemble(url);
+ log.println(complete);
+ res &= complete;
+
+ if (!expectedCompleteHTTP.equals(url[0].Complete)) {
+ log.println("assemble works wrong");
+ log.println("complete field : " + url[0].Complete);
+ log.println("expected : " + expectedCompleteHTTP);
+ res = false;
+ }
+
+ url[0] = new URL();
+ url[0].Protocol = "ftp://";
+ url[0].User = user;
+ url[0].Password = password;
+ url[0].Server = server;
+ url[0].Port = new Integer(port).shortValue();
+ url[0].Path = path;
+ url[0].Name = name;
+ url[0].Main = "ftp://" + user + ":" + password + "@" + server + ":" +
+ port + path + "/" + name;
+
+ log.print("assemble ftp-URL: ");
+ complete = oObj.assemble(url);
+ log.println(complete);
+ res &= complete;
+
+ if (!expectedCompleteFTP.equals(url[0].Complete)) {
+ log.println("assemble works wrong");
+ log.println("complete field : " + url[0].Complete);
+ log.println("expected : " + expectedCompleteFTP);
+ res = false;
+ }
+
+ URL[] incompleteUrl = new URL[1];
+ incompleteUrl[0] = new URL();
+ incompleteUrl[0].Server = server;
+
+ log.print("assemble incomplete URL: ");
+ complete = oObj.assemble(incompleteUrl);
+ log.println(complete);
+ res &= !complete;
+
+ // should be incomplete
+ tRes.tested("assemble()", res);
+ }
+
+ /**
+ * First the complete URL (<code>Complete</code> field is set
+ * to proper URL) is passed and parsed. Then incomplete URL (only
+ * <code>Server</code> field is set) is passed. <p>
+ * Has <b> OK </b> status if in the first case <code>true</code>
+ * retruned and all URL fields are set to proper values and in the
+ * second case <code>false</code> is returned. <p>
+ */
+ public void _parseStrict() {
+ URL[] url = new URL[1];
+
+ url[0] = new URL();
+ url[0].Complete = expectedCompleteHTTP;
+
+ boolean res = true;
+ log.print("parseStrict(" + expectedCompleteHTTP + "): ");
+ boolean complete = oObj.parseStrict(url);
+ log.println(complete);
+ res &= complete;
+
+ if (!url[0].Protocol.equals("http://")) {
+ log.println("parseStrict works wrong");
+ log.println("protocol field : " + url[0].Protocol);
+ log.println("expected : http://");
+ res = false;
+ }
+
+ if (!url[0].Server.equals(server)) {
+ log.println("parseStrict works wrong");
+ log.println("server field : " + url[0].Server);
+ log.println("expected : " + server);
+ res = false;
+ }
+
+ if (url[0].Port != new Integer(port).shortValue()) {
+ log.println("parseStrict works wrong");
+ log.println("port field : " + url[0].Port);
+ log.println("expected : " + port);
+ res = false;
+ }
+
+ if (!url[0].Path.equals(path)) {
+ log.println("parseStrict works wrong");
+ log.println("path field : " + url[0].Path);
+ log.println("expected : " + path);
+ res = false;
+ }
+
+ if (!url[0].Name.equals(name)) {
+ log.println("parseStrict works wrong");
+ log.println("name field : " + url[0].Name);
+ log.println("expected : " + name);
+ res = false;
+ }
+
+ if (!url[0].Arguments.equals(arguments)) {
+ log.println("parseStrict works wrong");
+ log.println("arguments field : " + url[0].Arguments);
+ log.println("expected : " + arguments);
+ res = false;
+ }
+
+ if (!url[0].Mark.equals(mark)) {
+ log.println("parseStrict works wrong");
+ log.println("mark field : " + url[0].Mark);
+ log.println("expected : " + mark);
+ res = false;
+ }
+
+ url[0] = new URL();
+ url[0].Complete = expectedCompleteFTP;
+
+ log.print("parseStrict(" + expectedCompleteFTP + "): ");
+ complete = oObj.parseStrict(url);
+ log.println(complete);
+ res &= complete;
+
+ if (!url[0].Protocol.equals("ftp://")) {
+ log.println("parseStrict works wrong");
+ log.println("protocol field : " + url[0].Protocol);
+ log.println("expected : ftp://");
+ res = false;
+ }
+
+ if (!url[0].User.equals(user)) {
+ log.println("parseStrict works wrong");
+ log.println("user field : " + url[0].User);
+ log.println("expected : " + user);
+ res = false;
+ }
+
+ if (!url[0].Password.equals(password)) {
+ log.println("parseStrict works wrong");
+ log.println("password field : " + url[0].Password);
+ log.println("expected : " + password);
+ res = false;
+ }
+
+ if (!url[0].Server.equals(server)) {
+ log.println("parseStrict works wrong");
+ log.println("server field : " + url[0].Server);
+ log.println("expected : " + server);
+ res = false;
+ }
+
+ if (url[0].Port != new Integer(port).shortValue()) {
+ log.println("parseStrict works wrong");
+ log.println("port field : " + url[0].Port);
+ log.println("expected : " + port);
+ res = false;
+ }
+
+ if (!url[0].Path.equals(path)) {
+ log.println("parseStrict works wrong");
+ log.println("path field : " + url[0].Path);
+ log.println("expected : " + path);
+ res = false;
+ }
+
+ if (!url[0].Name.equals(name)) {
+ log.println("parseStrict works wrong");
+ log.println("name field : " + url[0].Name);
+ log.println("expected : " + name);
+ res = false;
+ }
+
+ URL[] incompleteUrl = new URL[1];
+ incompleteUrl[0] = new URL();
+ incompleteUrl[0].Complete = server;
+
+ log.print("parseStrict(" + server + "): ");
+ complete = oObj.parseStrict(incompleteUrl);
+ log.println(complete);
+ // should be incomplete
+ res &= !complete;
+
+ tRes.tested("parseStrict()", res);
+ }
+
+ /**
+ * Tries to parse WWW server name. <p>
+ * Has <b> OK </b> status if the method return <code>true</code>
+ * value and <code>Protocol, Server, Port</code> URL fields are
+ * set properly.
+ */
+ public void _parseSmart() {
+ URL[] url = new URL[1];
+
+ String httpURL = server + ":" + port + path + "/" + name + "?" +
+ arguments + "#" + mark;
+
+ url[0] = new URL();
+ url[0].Complete = httpURL;
+
+ boolean res = true;
+ log.print("parseSmart('" + httpURL + "', 'http://'): ");
+ boolean complete = oObj.parseSmart(url, "http://");
+ log.println(complete);
+ res &= complete;
+
+ if (!url[0].Protocol.equals("http://")) {
+ log.println("parseSmart works wrong");
+ log.println("protocol field : " + url[0].Protocol);
+ log.println("expected : http://");
+ res = false;
+ }
+
+ if (!url[0].Server.equals(server)) {
+ log.println("parseSmart works wrong");
+ log.println("server field : " + url[0].Server);
+ log.println("expected : " + server);
+ res = false;
+ }
+
+ if (url[0].Port != new Integer(port).shortValue()) {
+ log.println("parseSmart works wrong");
+ log.println("port field : " + url[0].Port);
+ log.println("expected : " + port);
+ res = false;
+ }
+
+ if (!url[0].Path.equals(path)) {
+ log.println("parseSmart works wrong");
+ log.println("path field : " + url[0].Path);
+ log.println("expected : " + path);
+ res = false;
+ }
+
+ if (!url[0].Name.equals(name)) {
+ log.println("parseSmart works wrong");
+ log.println("name field : " + url[0].Name);
+ log.println("expected : " + name);
+ res = false;
+ }
+
+ if (!url[0].Arguments.equals(arguments)) {
+ log.println("parseSmart works wrong");
+ log.println("arguments field : " + url[0].Arguments);
+ log.println("expected : " + arguments);
+ res = false;
+ }
+
+ if (!url[0].Mark.equals(mark)) {
+ log.println("parseSmart works wrong");
+ log.println("mark field : " + url[0].Mark);
+ log.println("expected : " + mark);
+ res = false;
+ }
+
+ String ftpURL = user + ":" + password + "@" + server + ":" +
+ port + path + "/" + name;
+
+ url[0] = new URL();
+ url[0].Complete = ftpURL;
+ log.print("parseSmart('" + ftpURL + "', 'ftp://'): ");
+ complete = oObj.parseSmart(url, "ftp://");
+ log.println(complete);
+ res &= complete;
+
+ if (!url[0].Protocol.equals("ftp://")) {
+ log.println("parseSmart works wrong");
+ log.println("protocol field : " + url[0].Protocol);
+ log.println("expected : ftp://");
+ res = false;
+ }
+
+ if (!url[0].User.equals(user)) {
+ log.println("parseSmart works wrong");
+ log.println("user field : " + url[0].User);
+ log.println("expected : " + user);
+ res = false;
+ }
+
+ if (!url[0].Password.equals(password)) {
+ log.println("parseSmart works wrong");
+ log.println("password field : " + url[0].Password);
+ log.println("expected : " + password);
+ res = false;
+ }
+
+ if (!url[0].Server.equals(server)) {
+ log.println("parseSmart works wrong");
+ log.println("server field : " + url[0].Server);
+ log.println("expected : " + server);
+ res = false;
+ }
+
+ if (url[0].Port != new Integer(port).shortValue()) {
+ log.println("parseSmart works wrong");
+ log.println("port field : " + url[0].Port);
+ log.println("expected : " + port);
+ res = false;
+ }
+
+ if (!url[0].Path.equals(path)) {
+ log.println("parseSmart works wrong");
+ log.println("path field : " + url[0].Path);
+ log.println("expected : " + path);
+ res = false;
+ }
+
+ if (!url[0].Name.equals(name)) {
+ log.println("parseSmart works wrong");
+ log.println("name field : " + url[0].Name);
+ log.println("expected : " + name);
+ res = false;
+ }
+
+ tRes.tested("parseSmart()", res);
+ }
+
+ /**
+ * Gets the presentation of a URL. <p>
+ * Has <b> OK </b> status if the method returns the same
+ * URL as was passed in parameter.
+ */
+ public void _getPresentation() {
+ URL url = new URL();
+
+ url.Complete = expectedCompleteHTTP;
+
+ log.println("getPresentation('" + expectedCompleteHTTP + "', true): ");
+ String presentation = oObj.getPresentation(url, true);
+ log.println(presentation);
+ log.println("Expected presentation: " + expectedCompleteHTTP);
+ boolean res = presentation.equals(expectedCompleteHTTP);
+
+ url.Complete = expectedCompleteFTP;
+ log.println("getPresentation('" + expectedCompleteFTP + "', false): ");
+ presentation = oObj.getPresentation(url, false);
+ log.println(presentation);
+ String expectedPresentation = "ftp://" + user + "@" + server + ":" +
+ port + path + "/" + name;
+ res &= presentation.equals(expectedPresentation);
+ log.println("Expected presentation: " + expectedPresentation);
+
+ log.println("getPresentation('" + expectedCompleteFTP + "', true): ");
+ presentation = oObj.getPresentation(url, true);
+ log.println(presentation);
+ expectedPresentation = "ftp://" + user + ":" + password + "@" +
+ server + ":" + port + path + "/" + name;
+ res &= presentation.equals(expectedPresentation);
+ log.println("Expected presentation: " + expectedPresentation);
+
+ String incorrectURL = "*bla-bla*";
+ url.Complete = incorrectURL;
+ log.println("getPresentation('" + incorrectURL + "', false): ");
+ presentation = oObj.getPresentation(url, false);
+ log.println(presentation);
+ expectedPresentation = "";
+ res &= presentation.equals(expectedPresentation);
+ log.println("Expected presentation: " + expectedPresentation);
+
+ tRes.tested("getPresentation()", res);
+ }
+
+} // finish class _XURLTransformer
+
diff --git a/qadevOOo/tests/java/ifc/view/_XControlAccess.java b/qadevOOo/tests/java/ifc/view/_XControlAccess.java
new file mode 100644
index 000000000000..6a42378d0d94
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/view/_XControlAccess.java
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XControlAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.view;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.drawing.XControlShape;
+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.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.view.XControlAccess;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.FormTools;
+
+/**
+ * Testing <code>com.sun.star.view.XControlAccess</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getControl()</code></li>
+ * </ul> <p>
+ * This test needs the following object relations :
+ * <ul>
+ * <li> <code>'DOCUMENT'</code> (of type <code>XComponent</code>):
+ * the document, which controller is tested here. Is used
+ * for adding a component (such as CommandButton) and obtaining
+ * its control via tested interface. </li>
+ * <ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.view.XControlAccess
+ */
+public class _XControlAccess extends MultiMethodTest {
+
+ public XControlAccess oObj = null;
+
+ /**
+ * Retrieves a document from relation, then using it adds
+ * a CommandButton to a document and obtains button model.
+ * After that button control is tried to get using the
+ * tested interface. <p>
+ * Has <b> OK </b> status if non <code>null</code> control
+ * is returned. <p>
+ * @throws StatusException If the relation was not found.
+ */
+ public void _getControl(){
+ boolean bResult = true;
+ try {
+ XComponent oDoc = (XComponent)tEnv.getObjRelation("DOCUMENT");
+ if (oDoc == null) {
+ throw new StatusException
+ (Status.failed("NO 'DOCUMENT' ObjRelation!"));
+ }
+
+ XDrawPageSupplier oDPS = (XDrawPageSupplier)
+ UnoRuntime.queryInterface(XDrawPageSupplier.class, oDoc);
+ XDrawPage oDP = oDPS.getDrawPage();
+ XShapes shapes = (XShapes) UnoRuntime.queryInterface
+ (XShapes.class, oDP);
+ XShape button = FormTools.createControlShape
+ (oDoc, 100, 100, 10000, 50000, "CommandButton");
+ shapes.add(button);
+
+ XControlModel CM = ((XControlShape)button).getControl();
+ log.println("Getting ControlModel "
+ + ((CM == null) ? "FAILED" : "OK"));
+
+ XControl oControl = oObj.getControl(CM);
+ log.println("Getting Control " + ((CM == null) ? "FAILED" : "OK"));
+
+ bResult &= oControl != null;
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ log.println("Exception occured calling the method: " + e);
+ bResult = false;
+ }
+ tRes.tested("getControl()", bResult);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/view/_XPrintSettingsSupplier.java b/qadevOOo/tests/java/ifc/view/_XPrintSettingsSupplier.java
new file mode 100644
index 000000000000..05cb4e3104b0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/view/_XPrintSettingsSupplier.java
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPrintSettingsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.view;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.view.XPrintSettingsSupplier;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.view.XPrintSettingsSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getPrintSettings()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.view.XPrintSettingsSupplier
+ */
+public class _XPrintSettingsSupplier extends MultiMethodTest {
+
+ public XPrintSettingsSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getPrintSettings(){
+
+ XPropertySet oPSS = oObj.getPrintSettings();
+ tRes.tested("getPrintSettings()", oPSS != null);
+
+ } // finish _getPrintSettings
+
+} // finish class _XPrintSettingsSupplier
+
diff --git a/qadevOOo/tests/java/ifc/view/_XPrintable.java b/qadevOOo/tests/java/ifc/view/_XPrintable.java
new file mode 100644
index 000000000000..0b24a7105071
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/view/_XPrintable.java
@@ -0,0 +1,226 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XPrintable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.view;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.view.PaperOrientation;
+import com.sun.star.view.XPrintable;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.utils;
+
+/**
+ * Testing <code>com.sun.star.view.XPrintable</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getPrinter()</code></li>
+ * <li><code> setPrinter()</code></li>
+ * <li><code> print()</code></li>
+ * </ul> <p>
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.view.XPrintable
+ */
+public class _XPrintable extends MultiMethodTest {
+
+ public XPrintable oObj = null;
+ public PropertyValue[] the_printer = null;
+
+ /**
+ * Test calls the method and stores returned value. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getPrinter(){
+
+ the_printer = oObj.getPrinter();
+ tRes.tested("getPrinter()",the_printer != null);
+ } // finish _getPrinter
+
+ /**
+ * Changes <code>PaperOrientation</code> property in the old
+ * printer configuration and sets changed value as a new printer.<p>
+ *
+ * Has <b> OK </b> status if the <code>getPrinter</code> method
+ * retursn printer with changed property. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getPrinter() </code> : to change one property
+ * in existing printer configuration. </li>
+ * </ul>
+ */
+ public void _setPrinter(){
+ requiredMethod("getPrinter()");
+ int propIdx = 0 ;
+ while (!"PaperOrientation".equals(the_printer[propIdx].Name)) {
+ propIdx++ ;
+ }
+ PaperOrientation newVal = null ;
+ if (the_printer[propIdx].Value == PaperOrientation.PORTRAIT)
+ newVal = PaperOrientation.LANDSCAPE ;
+ else
+ newVal = PaperOrientation.PORTRAIT ;
+
+ the_printer[propIdx].Value = newVal ;
+
+ try {
+ oObj.setPrinter(the_printer);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("couldn't set printer");
+ ex.printStackTrace(log);
+ tRes.tested("setPrinter()",false);
+ }
+
+ //oObj.setPrinter(the_printer);
+ the_printer = oObj.getPrinter() ;
+
+ propIdx = 0 ;
+ while (!"PaperOrientation".equals(the_printer[propIdx].Name)) {
+ propIdx++ ;
+ }
+
+ boolean the_same = the_printer[propIdx].Value == newVal;
+ tRes.tested("setPrinter()", the_same);
+
+ } // finish _setPrinter
+
+ /**
+ * Printing performed into file in SOffice temp directory.
+ * First this file is deleted if it already exist (using
+ * <code>com.sun.star.ucb.SimpleFileAccess</code> service.
+ * After that the method with appropriate parameter is
+ * called.<p>
+ *
+ * Has <b> OK </b> status if the file to which printing is made
+ * exists. <p>
+ *
+ * @throws StatusException if service
+ * <code>com.sun.star.ucb.SimpleFileAccess</code> cann't be
+ * created.
+ */
+ public void _print(){
+ boolean result = true ;
+
+ final String file = "XPrintable.prt" ;
+ final String fileName = utils.getOfficeTempDirSys(tParam.getMSF())+file ;
+ final String fileURL = utils.getOfficeTemp(tParam.getMSF()) + file ;
+
+ XSimpleFileAccess fAcc = null ;
+ try {
+ Object oFAcc = tParam.getMSF().createInstance
+ ("com.sun.star.ucb.SimpleFileAccess") ;
+ fAcc = (XSimpleFileAccess) UnoRuntime.queryInterface
+ (XSimpleFileAccess.class, oFAcc) ;
+ if (fAcc == null) throw new StatusException
+ (Status.failed("Can't create SimpleFileAccess service")) ;
+ if (fAcc.exists(fileURL)) {
+ log.println("Old file exists and will be deleted");
+ fAcc.kill(fileURL);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error accessing file '" + fileURL + "'");
+ e.printStackTrace(log);
+ }
+
+ try {
+ PropertyValue[] PrintOptions = new PropertyValue[2];
+ PropertyValue firstProp = new PropertyValue();
+ firstProp.Name = "FileName";
+ log.println("Printing to :"+fileName);
+ firstProp.Value = fileName;
+ firstProp.State = com.sun.star.beans.PropertyState.DEFAULT_VALUE;
+ PrintOptions[0] = firstProp;
+ PrintOptions[1] = new PropertyValue();
+ PrintOptions[1].Name = "Wait";
+ PrintOptions[1].Value = new Boolean(true);
+ oObj.print(PrintOptions);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("couldn't print");
+ ex.printStackTrace(log);
+ result = false ;
+ }
+
+ java.io.File the_file = new java.io.File(fileName);
+ log.println("File "+fileName+" exists = "+the_file.exists());
+
+ try {
+ if (result) {
+ result &= fAcc.exists(fileURL) ;
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error while while checking file '" +
+ fileURL + "': ");
+ e.printStackTrace(log);
+ result = false ;
+ }
+
+ tRes.tested("print()", result) ;
+
+ } // finish _print
+
+} // finish class _XPrintable
+
+
diff --git a/qadevOOo/tests/java/ifc/view/_XScreenCursor.java b/qadevOOo/tests/java/ifc/view/_XScreenCursor.java
new file mode 100644
index 000000000000..28bb4006df05
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/view/_XScreenCursor.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XScreenCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.view;
+
+import com.sun.star.view.XScreenCursor;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.view.XScreenCursor</code>
+ * interface methods :
+ * <ul>
+ * <li><code> screenDown()</code></li>
+ * <li><code> screenUp()</code></li>
+ * </ul> <p>
+ *
+ * Uses test parameter <b><code>soapi.test.hidewindows</code></b>.
+ * Methods of this interface works with view representation,
+ * thereby their calls have no effect when document is opened
+ * in hidden mode. <p>
+ *
+ * Test is <b> NOT </b> multithread compilant. <p>
+ * @see com.sun.star.view.XScreenCursor
+ */
+public class _XScreenCursor extends MultiMethodTest {
+
+ // oObj filled by MultiMethodTest
+
+ public XScreenCursor oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value or if document is
+ * opened in hidden mode.
+ */
+ public void _screenDown(){
+ log.println("test for screenDown() ");
+ tRes.tested("screenDown()", oObj.screenDown() );
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns
+ * <code>true</code> value or if document is
+ * opened in hidden mode.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> screenDown() </code> : by default view is on the
+ * top of pag, thereby it's needed first to moved down. </li>
+ * </ul>
+ */
+ public void _screenUp(){
+ requiredMethod("screenDown()") ;
+
+ log.println("test for screenUp() ");
+ tRes.tested("screenUp()", oObj.screenUp() );
+ }
+
+} // finish class _XScreenCursor
+
diff --git a/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java b/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java
new file mode 100644
index 000000000000..817cecb3bd67
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XSelectionSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.view;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.EventObject;
+import com.sun.star.text.XTextFrame;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.view.XSelectionChangeListener;
+import com.sun.star.view.XSelectionSupplier;
+import lib.MultiMethodTest;
+import util.ValueComparer;
+import lib.StatusException;
+import lib.Status;
+import java.util.Comparator;
+
+/**
+* Testing <code>com.sun.star.view.XSelectionSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> select()</code></li>
+* <li><code> getSelection()</code></li>
+* <li><code> addSelectionChangeListener()</code></li>
+* <li><code> removeSelectionChangeListener()</code></li>
+* </ul>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Selections'</code> of type <code>Object[]</code> :
+* the array of the instances which can be selected.</li>
+* <li> <code>'Comparer'</code> of type <code>Comparator</code> :
+* the interface for comparing of selected instances</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.view.XSelectionSupplier
+*/
+public class _XSelectionSupplier extends MultiMethodTest {
+
+ public XSelectionSupplier oObj = null;
+ public boolean selectionChanged = false;
+ Object[] selections = null;
+ Comparator comparer = null;
+
+ protected void before() {
+ selections = (Object[])tEnv.getObjRelation("Selections");
+ if (selections == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'Selections'"));
+ }
+
+ comparer = (Comparator)tEnv.getObjRelation("Comparer");
+ if (comparer == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get relation 'Comparer'"));
+ }
+ }
+
+ /**
+ * Listener implementation which just set flag when listener
+ * method is called.
+ */
+ protected class MyChangeListener implements XSelectionChangeListener {
+ public void disposing ( EventObject oEvent ) {}
+ public void selectionChanged(EventObject ev) {
+ selectionChanged = true;
+ }
+
+ }
+
+ XSelectionChangeListener listener = new MyChangeListener();
+
+ /**
+ * Test adds listener to the object, then selects first and
+ * then second instances to be sure that selection was changed.<p>
+ * Has <b>OK</b> status if selection lisener was called.
+ */
+ public void _addSelectionChangeListener(){
+ boolean res = true;
+ try {
+ oObj.addSelectionChangeListener(listener);
+ oObj.select(selections[0]);
+ oObj.select(selections[1]);
+ res = selectionChanged;
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured during addSelectionChangeListener()");
+ ex.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("addSelectionChangeListener()", res);
+ }
+
+ /**
+ * Selects an instance from relation 'First'. <p>
+ * Has <b> OK </b> status if no exceptions were thrown. <p>
+ */
+ public void _select() {
+ boolean res = true;
+ boolean locRes = true;
+ int compRes = 0;
+ Object oldSelection = null;
+ try {
+ for(int i = 0; i < selections.length; i++) {
+ oldSelection = oObj.getSelection();
+ log.print("select #" + i + ": ");
+ locRes = oObj.select(selections[i]);
+ log.println(locRes);
+ Object curSelection = oObj.getSelection();
+ if (locRes) {
+ log.print("compare selected object and current selection: ");
+ compRes = comparer.compare(selections[i], curSelection);
+ log.println(compRes);
+ res &= compRes == 0;
+ } else {
+ log.print("compare previouse selection and current selection: ");
+ compRes = comparer.compare(curSelection, oldSelection);
+ log.println(compRes);
+ res &= compRes == 0;
+ }
+ }
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured during select()");
+ ex.printStackTrace(log);
+ res = false;
+ }
+
+ tRes.tested("select()", res);
+ }
+
+ /**
+ * Test removes listener, then selects first and
+ * then second instances to be sure that selection was changed.<p>
+ * Has <b>OK</b> status if selection lisener was not called.
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> addSelectionChangeListener() </code> : to have
+ * the listener added. </li>
+ * </ul>
+ */
+ public void _removeSelectionChangeListener() {
+ boolean res = false;
+ requiredMethod("addSelectionChangeListener()");
+ try {
+ selectionChanged = false;
+ oObj.removeSelectionChangeListener(listener);
+ oObj.select(selections[0]);
+ oObj.select(selections[1]);
+ res = !selectionChanged;
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured during removeSelectionChangeListener()");
+ ex.printStackTrace(log);
+ res = false;
+ }
+ tRes.tested("removeSelectionChangeListener()", res);
+ }
+
+ /**
+ * Firts test change selection of the object : if nothing is
+ * currently selected or first instance ('First' relation) is
+ * selected then selects second instance; if second instance
+ * is currently selected then the first instance is selected. <p>
+ * Then <code>getSelection</code> is called and values set and
+ * get are compared. Comparison has some special cases. For
+ * example if selection is a Cell, then the values contained
+ * in cells are compared. <p>
+ * Has <b>OK</b> status if selection changed properly.
+ */
+ public void _getSelection() {
+ requiredMethod("select()");
+ tRes.tested("getSelection()", true);
+ }
+
+
+} // finish class _XSelectionSupplier
+
+
+
diff --git a/qadevOOo/tests/java/ifc/view/_XViewSettingsSupplier.java b/qadevOOo/tests/java/ifc/view/_XViewSettingsSupplier.java
new file mode 100644
index 000000000000..93448780c9da
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/view/_XViewSettingsSupplier.java
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XViewSettingsSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.view;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.view.XViewSettingsSupplier;
+import lib.MultiMethodTest;
+
+
+/**
+ * Testing <code>com.sun.star.view.XViewSettingsSupplier</code>
+ * interface methods :
+ * <ul>
+ * <li><code> getViewSettings()</code></li>
+ * </ul> <p>
+ * Test is multithread compilant. <p>
+ * @see com.sun.star.view.XViewSettingsSupplier
+ */
+public class _XViewSettingsSupplier extends MultiMethodTest {
+
+ public XViewSettingsSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method returns not
+ * <code>null</code> value.
+ */
+ public void _getViewSettings(){
+
+ XPropertySet oTVS = oObj.getViewSettings();
+ tRes.tested("getViewSettings()", oTVS != null);
+ } // finish _getViewSettings
+
+} // finish class _XViewSettingsSupplier
+
+
diff --git a/qadevOOo/tests/java/ifc/xml/_UserDefinedAttributeSupplier.java b/qadevOOo/tests/java/ifc/xml/_UserDefinedAttributeSupplier.java
new file mode 100644
index 000000000000..ae086a4f5d0d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/xml/_UserDefinedAttributeSupplier.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * $RCSfile: _UserDefinedAttributeSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.xml;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.xml.AttributeData;
+
+public class _UserDefinedAttributeSupplier extends lib.MultiPropertyTest {
+
+ public void _UserDefinedAttributes() {
+ XNameContainer uda = null;
+ boolean res = false;
+ try {
+ uda = (XNameContainer) oObj.getPropertyValue("UserDefinedAttributes");
+ AttributeData attr = new AttributeData();
+ attr.Namespace = "http://www.sun.com/staroffice/apitest/Chartprop";
+ attr.Type="CDATA";
+ attr.Value="true";
+ uda.insertByName("Chartprop:has-first-alien-attribute",attr);
+ String[] els = uda.getElementNames();
+ oObj.setPropertyValue("UserDefinedAttributes",uda);
+ uda = (XNameContainer) oObj.getPropertyValue("UserDefinedAttributes");
+ els = uda.getElementNames();
+ Object obj = uda.getByName("Chartprop:has-first-alien-attribute");
+ res = true;
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ log.println("Don't know the Property 'UserDefinedAttributes'");
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ log.println("WrappedTargetException while getting Property 'UserDefinedAttributes'");
+ } catch (com.sun.star.container.NoSuchElementException nee) {
+ log.println("added Element isn't part of the NameContainer");
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ log.println("IllegalArgumentException while getting Property 'UserDefinedAttributes'");
+ } catch (com.sun.star.beans.PropertyVetoException pve) {
+ log.println("PropertyVetoException while getting Property 'UserDefinedAttributes'");
+ } catch (com.sun.star.container.ElementExistException eee) {
+ log.println("ElementExistException while getting Property 'UserDefinedAttributes'");
+ }
+ tRes.tested("UserDefinedAttributes",res);
+ }
+
+}
diff --git a/qadevOOo/tests/java/ifc/xml/sax/_XDocumentHandler.java b/qadevOOo/tests/java/ifc/xml/sax/_XDocumentHandler.java
new file mode 100644
index 000000000000..65a66ae5a6d6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/xml/sax/_XDocumentHandler.java
@@ -0,0 +1,437 @@
+/*************************************************************************
+ *
+ * $RCSfile: _XDocumentHandler.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package ifc.xml.sax;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.xml.sax.SAXException;
+import com.sun.star.xml.sax.XDocumentHandler;
+import com.sun.star.xml.sax.XLocator;
+import java.io.PrintWriter;
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+import util.XMLTools;
+
+/**
+* Testing <code>com.sun.star.xml.sax.XDocumentHandler</code>
+* interface methods :
+* <ul>
+* <li><code> startDocument()</code></li>
+* <li><code> endDocument()</code></li>
+* <li><code> startElement()</code></li>
+* <li><code> endElement()</code></li>
+* <li><code> characters()</code></li>
+* <li><code> ignorableWhitespace()</code></li>
+* <li><code> processingInstruction()</code></li>
+* <li><code> setDocumentLocator()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XDocumentHandler.XMLData'</code> (of type <code>String[][]
+* </code>):the XML data which will be passed to the handler. Each
+* array of strings corresponds to some handler event. The fisrt
+* string of event array is the type of the event they can have
+* the following values :
+* <ul>
+* <li>'start' : startElement() event. The string with index 1
+* is the name of element, the next array elements are attributes
+* of XML element in order Name, Type, Value, Name, Type, Value, etc.
+* </li>
+* <li>'end' : endElement() event. The string with index 1
+* is the name of element. </li>
+* <li>'chars' : characters() event. The string with index 1
+* is characters. </li>
+* <li>'spaces' : ignorableWhitespace() event. The string with index 1
+* is spaces. </li>
+* <li>'instruct' : processingInstruction() event. The string with
+* index 1 is the target of instruction. The string with index
+* 2 is the data of instruction. </li>
+* </ul> </li>
+* <li> <code>'XDocumentHandler.ImportChecker'</code>
+* (of type <code>ifc.xml.sax._XDocumentHandler.ImportChecker</code>) :
+* this relation must be implementation of the interface above
+* ant it must check if the XML data was successfully imported to
+* the document. </li>
+* </li>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.xml.sax.XDocumentHandler
+*/
+public class _XDocumentHandler extends MultiMethodTest {
+
+ private static class DocumentLocator implements XLocator {
+ public boolean aMethodCalled = false ;
+
+ private PrintWriter log = null ;
+ public DocumentLocator(PrintWriter log) {
+ this.log = log ;
+ }
+ public int getColumnNumber() {
+ log.println("getColumnNumber() method called.") ;
+ aMethodCalled = true ;
+ return 10 ;
+ }
+ public int getLineNumber() {
+ log.println("getLineNumber() method called.") ;
+ aMethodCalled = true ;
+ return 9 ;
+ }
+ public String getPublicId() {
+ log.println("getPublicId() method called.") ;
+ aMethodCalled = true ;
+ return "file://d:/file.txt";
+ }
+ public String getSystemId() {
+ log.println("getSystemId() method called.") ;
+ aMethodCalled = true ;
+ return "system";
+ }
+ }
+
+ /**
+ * This interface implementation must be passed by component test
+ * for checking the whole import process.
+ */
+ public static interface ImportChecker {
+ /**
+ * Returns <code>true</code> if the XML data was successfully
+ * imported, <code>false</code> in other case.
+ */
+ boolean checkImport() ;
+ }
+
+ public XDocumentHandler oObj = null;
+ private String[][] xmlData = null ;
+ private DocumentLocator locator = null ;
+ private ImportChecker checker = null ;
+ private boolean locatorResult = true ;
+ private SAXException locatorException = null ;
+ private boolean ToBeSkipped = false;
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public void before() {
+ locator = new DocumentLocator(log) ;
+ if (tEnv.getTestCase().getObjectName().equals("XMLSettingsImporter")) {
+ log.println("Settings can't be imported in the current Implementation");
+ ToBeSkipped = true;
+ }
+ xmlData = (String[][])tEnv.getObjRelation("XDocumentHandler.XMLData") ;
+ checker = (ImportChecker)
+ tEnv.getObjRelation("XDocumentHandler.ImportChecker") ;
+
+ if (xmlData == null || checker == null) throw new StatusException
+ (Status.failed("Relation wasn't found")) ;
+ }
+
+ /**
+ * Sets document locator to dummy locator implementation and
+ * calls the <code>startDocument</code> method. <p>
+ *
+ * Has <b> OK </b> status if no runtime exceptions occured.
+ */
+ public void _startDocument() {
+ if (ToBeSkipped) {
+ tRes.tested("startDocument()", Status.skipped(true));
+ return;
+ }
+
+ try {
+ oObj.setDocumentLocator(locator) ;
+ } catch (SAXException e) {
+ locatorException = e ;
+ locatorResult = false ;
+ }
+
+ boolean result = true ;
+ try {
+ oObj.startDocument() ;
+ } catch (SAXException e) {
+ e.printStackTrace(log) ;
+ log.println("Wrapped exception :" + e.WrappedException) ;
+ result = false ;
+ }
+
+ tRes.tested("startDocument()", result) ;
+ }
+
+ /**
+ * This test is finally executed. It finishes XML data
+ * transfering with <code>endDocument</code> method call. <p>
+ *
+ * Has <b>OK</b> status if no exceptions occured during
+ * the whole transfering and if the appropriate changes
+ * occured in the document where XML data was trnsfered to.
+ * This check is performed by checker relation.
+ */
+ public void _endDocument() {
+ if (ToBeSkipped) {
+ tRes.tested("endDocument()", Status.skipped(true));
+ return;
+ }
+ requiredMethod("startElement()") ;
+ executeMethod("endElement()") ;
+ executeMethod("characters()") ;
+ executeMethod("ignorableWhitespace()") ;
+ executeMethod("processingInstruction()") ;
+
+ boolean result = true ;
+ try {
+ oObj.endDocument() ;
+ } catch (SAXException e) {
+ e.printStackTrace(log) ;
+ log.println("Wrapped exception :" + e.WrappedException) ;
+ result = false ;
+ }
+
+ log.println("Check if import was successful ...") ;
+ result &= checker.checkImport() ;
+
+ tRes.tested("endDocument()", result) ;
+ }
+
+ /**
+ * Transfers XML data obtained from relation
+ * <code>'XDocumentHandler.XMLData'</code>. <p>
+ *
+ * Has <b>OK</b> status if no exceptions occured during XML data
+ * transfering in <code>startDocument</code> and
+ * <code>startElement</code> method tests. <p>
+ *
+ * Exact checking of XML transfer is made in <code>endDocument</code>
+ */
+ public void _startElement() {
+ if (ToBeSkipped) {
+ tRes.tested("startElement()", Status.skipped(true));
+ return;
+ }
+ boolean result = true ;
+
+ try {
+ log.println("StartElement Processing XML data ...") ;
+ for(int i = 0; i < xmlData.length; i++) {
+ String[] elem = xmlData[i] ;
+ String xmlTag = "" ;
+ if ("start".equals(elem[0])) {
+ xmlTag += "<" ;
+ String tagName = elem[1] ;
+ xmlTag += tagName ;
+ XMLTools.AttributeList attr = new XMLTools.AttributeList() ;
+ for (int j = 2; j < elem.length; j+=3) {
+ attr.add(elem[j], elem[j+1], elem[j+2]);
+ xmlTag += " " + elem[j] + "(" + elem[j+1] +
+ ")=\"" + elem[j+2] + "\"" ;
+ }
+ xmlTag += ">" ;
+
+ log.println(xmlTag) ;
+ oObj.startElement(tagName, attr) ;
+ } else
+ if ("end".equals(elem[0])) {
+ log.println("</" + elem[1] + ">") ;
+ oObj.endElement(elem[1]) ;
+ } else
+ if ("chars".equals(elem[0])) {
+ log.println("'" + elem[1] + "'") ;
+ oObj.characters(elem[1]) ;
+ } else
+ if ("spaces".equals(elem[0])) {
+ log.println("(spaces)'" + elem[1] + "'") ;
+ oObj.ignorableWhitespace(elem[1]) ;
+ } else
+ if ("instruct".equals(elem[0])) {
+ log.println("<?" + elem[1] + " " + elem[2] + "?>") ;
+ oObj.processingInstruction(elem[1], elem[2]) ;
+ } else {
+ log.println("!!! Bad object relation !!!") ;
+ throw new StatusException(Status.failed("Bad relation")) ;
+ }
+ }
+ } catch (SAXException e) {
+ e.printStackTrace(log) ;
+ log.println("Wrapped exception :" + e.WrappedException) ;
+ result = false ;
+ }
+
+ tRes.tested("startElement()", result) ;
+ }
+
+ /**
+ * Does nothing. <p>
+ *
+ * Has <b>OK</b> status if no exceptions occured during XML data
+ * transfering in <code>startDocument</code> and
+ * <code>startElement</code> method tests.
+ */
+ public void _endElement() {
+ if (ToBeSkipped) {
+ tRes.tested("endElement()", Status.skipped(true));
+ return;
+ }
+ requiredMethod("startElement()") ;
+
+ boolean result = true ;
+
+ tRes.tested("endElement()", result) ;
+ }
+
+ /**
+ * Does nothing. <p>
+ *
+ * Has <b>OK</b> status if no exceptions occured during XML data
+ * transfering in <code>startDocument</code> and
+ * <code>startElement</code> method tests.
+ */
+ public void _characters() {
+ if (ToBeSkipped) {
+ tRes.tested("characters()", Status.skipped(true));
+ return;
+ }
+ requiredMethod("startElement()") ;
+
+ boolean result = true ;
+
+ tRes.tested("characters()", result) ;
+ }
+
+ /**
+ * Does nothing. <p>
+ *
+ * Has <b>OK</b> status if no exceptions occured during XML data
+ * transfering in <code>startDocument</code> and
+ * <code>startElement</code> method tests.
+ */
+ public void _ignorableWhitespace() {
+ if (ToBeSkipped) {
+ tRes.tested("ignorableWhitespace()", Status.skipped(true));
+ return;
+ }
+ requiredMethod("startElement()") ;
+
+ boolean result = true ;
+
+ tRes.tested("ignorableWhitespace()", result) ;
+ }
+
+ /**
+ * Does nothing. <p>
+ *
+ * Has <b>OK</b> status if no exceptions occured during XML data
+ * transfering in <code>startDocument</code> and
+ * <code>startElement</code> method tests.
+ */
+ public void _processingInstruction() {
+ if (ToBeSkipped) {
+ tRes.tested("processingInstruction()", Status.skipped(true));
+ return;
+ }
+ requiredMethod("startElement()") ;
+
+ boolean result = true ;
+
+ tRes.tested("processingInstruction()", result) ;
+ }
+
+ /**
+ * Does nothing. <p>
+ *
+ * Has <b>OK</b> status if no exceptions occured during XML data
+ * transfering in <code>startDocument</code> and
+ * <code>startElement</code> method tests.
+ */
+ public void _setDocumentLocator() {
+ if (ToBeSkipped) {
+ tRes.tested("setDocumentLocator()", Status.skipped(true));
+ return;
+ }
+ executeMethod("endDocument()") ;
+
+ boolean result = locatorResult ;
+ if (locatorException != null) {
+ log.println("Exception occured during setDocumentLocator() call:") ;
+ locatorException.printStackTrace(log) ;
+ log.println("Wrapped exception :"
+ + locatorException.WrappedException) ;
+ result = false ;
+ }
+
+ tRes.tested("setDocumentLocator()", result) ;
+ }
+
+ private PropertyValue[] createMediaDescriptor(String[] propNames,
+ Object[] values) {
+ PropertyValue[] props = new PropertyValue[propNames.length] ;
+
+ for (int i = 0; i < props.length; i++) {
+ props[i] = new PropertyValue() ;
+ props[i].Name = propNames[i] ;
+ if (values != null && i < values.length) {
+ props[i].Value = values[i] ;
+ }
+ }
+
+ return props ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_acceptor/Acceptor.java b/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
new file mode 100644
index 000000000000..67981f3937ad
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * $RCSfile: Acceptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._acceptor;
+
+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;
+
+/**
+* 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 {
+
+ private XInterface acceptor = null ;
+
+ /**
+ * 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) 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..bcd7621a6daa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_adabas/ODriver.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODriver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._adabas;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.beans.PropertyValue;
+
+/**
+* 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)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;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_ado/ODriver.java b/qadevOOo/tests/java/mod/_ado/ODriver.java
new file mode 100644
index 000000000000..0d44167e9ebd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ado/ODriver.java
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODriver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ado;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.beans.PropertyValue;
+
+/**
+* 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)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;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_brdgfctr/BridgeFactory.java b/qadevOOo/tests/java/mod/_brdgfctr/BridgeFactory.java
new file mode 100644
index 000000000000..8e3fce4fb540
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_brdgfctr/BridgeFactory.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * $RCSfile: BridgeFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._brdgfctr;
+
+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;
+
+/**
+* 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) 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/_cached/CachedContentResultSetFactory.java b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java
new file mode 100644
index 000000000000..32961570a3dd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * $RCSfile: CachedContentResultSetFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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 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>
+* The following files used by this test :
+* <ul>
+* <li><b> solibrary.jar </b> : this file is used for <code>
+* PackageContentProvider</code> from which a list of contents is
+* retrieved. </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 = 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("solibrary.jar") ;
+ 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 = (XDynamicResultSet)
+ cmdProc.execute(cmd, 0, null) ;
+
+ 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..36ac3757b0b2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * $RCSfile: CachedContentResultSetStubFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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 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>
+* The following files used by this test :
+* <ul>
+* <li><b> solibrary.jar </b> : this file is used for <code>
+* PackageContentProvider</code> from which a list of contents is
+* retrieved. </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 = 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("solibrary.jar") ;
+ 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 = (XDynamicResultSet)
+ cmdProc.execute(cmd, 0, null) ;
+
+ 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..a9f92d93f8df
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * $RCSfile: CachedDynamicResultSetFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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 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>
+* The following files used by this test :
+* <ul>
+* <li><b> solibrary.jar </b> : this file is used for <code>
+* PackageContentProvider</code> from which a list of contents is
+* retrieved. </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 = 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("solibrary.jar") ;
+ 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 = (XDynamicResultSet)
+ cmdProc.execute(cmd, 0, null) ;
+
+ 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..cad2598daea9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * $RCSfile: CachedDynamicResultSetStubFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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 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>
+* The following files used by this test :
+* <ul>
+* <li><b> solibrary.jar </b> : this file is used for <code>
+* PackageContentProvider</code> from which a list of contents is
+* retrieved. </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 = 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("solibrary.jar") ;
+ 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 = (XDynamicResultSet) cmdProc.execute(cmd, 0, null) ;
+
+ } 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..7d23d7602194
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cmdmail/SimpleCommandMail.java
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: SimpleCommandMail.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._cmdmail;
+
+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 SimpleCommandMail extends TestCase {
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = 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..f18b9c31f5d8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChaosContentProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._cnt;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+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.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 = Param.getMSF();
+ Object relationContainer = null ;
+ 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..61f7671c2245
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * $RCSfile: CntUnoDataContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._cnt;
+
+import com.sun.star.container.XIndexContainer;
+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.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 = 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..27ff60a783d2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cnt/PropertyMatcherFactory.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * $RCSfile: PropertyMatcherFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._cnt;
+
+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.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 = Param.getMSF();
+ Object relationContainer = null ;
+
+
+ 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/_connectr/Connector.java b/qadevOOo/tests/java/mod/_connectr/Connector.java
new file mode 100644
index 000000000000..d757d29747ec
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_connectr/Connector.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: Connector.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._connectr;
+
+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.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) 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..c2a985777d30
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_corefl/CoreReflection.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * $RCSfile: CoreReflection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._corefl;
+
+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.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 = 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/_cpld/DLLComponentLoader.java b/qadevOOo/tests/java/mod/_cpld/DLLComponentLoader.java
new file mode 100644
index 000000000000..419df2cf80db
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_cpld/DLLComponentLoader.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * $RCSfile: DLLComponentLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._cpld;
+
+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;
+
+ try {
+ XMultiServiceFactory xMSF = 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";
+ 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..71b04b6395c6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java
@@ -0,0 +1,472 @@
+/*************************************************************************
+ *
+ * $RCSfile: ConnectionLineAccessibility.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+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 lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import com.sun.star.beans.PropertyValue;
+import util.DBTools;
+import com.sun.star.uno.XNamingService;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdbc.XIsolatedConnection;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.sdb.XQueryDefinitionsSupplier;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.ui.dialogs.XExecutableDialog;
+import com.sun.star.lang.XComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import util.AccessibilityTools;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+
+/**
+* Object implements the following interfaces :
+* <ul>
+* <li><code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* <li><code>drafts::com::sun::star::accessibility::XAccessibleContext
+* </code></li>
+* <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+* </code></li>
+* </ul><p>
+* @see drafts.com.sun.star.accessibility.XAccessible
+* @see drafts.com.sun.star.accessibility.XAccessibleContext
+* @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+* @see ifc.accessibility._XAccessible
+* @see ifc.accessibility._XAccessibleContext
+* @see ifc.accessibility._XAccessibleEventBroadcaster
+*/
+public class ConnectionLineAccessibility extends TestCase {
+
+ XAccessibleAction actionCancel = null;
+ XWindow queryWindow = null;
+ Object[] savedObj = null;
+ String[] elNames = null;
+ XNamingService namingService = null;
+
+ /**
+ * Creates a new DataSource and registers it.
+ * Creates a connection and using it
+ * creates two tables in database.
+ * Creates a new query and adds it to DefinitionContainer.
+ * Opens a DatasourceAdministration dialog,
+ * selects the tab page 'Query', pushs the button 'Edit query' using
+ * accessibility components. Pushing of the button causes opening of
+ * Query dialog. Then obtains an accessible object with
+ * the role <code>AccessibleRole.UNKNOWN</code> and with
+ * the name 'Relation'.
+ *
+ * @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, oDBSource = null, newQuery = null;
+ Object toolkit = null;
+ try {
+ oDBContext = Param.getMSF().createInstance(
+ "com.sun.star.sdb.DatabaseContext");
+ oDBSource = Param.getMSF().createInstance(
+ "com.sun.star.sdb.DataSource");
+ newQuery = Param.getMSF().createInstance(
+ "com.sun.star.sdb.QueryDefinition");
+ toolkit = 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 jdbcURL = (String) Param.get("jdbc.url");
+ if (jdbcURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ 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[3];
+ 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;
+
+ XPropertySet propSetDBSource = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oDBSource);
+
+ try {
+ propSetDBSource.setPropertyValue("URL", "jdbc:" + jdbcURL);
+ 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"));
+ }
+
+ namingService = (XNamingService)
+ UnoRuntime.queryInterface(XNamingService.class, oDBContext);
+ XNameAccess nameAccess = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, oDBContext);
+
+ final String sourceName = "AAADBSource for dbu-accessibility";
+
+ if (nameAccess.hasByName(sourceName)) {
+ try {
+ namingService.revokeObject(sourceName);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't revoke object"));
+ }
+ }
+
+ //because a bug with selection in ListBox
+ //content of TabControl isn't changed after selecting new list item
+ elNames = nameAccess.getElementNames();
+/* savedObj = new Object[elNames.length];
+ for(int i = 0; i < elNames.length; i++) {
+ try {
+ savedObj[i] = nameAccess.getByName(elNames[i]);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ }
+
+ try {
+ namingService.revokeObject(elNames[i]);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't revoke object"));
+ }
+ }
+*/
+
+ try {
+ namingService.registerObject(sourceName, oDBSource);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't register object"));
+ }
+
+ XIsolatedConnection 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) {
+ e.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);
+ } 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"));
+ }
+
+ DiagThread Diag = new DiagThread(Param.getMSF());
+
+ Diag.start();
+
+ shortWait();
+
+ XExtendedToolkit tk = (XExtendedToolkit)
+ UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext accContextCancel = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON, "Cancel");
+ actionCancel = (XAccessibleAction)UnoRuntime.queryInterface
+ (XAccessibleAction.class, accContextCancel);
+
+ XAccessibleContext accContextTabList = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.PAGETABLIST);
+ XAccessibleSelection tabListSelection = (XAccessibleSelection)
+ UnoRuntime.queryInterface(XAccessibleSelection.class,
+ accContextTabList);
+
+ final int queriesChildNum = 3;
+ try {
+ tabListSelection.selectAccessibleChild(queriesChildNum);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't select child " + queriesChildNum));
+ }
+
+ shortWait();
+
+ XAccessibleContext acEditQuery = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.PUSHBUTTON, "Edit Query");
+ XAccessibleAction actionEditQuery = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, acEditQuery);
+
+ try {
+ actionEditQuery.doAccessibleAction(0);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't do accessible action"));
+ }
+
+ shortWait();
+
+ atw = tk.getActiveTopWindow();
+
+ xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, atw);
+
+ queryWindow = xWindow;
+
+ xRoot = at.getAccessibleObject(xWindow);
+
+// at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.UNKNOWN, "Relation");
+
+/* for(int i = 0; i < savedObj.length; i++) {
+ try {
+ namingService.registerObject(elNames[i], savedObj[i]);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ }
+ }
+*/
+ log.println("ImplementationName " + util.utils.getImplName(oObj));
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes the DatasourceAdministration dialog and Query Dialog.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ queryWindow.dispose();
+
+ shortWait();
+
+ try {
+ actionCancel.doAccessibleAction(0);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't do accessible action"));
+ }
+ }
+
+ /**
+ * Thread for opening modal dialog 'Datasource Administration Dialog'.
+ */
+ public class DiagThread extends Thread {
+ XMultiServiceFactory msf = null;
+
+ public DiagThread(XMultiServiceFactory msf) {
+ this.msf = msf;
+ }
+
+ public void run() {
+ Object dbAdminDlg = null;
+
+ try {
+ dbAdminDlg = msf.createInstance(
+ "com.sun.star.sdb.DatasourceAdministrationDialog");
+ } catch(com.sun.star.uno.Exception e) {}
+
+ XExecutableDialog adminDlg = (XExecutableDialog)
+ UnoRuntime.queryInterface(XExecutableDialog.class, dbAdminDlg);
+
+ adminDlg.execute();
+ }
+ }
+
+ /**
+ * Sleeps for 0.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..63bb09bfc4df
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/DBContentLoader.java
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * $RCSfile: DBContentLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+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;
+
+/**
+* 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 = 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( "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..28fd7aa754b7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
@@ -0,0 +1,444 @@
+/*************************************************************************
+ *
+ * $RCSfile: JoinViewAccessibility.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+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 lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import com.sun.star.beans.PropertyValue;
+import util.DBTools;
+import com.sun.star.uno.XNamingService;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdbc.XIsolatedConnection;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.sdb.XQueryDefinitionsSupplier;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.ui.dialogs.XExecutableDialog;
+import com.sun.star.lang.XComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import util.AccessibilityTools;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+
+/**
+* Object implements the following interfaces :
+* <ul>
+* <li><code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* <li><code>drafts::com::sun::star::accessibility::XAccessibleContext
+* </code></li>
+* <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+* </code></li>
+* </ul><p>
+* @see drafts.com.sun.star.accessibility.XAccessible
+* @see drafts.com.sun.star.accessibility.XAccessibleContext
+* @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+* @see ifc.accessibility._XAccessible
+* @see ifc.accessibility._XAccessibleContext
+* @see ifc.accessibility._XAccessibleEventBroadcaster
+*/
+public class JoinViewAccessibility extends TestCase {
+
+ XAccessibleAction actionCancel = null;
+ XWindow queryWindow = null;
+ Object[] savedObj = null;
+ String[] elNames = null;
+ XNamingService namingService = null;
+
+ /**
+ * Creates a new DataSource and registers it.
+ * Creates a connection and using it
+ * creates two tables in database.
+ * Creates a new query and adds it to DefinitionContainer.
+ * Opens a DatasourceAdministration dialog,
+ * selects the tab page 'Query', pushs the button 'Edit query' using
+ * accessibility components. Pushing of the button causes opening of
+ * Query dialog. Then obtains an accessible object with
+ * the role <code>AccessibleRole.VIEWPORT</code>.
+ *
+ * @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, oDBSource = null, newQuery = null;
+ Object toolkit = null;
+ try {
+ oDBContext = Param.getMSF().createInstance(
+ "com.sun.star.sdb.DatabaseContext");
+ oDBSource = Param.getMSF().createInstance(
+ "com.sun.star.sdb.DataSource");
+ newQuery = Param.getMSF().createInstance(
+ "com.sun.star.sdb.QueryDefinition");
+ toolkit = 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 jdbcURL = (String) Param.get("jdbc.url");
+ if (jdbcURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ 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[3];
+ 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;
+
+ XPropertySet propSetDBSource = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oDBSource);
+
+ try {
+ propSetDBSource.setPropertyValue("URL", "jdbc:" + jdbcURL);
+ 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"));
+ }
+
+ namingService = (XNamingService)
+ UnoRuntime.queryInterface(XNamingService.class, oDBContext);
+ XNameAccess nameAccess = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, oDBContext);
+
+ final String sourceName = "AAADBSource for dbu-accessibility";
+
+ if (nameAccess.hasByName(sourceName)) {
+ try {
+ namingService.revokeObject(sourceName);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't revoke object"));
+ }
+ }
+
+ elNames = nameAccess.getElementNames();
+
+ try {
+ namingService.registerObject(sourceName, oDBSource);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't register object"));
+ }
+
+ XIsolatedConnection 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) {
+ e.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);
+ } 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"));
+ }
+
+ DiagThread Diag = new DiagThread(Param.getMSF());
+
+ Diag.start();
+
+ shortWait();
+
+ XExtendedToolkit tk = (XExtendedToolkit)
+ UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext accContextCancel = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON, "Cancel");
+ actionCancel = (XAccessibleAction)UnoRuntime.queryInterface
+ (XAccessibleAction.class, accContextCancel);
+
+ XAccessibleContext accContextTabList = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.PAGETABLIST);
+ XAccessibleSelection tabListSelection = (XAccessibleSelection)
+ UnoRuntime.queryInterface(XAccessibleSelection.class,
+ accContextTabList);
+
+ final int queriesChildNum = 3;
+ try {
+ tabListSelection.selectAccessibleChild(queriesChildNum);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't select child " + queriesChildNum));
+ }
+
+ shortWait();
+
+ XAccessibleContext acEditQuery = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.PUSHBUTTON, "Edit Query");
+ XAccessibleAction actionEditQuery = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, acEditQuery);
+
+ try {
+ actionEditQuery.doAccessibleAction(0);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't do accessible action"));
+ }
+
+ shortWait();
+
+ atw = tk.getActiveTopWindow();
+
+ xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, atw);
+
+ queryWindow = xWindow;
+
+ xRoot = at.getAccessibleObject(xWindow);
+
+// at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.VIEWPORT);
+
+ log.println("ImplementationName " + util.utils.getImplName(oObj));
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes the DatasourceAdministration dialog and Query Dialog.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ try {
+ queryWindow.dispose();
+ } catch ( com.sun.star.lang.DisposedException de) {}
+
+ shortWait();
+
+ try {
+ actionCancel.doAccessibleAction(0);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't do accessible action"));
+ }
+ }
+
+ /**
+ * Thread for opening modal dialog 'Datasource Administration Dialog'.
+ */
+ public class DiagThread extends Thread {
+ XMultiServiceFactory msf = null;
+
+ public DiagThread(XMultiServiceFactory msf) {
+ this.msf = msf;
+ }
+
+ public void run() {
+ Object dbAdminDlg = null;
+
+ try {
+ dbAdminDlg = msf.createInstance(
+ "com.sun.star.sdb.DatasourceAdministrationDialog");
+ } catch(com.sun.star.uno.Exception e) {}
+
+ XExecutableDialog adminDlg = (XExecutableDialog)
+ UnoRuntime.queryInterface(XExecutableDialog.class, dbAdminDlg);
+
+ adminDlg.execute();
+ }
+ }
+
+ /**
+ * Sleeps for 0.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..56d6a7b8f155
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/OCommandDefinition.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: OCommandDefinition.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import com.sun.star.lang.XMultiServiceFactory;
+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;
+
+/**
+* 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 = 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..cf6aef453c44
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODatabaseContext.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+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 lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import com.sun.star.uno.XNamingService;
+
+/**
+* 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 = 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 = Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.sdb.DataSource" );
+
+ XPropertySet xDSProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oInterface) ;
+
+ xDSProps.setPropertyValue("URL", "sdbc:dbase:file:///.") ;
+
+ 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..6afeb216a7a0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODatabaseSource.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.task.XInteractionHandler;
+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.utils;
+
+/**
+* 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 ;
+
+ /**
+ * 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++ ;
+ }
+
+ /**
+ * 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 ;
+
+ try {
+ xMSF = Param.getMSF();
+ oInterface = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" );
+
+ xDBContextNameServ = (XNamingService)
+ UnoRuntime.queryInterface(XNamingService.class, oInterface) ;
+
+ // retrieving temp directory for database
+ String tmpDatabaseUrl = utils.getOfficeTempDir(Param.getMSF());
+
+ 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) ;
+
+ databaseName = "NewDatabaseSource" + uniqueSuffix ;
+
+ // make sure that the DatabaseContext isn't already registered
+ try {
+ xDBContextNameServ.revokeObject(databaseName) ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Nothing to be removed - OK");
+ }
+
+ // registering source in DatabaseContext
+ xDBContextNameServ.registerObject(databaseName, newSource) ;
+
+ oInterface = newSource ;
+ }
+ 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 );
+
+ // adding obj relation for interface XCompletedConnection
+ Object handler = null ;
+ try {
+ handler = Param.getMSF().createInstance
+ ("com.sun.star.sdb.InteractionHandler") ;
+ } catch (com.sun.star.uno.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..6b1d17ac5286
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceAdministrationDialog.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODatasourceAdministrationDialog.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+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;
+
+/**
+* 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 = 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..c71c67a7f231
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java
@@ -0,0 +1,331 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODatasourceBrowser.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+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.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.XControlAccess;
+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;
+
+/**
+ * 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(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) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log ) throws StatusException {
+
+ log.println( "creating a test environment" );
+
+ if (xTextDoc != null) xTextDoc.dispose();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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.currentThread().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..64c02e63520b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/OInteractionHandler.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * $RCSfile: OInteractionHandler.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.task.XInteractionContinuation;
+import com.sun.star.task.XInteractionRequest;
+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;
+
+/**
+* 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 = 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..27b9e908a5b8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * $RCSfile: OQueryDesign.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+//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.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+//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.XInitialization;
+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 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 OQueryDesign extends TestCase {
+
+ XDesktop Desk;
+ XFrame Frame;
+
+ /**
+ * Disposes the document, if exists, created in
+ * <code>createTestEnvironment</code> method.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("disposing Query");
+
+ if (Frame != null) {
+ Frame.dispose();
+ }
+ }
+
+ /**
+ * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>).
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ Desk = (XDesktop) UnoRuntime.queryInterface(
+ XDesktop.class, DesktopTools.createDesktop(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,Desk);
+
+ XDispatch getting = null;
+
+ 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;
+ getting.dispatch(the_url,Args);
+
+ shortWait();
+
+ Frame = Desk.getCurrentFrame();
+
+ 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 = Frame;
+ params[1] = param2;
+ PropertyValue param3 = new PropertyValue();
+ param3.Name = "QueryDesignView";
+ param3.Value = new Boolean(true);
+ params[2] = param3;
+
+ oObj = Frame.getController();
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //Adding ObjRelations for XInitialization
+ tEnv.addObjRelation("XInitialization.args", params);
+
+ log.println("ImplementationName"+util.utils.getImplName(oObj));
+
+ 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.currentThread().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..c7f5845f895c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java
@@ -0,0 +1,596 @@
+/*************************************************************************
+ *
+ * $RCSfile: ORowSet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.io.XDataInputStream;
+import com.sun.star.io.XTextInputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.CommandType;
+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.sdbcx.XRowLocate;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.File;
+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;
+
+/**
+ * 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 ORowSet 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 = "ORowSetDataSource";
+ public XConnection conn = 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 {
+
+ this.log = log ;
+ tmpDir = (String) Param.get("TMPURL") ;
+ tmpDir = utils.getOfficeTemp(Param.getMSF());
+/* origDB = (String) Param.get("DOCPTH") +
+ System.getProperty("file.separator") + "ORowSet.dbf" ;*/
+
+ origDB = util.utils.getFullTestDocName("TestDB/testDB.dbf");
+
+ dbTools = new DBTools(Param.getMSF()) ;
+
+ // 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 = 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";
+ srcInf.Info = propInfo;
+ Object 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 {
+ try {
+ srcInf.URL = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir) ;
+ Object 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) ;
+ }
+ }
+ }
+
+ /**
+ * 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) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = null ;
+ uniqueSuffix++;
+ boolean envCreatedOK = false ;
+
+ //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"));
+ }
+ } else {
+ String oldF = null ;
+ String newF = null ;
+ do {
+ tableName = "ORowSet_tmp" + uniqueSuffix ;
+ oldF = utils.getFullURL(origDB);
+ newF = utils.getOfficeTemp(Param.getMSF())+tableName+".dbf";
+ } while (!utils.overwriteFile(Param.getMSF(),oldF,newF) &&
+ uniqueSuffix++ < 50);
+ }
+
+ File tmpDir = null;
+ XConnection connection = null ;
+
+ try {
+ xMSF = Param.getMSF();
+
+ Object oRowSet = xMSF.createInstance("com.sun.star.sdb.RowSet") ;
+
+ XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oRowSet) ;
+
+ log.println("Trying to open: " + tableName);
+
+ xSetProp.setPropertyValue("DataSourceName", dbSourceName) ;
+ xSetProp.setPropertyValue("Command", tableName) ;
+ 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() ;
+
+ connection = (XConnection)
+ xSetProp.getPropertyValue("ActiveConnection") ;
+
+ oInterface = oRowSet ;
+
+ XResultSet xRes = (XResultSet) UnoRuntime.queryInterface
+ (XResultSet.class, oRowSet) ;
+
+ xRes.first() ;
+
+ 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 );
+
+ // Adding relations for disposing object
+ tEnv.addObjRelation("ORowSet.Connection", connection) ;
+ this.conn = (XConnection) tEnv.getObjRelation("ORowSet.Connection");
+
+ final XRow xtRow = (XRow) UnoRuntime.queryInterface
+ (XRow.class, oObj) ;
+ final XRowUpdate xtRowUpdate = (XRowUpdate)
+ UnoRuntime.queryInterface(XRowUpdate.class, oObj) ;
+ final XResultSet xtResSet = (XResultSet) UnoRuntime.queryInterface
+ (XResultSet.class, oObj) ;
+ final XResultSetUpdate xtResSetUpdate = (XResultSetUpdate)
+ UnoRuntime.queryInterface(XResultSetUpdate.class, oObj) ;
+
+ // 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 XRowUpdate xRowUpdate = (XRowUpdate)
+ UnoRuntime.queryInterface(XRowUpdate.class, oObj) ;
+ final PrintWriter logF = log ;
+ tEnv.addObjRelation("XRowSetApproveBroadcaster.ApproveChecker",
+ new ifc.sdb._XRowSetApproveBroadcaster.RowSetApproveChecker() {
+ public void moveCursor() {
+ try {
+ xResSet.beforeFirst() ;
+ xResSet.afterLast() ;
+ xResSet.first() ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ logF.println("### _XRowSetApproveBroadcaster." +
+ "RowSetApproveChecker.moveCursor() :") ;
+ e.printStackTrace(logF) ;
+ }
+ }
+ public RowChangeEvent changeRow() {
+ try {
+ xResSet.first() ;
+ xRowUpdate.updateString(1, "ORowSetTest2") ;
+ 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() ;
+ xResSet.first() ;
+ } catch (com.sun.star.sdbc.SQLException e) {
+ logF.println("### _XRowSetApproveBroadcaster."+
+ "RowSetApproveChecker.changeRowSet() :") ;
+ e.printStackTrace(logF) ;
+ }
+ }
+ }) ;
+ }
+ // Adding relations for XRow as a Vector with all data
+ // of current row of RowSet.
+ Object oBinStream = xMSF.createInstance
+ ("com.sun.star.io.DataInputStream") ;
+ XDataInputStream xBinStream = (XDataInputStream)
+ UnoRuntime.queryInterface(XDataInputStream.class, oBinStream) ;
+ Object oCharStream = xMSF.createInstance
+ ("com.sun.star.io.TextInputStream") ;
+ XTextInputStream xCharStream = (XTextInputStream)
+ UnoRuntime.queryInterface(XTextInputStream.class, oCharStream) ;
+ Object obj = xMSF.createInstance("com.sun.star.io.Pipe") ;
+
+ 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 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}) ;
+ params.add(new Date(26, 1, 2001)) ;
+ params.add(new Time(1, 25, 14, 12)) ;
+ params.add(new DateTime(1, 25, 14, 12, 26, 1, 2001)) ;
+ */
+ tEnv.addObjRelation("XParameters.ParamValues", params) ;
+ // Adding relation for XDeleteRows ifc test
+ final XRowLocate rowLoc = (XRowLocate) UnoRuntime.queryInterface
+ (XRowLocate.class, oObj) ;
+ final XResultSet bMarkResSet = (XResultSet)
+ UnoRuntime.queryInterface(XResultSet.class, oObj) ;
+
+ // Adding relation for XRowUpdate
+ XRow row = (XRow) UnoRuntime.queryInterface (XRow.class, oObj) ;
+ tEnv.addObjRelation("XRowUpdate.XRow", row) ;
+
+ // Adding relation for XResultSetUpdate
+ {
+ final XResultSet xResSet = (XResultSet)
+ UnoRuntime.queryInterface(XResultSet.class, oObj) ;
+ 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() ;
+ }
+ }) ;
+ }
+
+ envCreatedOK = true ;
+ return tEnv;
+
+ } catch(com.sun.star.uno.Exception e) {
+ log.println("Can't create object" );
+ e.printStackTrace(log) ;
+ try {
+ connection.close() ;
+ } catch(Exception ex) {}
+ throw new StatusException("Can't create object", e) ;
+ } finally {
+ if (!envCreatedOK) {
+ try {
+ connection.close() ;
+ } catch(Exception ex) {}
+ }
+ }
+
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes connection of <code>RowSet</code> instance created.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ 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.") ;
+ }
+ try {
+ dbTools.revokeDB(dbSourceName) ;
+ } 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) ;
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java b/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java
new file mode 100644
index 000000000000..bead6dd8e342
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * $RCSfile: OSQLMessageDialog.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+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;
+
+/**
+ * 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 = 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;
+
+ 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);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class OSQLMessageDialog
+
diff --git a/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java b/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java
new file mode 100644
index 000000000000..d08bc6cb766d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java
@@ -0,0 +1,494 @@
+/*************************************************************************
+ *
+ * $RCSfile: SbaXGridControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import util.AccessibilityTools;
+
+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.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.container.XNamed;
+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.view.XControlAccess;
+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 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( 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) 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);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XInterface button = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON);
+
+ XAccessibleAction action = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, button);
+ try{
+ action.doAccessibleAction(0);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException iob) {}
+
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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 Integer[]{ new Integer(0) }, new Integer[]{ new Integer(1) }});
+ tEnv.addObjRelation("Comparer", new Comparator() {
+ public int compare(Object o1, Object o2) {
+ return ((Integer)o1).compareTo(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));
+
+ com.sun.star.frame.XDispatch ad = (com.sun.star.frame.XDispatch)
+ UnoRuntime.queryInterface(com.sun.star.frame.XDispatch.class,oObj);
+ FormTools.switchDesignOf(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
+
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
new file mode 100644
index 000000000000..041efeb7c195
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
@@ -0,0 +1,471 @@
+/*************************************************************************
+ *
+ * $RCSfile: TableWindowAccessibility.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbaccess;
+
+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 lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import com.sun.star.beans.PropertyValue;
+import util.DBTools;
+import com.sun.star.uno.XNamingService;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdbc.XIsolatedConnection;
+import com.sun.star.sdbc.XConnection;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.sdb.XQueryDefinitionsSupplier;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.ui.dialogs.XExecutableDialog;
+import com.sun.star.lang.XComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import util.AccessibilityTools;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+
+/**
+* Object implements the following interfaces :
+* <ul>
+* <li><code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* <li><code>drafts::com::sun::star::accessibility::XAccessibleContext
+* </code></li>
+* <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+* </code></li>
+* </ul><p>
+* @see drafts.com.sun.star.accessibility.XAccessible
+* @see drafts.com.sun.star.accessibility.XAccessibleContext
+* @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+* @see ifc.accessibility._XAccessible
+* @see ifc.accessibility._XAccessibleContext
+* @see ifc.accessibility._XAccessibleEventBroadcaster
+*/
+public class TableWindowAccessibility extends TestCase {
+
+ XAccessibleAction actionCancel = null;
+ XWindow queryWindow = null;
+ Object[] savedObj = null;
+ String[] elNames = null;
+ XNamingService namingService = null;
+
+ /**
+ * Creates a new DataSource and registers it.
+ * Creates a connection and using it
+ * creates two tables in database.
+ * Creates a new query and adds it to DefinitionContainer.
+ * Opens a DatasourceAdministration dialog,
+ * selects the tab page 'Query', pushs the button 'Edit query' using
+ * accessibility components. Pushing of the button causes opening of
+ * Query dialog. Then obtains an accessible object with
+ * the role <code>AccessibleRole.PANEL</code>.
+ *
+ * @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, oDBSource = null, newQuery = null;
+ Object toolkit = null;
+ try {
+ oDBContext = Param.getMSF().createInstance(
+ "com.sun.star.sdb.DatabaseContext");
+ oDBSource = Param.getMSF().createInstance(
+ "com.sun.star.sdb.DataSource");
+ newQuery = Param.getMSF().createInstance(
+ "com.sun.star.sdb.QueryDefinition");
+ toolkit = 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 jdbcURL = (String) Param.get("jdbc.url");
+ if (jdbcURL == null) {
+ throw new StatusException(Status.failed(
+ "Couldn't get 'jdbc.url' from ini-file"));
+ }
+ 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[3];
+ 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;
+
+ XPropertySet propSetDBSource = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oDBSource);
+
+ try {
+ propSetDBSource.setPropertyValue("URL", "jdbc:" + jdbcURL);
+ 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"));
+ }
+
+ namingService = (XNamingService)
+ UnoRuntime.queryInterface(XNamingService.class, oDBContext);
+ XNameAccess nameAccess = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, oDBContext);
+
+ final String sourceName = "AAADBSource for dbu-accessibility";
+
+ if (nameAccess.hasByName(sourceName)) {
+ try {
+ namingService.revokeObject(sourceName);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't revoke object"));
+ }
+ }
+
+ //because a bug with selection in ListBox
+ //content of TabControl isn't changed after selecting new list item
+ elNames = nameAccess.getElementNames();
+/* savedObj = new Object[elNames.length];
+ for(int i = 0; i < elNames.length; i++) {
+ try {
+ savedObj[i] = nameAccess.getByName(elNames[i]);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ }
+
+ try {
+ namingService.revokeObject(elNames[i]);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't revoke object"));
+ }
+ }
+*/
+
+ try {
+ namingService.registerObject(sourceName, oDBSource);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException(
+ Status.failed("Couldn't register object"));
+ }
+
+ XIsolatedConnection 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) {
+ e.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);
+ } 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"));
+ }
+
+ DiagThread Diag = new DiagThread(Param.getMSF());
+
+ Diag.start();
+
+ shortWait();
+
+ XExtendedToolkit tk = (XExtendedToolkit)
+ UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext accContextCancel = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON, "Cancel");
+ actionCancel = (XAccessibleAction)UnoRuntime.queryInterface
+ (XAccessibleAction.class, accContextCancel);
+
+ XAccessibleContext accContextTabList = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.PAGETABLIST);
+ XAccessibleSelection tabListSelection = (XAccessibleSelection)
+ UnoRuntime.queryInterface(XAccessibleSelection.class,
+ accContextTabList);
+
+ final int queriesChildNum = 3;
+ try {
+ tabListSelection.selectAccessibleChild(queriesChildNum);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't select child " + queriesChildNum));
+ }
+
+ shortWait();
+
+ XAccessibleContext acEditQuery = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.PUSHBUTTON, "Edit Query");
+ XAccessibleAction actionEditQuery = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, acEditQuery);
+
+ try {
+ actionEditQuery.doAccessibleAction(0);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't do accessible action"));
+ }
+
+ shortWait();
+
+ atw = tk.getActiveTopWindow();
+
+ xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, atw);
+
+ queryWindow = xWindow;
+
+ xRoot = at.getAccessibleObject(xWindow);
+
+// at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.PANEL);
+
+/* for(int i = 0; i < savedObj.length; i++) {
+ try {
+ namingService.registerObject(elNames[i], savedObj[i]);
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ }
+ }*/
+
+ log.println("ImplementationName " + util.utils.getImplName(oObj));
+
+ log.println( " creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes the DatasourceAdministration dialog and Query Dialog.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ queryWindow.dispose();
+
+ shortWait();
+
+ try {
+ actionCancel.doAccessibleAction(0);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException(Status.failed(
+ "Couldn't do accessible action"));
+ }
+ }
+
+ /**
+ * Thread for opening modal dialog 'Datasource Administration Dialog'.
+ */
+ public class DiagThread extends Thread {
+ XMultiServiceFactory msf = null;
+
+ public DiagThread(XMultiServiceFactory msf) {
+ this.msf = msf;
+ }
+
+ public void run() {
+ Object dbAdminDlg = null;
+
+ try {
+ dbAdminDlg = msf.createInstance(
+ "com.sun.star.sdb.DatasourceAdministrationDialog");
+ } catch(com.sun.star.uno.Exception e) {}
+
+ XExecutableDialog adminDlg = (XExecutableDialog)
+ UnoRuntime.queryInterface(XExecutableDialog.class, dbAdminDlg);
+
+ adminDlg.execute();
+ }
+ }
+
+ /**
+ * Sleeps for 0.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..5d1ed2b7cb8f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dbpool/OConnectionPool.java
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * $RCSfile: OConnectionPool.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dbpool;
+
+import lib.TestCase;
+import lib.Status;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import com.sun.star.uno.XInterface;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.beans.PropertyValue;
+import util.DBTools;
+
+/**
+* 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.sdb.XDriverManager
+* @see ifc.sdbc.XDriverManager
+*/
+public class OConnectionPool extends TestCase {
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XMultiServiceFactory xMSF = 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;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_defreg/NestedRegistry.java b/qadevOOo/tests/java/mod/_defreg/NestedRegistry.java
new file mode 100644
index 000000000000..4fdbcd7b9770
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_defreg/NestedRegistry.java
@@ -0,0 +1,234 @@
+/*************************************************************************
+ *
+ * $RCSfile: NestedRegistry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._defreg;
+
+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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ Object fileAcc = null;
+
+ final String tmpDir = utils.getOfficeTempDirSys(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 = 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..63eaa7816455
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dtrans/generic.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: generic.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dtrans;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestParameters;
+import lib.TestEnvironment;
+import lib.StatusException;
+import com.sun.star.uno.XInterface;
+import com.sun.star.lang.XMultiServiceFactory;
+
+/**
+ * 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 = 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..fcb026bd31e3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_dynamicloader/Dynamic.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * $RCSfile: Dynamic.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._dynamicloader;
+
+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.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 = 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..e3798a728894
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_file/calc/ODriver.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODriver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._file.calc;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.beans.PropertyValue;
+
+
+/**
+* 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)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;
+ }
+} \ No newline at end of file
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..f9db69713ead
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_file/dbase/ODriver.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODriver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._file.dbase;
+
+import lib.TestCase;
+import lib.TestParameters;
+import lib.TestEnvironment;
+import lib.StatusException;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import lib.Status;
+import com.sun.star.beans.PropertyValue;
+
+/**
+* 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)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;
+ }
+} \ No newline at end of file
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..e39633615a97
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_file/flat/ODriver.java
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODriver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._file.flat;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.beans.PropertyValue;
+
+/**
+* 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)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;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fileacc/SimpleFileAccess.java b/qadevOOo/tests/java/mod/_fileacc/SimpleFileAccess.java
new file mode 100644
index 000000000000..e46bd82d1455
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fileacc/SimpleFileAccess.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * $RCSfile: SimpleFileAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fileacc;
+
+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.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 = 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..d476a92f881a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fop/FolderPicker.java
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * $RCSfile: FolderPicker.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fop;
+
+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.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 = Param.getMSF();
+ Object relationContainer = null ;
+
+
+ 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/OButtonControl.java b/qadevOOo/tests/java/mod/_forms/OButtonControl.java
new file mode 100644
index 000000000000..92eed08f518a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OButtonControl.java
@@ -0,0 +1,242 @@
+/*************************************************************************
+ *
+ * $RCSfile: OButtonControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..3c19113714d0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OButtonModel.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * $RCSfile: OButtonModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+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;
+
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarWriter document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarWriter document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Adds button into text and retrieves it's control model.
+ * 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;
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"CommandButton");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+ log.println( "creating a new environment for OButtonModel object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ String objName = "CommandButton";
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class OButtonModel
+
diff --git a/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java
new file mode 100644
index 000000000000..b152dbe27436
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java
@@ -0,0 +1,260 @@
+/*************************************************************************
+ *
+ * $RCSfile: OCheckBoxControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..25634b36938b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OCheckBoxModel.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * $RCSfile: OCheckBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.form.XLoadable;
+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;
+
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarWriter document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarWriter document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates CheckBox in the Form, then binds it to Bibliography
+ * database and returns CheckBox'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>
+ * </ul>
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"CheckBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = FormTools.bindForm(xTextDoc);
+
+ log.println( "creating a new environment for OCheckBoxModel object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ String objName = "CheckBox";
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC",aShape.getControl());
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL",formLoader);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // 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..3d4fcfd258e7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java
@@ -0,0 +1,263 @@
+/*************************************************************************
+ *
+ * $RCSfile: OComboBoxControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..611838feaf7a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OComboBoxModel.java
@@ -0,0 +1,279 @@
+/*************************************************************************
+ *
+ * $RCSfile: OComboBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.WriterTools;
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates ComboBox in the Form, then binds it to Bibliography
+ * database and returns CheckBox'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>
+ * </ul>
+ * @see ifc.form._XUpdateBroadcaster
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ TestEnvironment tEnv = null ;
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"ComboBox");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ final XLoadable formLoader = FormTools.bindForm(xTextDoc);
+ final XPropertySet ps = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oObj) ;
+
+ // binding control to the "Identifier" field of "biblio" table.
+ try {
+ ps.setPropertyValue("DataField", "Identifier") ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Can't set the property") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create the environment",e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Can't set the property") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create the environment",e) ;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Can't set the property") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create the environment",e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Can't set the property") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create the environment",e) ;
+ }
+
+ log.println( "creating a new environment for OComboBoxModel object" );
+ tEnv = new TestEnvironment( oObj );
+ String objName = "ComboBox";
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC",aShape.getControl());
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL",formLoader);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new ifc.form._XUpdateBroadcaster.UpdateChecker() {
+ private String lastText = "" ;
+ public void update() throws com.sun.star.uno.Exception {
+ formLoader.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, formLoader) ;
+
+ bound.commit() ;
+ update.updateRow() ;
+ }
+ public boolean wasCommited() throws com.sun.star.uno.Exception {
+ formLoader.reload() ;
+
+ String getS = (String) ps.getPropertyValue("Text") ;
+ return lastText.equals(getS) ;
+ }
+ }) ;
+
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // 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..e293c3ce8784
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java
@@ -0,0 +1,269 @@
+/*************************************************************************
+ *
+ * $RCSfile: OCurrencyControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..ed5f2a4f67a9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OCurrencyModel.java
@@ -0,0 +1,288 @@
+/*************************************************************************
+ *
+ * $RCSfile: OCurrencyModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+import com.sun.star.sdbc.XConnection;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.FormTools;
+import util.WriterTools;
+
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates CurrencyField in the Form, then binds it to Bibliography
+ * 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>
+ * </ul>
+ * @see ifc.form._XUpdateBroadcaster
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ DBTools tools = new DBTools(Param.getMSF()) ;
+ XConnection con = tools.connectToTestDB
+ ((String)Param.get("DOCPTH")) ;
+ tools.initializeTestTable(con, "TestDB") ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ }
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"CurrencyField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ final XLoadable formLoader = FormTools.bindForm(xTextDoc);
+ final XPropertySet ps = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oObj) ;
+
+ // binding control to the "Identifier" field of "biblio" table.
+ try {
+ ps.setPropertyValue("DataField", "Identifier") ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Can't set DataField property of the control.") ;
+ throw new StatusException
+ ("Can't set DataField property of the control.", e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Can't set DataField property of the control.") ;
+ throw new StatusException
+ ("Can't set DataField property of the control.", e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Can't set DataField property of the control.") ;
+ throw new StatusException
+ ("Can't set DataField property of the control.", e) ;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Can't set DataField property of the control.") ;
+ throw new StatusException
+ ("Can't set DataField property of the control.", e) ;
+ }
+
+ log.println( "creating a new environment for OCurrencyModel object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ String objName = "CurrencyField";
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC",aShape.getControl());
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL",formLoader);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new ifc.form._XUpdateBroadcaster.UpdateChecker() {
+ private double lastVal = 0 ;
+ public void update() throws com.sun.star.uno.Exception {
+ formLoader.load() ;
+ Double val = (Double) ps.getPropertyValue("Value") ;
+ if (val == null) val = new Double(0) ;
+ lastVal = val.doubleValue() + 1;
+ ps.setPropertyValue("Value", new Double(lastVal)) ;
+ }
+ public void commit() throws com.sun.star.sdbc.SQLException {
+ XBoundComponent bound = (XBoundComponent) UnoRuntime.
+ queryInterface(XBoundComponent.class, ctrl) ;
+ XResultSetUpdate update = (XResultSetUpdate) UnoRuntime.
+ queryInterface(XResultSetUpdate.class, formLoader) ;
+
+ bound.commit() ;
+ update.updateRow() ;
+ }
+ public boolean wasCommited() throws com.sun.star.uno.Exception {
+ formLoader.reload() ;
+
+ Double getD = (Double) ps.getPropertyValue("Value") ;
+ return getD.doubleValue() == lastVal ;
+ }
+ }) ;
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // 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..b2a9b56013cc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java
@@ -0,0 +1,715 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODatabaseForm.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XForm;
+import com.sun.star.form.XLoadable;
+import com.sun.star.io.XDataInputStream;
+import com.sun.star.io.XTextInputStream;
+import com.sun.star.lang.XMultiServiceFactory;
+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.sdbcx.XRowLocate;
+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 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;
+
+/**
+ * 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::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._XPropertySet
+ * @see ifc.sdbc._RowSet
+ */
+public class ODatabaseForm extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ protected final static String dbSourceName = "ODatabaseFormDataSource" ;
+
+ private static int uniqueSuffix = 0 ;
+ private DBTools dbTools = null ;
+ private static String origDB = null ;
+ private static String tmpDir = null ;
+ String tableName = null;
+ DBTools.DataSourceInfo srcInf = null;
+ boolean isMySQLDB = false;
+ protected XConnection conn = null;
+
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ log.println( "creating a draw document" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+
+ tmpDir = utils.getOfficeTemp(tParam.getMSF());
+
+ origDB = util.utils.getFullTestDocName("TestDB/testDB.dbf");
+
+ dbTools = new DBTools(tParam.getMSF()) ;
+
+ // 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";
+ srcInf.Info = propInfo;
+ Object 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 {
+ srcInf.URL = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir) ;
+ Object 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(tParam.getMSF()) +
+ tableName + ".dbf";
+ } while (!utils.overwriteFile(tParam.getMSF(), oldF, newF)
+ && uniqueSuffix++ < 50);
+ }
+ }
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ //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 {
+ XNameContainer formElements = (XNameContainer)
+ UnoRuntime.queryInterface
+ (XNameContainer.class, forms.getByName("MyForm")) ;
+
+ 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) (FormTools.getForms(
+ WriterTools.getDrawPage(xTextDoc))).getByName("MyForm");
+
+ XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oObj) ;
+ connection = (XConnection)
+ 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);
+ } 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.");
+ throw new StatusException
+ ("Cann'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}) ;
+ params.add(new Date(26, 1, 2001)) ;
+ params.add(new Time(1, 25, 14, 12)) ;
+ params.add(new DateTime(1, 25, 14, 12, 26, 1, 2001)) ;
+ */
+ tEnv.addObjRelation("XParameters.ParamValues", params) ;
+
+ // Adding relation for XDeleteRows ifc test
+ final XRowLocate rowLoc = (XRowLocate)
+ UnoRuntime.queryInterface(XRowLocate.class, oObj);
+ final XResultSet bMarkResSet = (XResultSet)
+ UnoRuntime.queryInterface(XResultSet.class, oObj);
+
+ // 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.
+ try {
+ XMultiServiceFactory xMSF = Param.getMSF() ;
+ Object oBinStream = xMSF.
+ createInstance("com.sun.star.io.DataInputStream") ;
+ XDataInputStream xBinStream = (XDataInputStream)
+ UnoRuntime.queryInterface(XDataInputStream.class,
+ oBinStream) ;
+ Object oCharStream = xMSF.
+ createInstance("com.sun.star.io.TextInputStream");
+ XTextInputStream xCharStream = (XTextInputStream)
+ UnoRuntime.queryInterface(XTextInputStream.class,
+ oCharStream);
+ Object obj = xMSF.createInstance("com.sun.star.io.Pipe");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Object relation cannot be created");
+ e.printStackTrace(log);
+ throw new StatusException(
+ "Object relation cannot be created", e);
+ }
+
+ 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);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ /**
+ * Closes connection of <code>RowSet</code> instance created.
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ 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( " disposing xTextDoc " );
+ xTextDoc.dispose();
+
+ try {
+ dbTools.revokeDB(dbSourceName) ;
+ } 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) ;
+ }
+ }
+
+} // 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..151b99990e2d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ODateControl.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODateControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..1540adf25854
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ODateModel.java
@@ -0,0 +1,315 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODateModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.FormTools;
+import util.WriterTools;
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"DateField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = null ;
+ try {
+ DBTools dbTools = new DBTools(Param.getMSF()) ;
+ dbTools.registerTestDB((String) System.getProperty("DOCPTH")) ;
+
+ formLoader = FormTools.bindForm(xTextDoc,
+ "APITestDatabase", "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 ODateModel object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ String objName = "DateField";
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ final XPropertySet ps = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ try {
+ //ps.setPropertyValue("DefaultDate", new Integer(777));
+ ps.setPropertyValue("DataField", DBTools.TST_DATE_F) ;
+ ps.setPropertyValue("Date", new Integer(20010101)) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ }
+
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC",aShape.getControl());
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL",formLoader);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+ final XLoadable formLoaderF = formLoader ;
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new ifc.form._XUpdateBroadcaster.UpdateChecker() {
+ private int lastDate = 0 ;
+ public void update() throws com.sun.star.uno.Exception {
+ if (!formLoaderF.isLoaded()) {
+ formLoaderF.load() ;
+ }
+ Integer dat = (Integer)ps.getPropertyValue("Date") ;
+ if (dat != null)
+ lastDate = dat.intValue() + 1 ;
+ ps.setPropertyValue("Date", new Integer(lastDate)) ;
+ }
+ 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 getD = (Integer) ps.getPropertyValue("Date") ;
+ return getD != null && getD.intValue() == lastDate ;
+ }
+ }) ;
+
+ // 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);
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // 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..2d9fb7a32c75
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OEditControl.java
@@ -0,0 +1,277 @@
+/*************************************************************************
+ *
+ * $RCSfile: OEditControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..8936378e7c10
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OEditModel.java
@@ -0,0 +1,303 @@
+/*************************************************************************
+ *
+ * $RCSfile: OEditModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.FormTools;
+import util.WriterTools;
+
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * First <code>TestDB</code> database is registered.
+ * Creates TextField 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 ('_TEXT') to bind control to.
+ * </li>
+ * </ul>
+ * @see ifc.form._XUpdateBroadcaster
+ */
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"TextField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = null ;
+ try {
+ DBTools dbTools = new DBTools(Param.getMSF()) ;
+ dbTools.registerTestDB((String) Param.get("DOCPTH")) ;
+
+ formLoader = FormTools.bindForm(xTextDoc,
+ "APITestDatabase", "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 OEditModel object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ String objName = "Edit";
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ final XPropertySet ps = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ try {
+ //ps.setPropertyValue("DefaultDate", new Integer(777));
+ ps.setPropertyValue("DataField", DBTools.TST_STRING_F) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ }
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC",aShape.getControl());
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL",formLoader);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+ final XLoadable formLoaderF = formLoader ;
+
+ 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 {
+ formLoaderF.reload() ;
+
+ String getS = (String) ps.getPropertyValue("Text") ;
+ return lastText.equals(getS) ;
+ }
+ }) ;
+
+ // adding relation for DataAwareControlModel service
+ tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
+ DBTools.TST_STRING_F) ;
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // 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..6e9ad3514704
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java
@@ -0,0 +1,226 @@
+/*************************************************************************
+ *
+ * $RCSfile: OFileControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XControlModel;
+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 java.io.PrintWriter;
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+/**
+* 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::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.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( 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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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>
+ */
+ 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" );
+
+ //get FileControlModel
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF());
+ 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);
+
+ 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..fcef87dea3ab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFixedTextModel.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * $RCSfile: OFixedTextModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+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.SOfficeFactory;
+
+/**
+* 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::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.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 TestCase {
+
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Draw document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 Draw document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates FixedText 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 a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF());
+
+ //get TextModel
+ String objName = "FixedText";
+
+ XControlShape aShape = FormTools.createControlShape
+ (xDrawDoc,3000,4500,15000,10000, objName);
+
+ 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);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // 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..3c3742315f77
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFormattedControl.java
@@ -0,0 +1,258 @@
+/*************************************************************************
+ *
+ * $RCSfile: OFormattedControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..32fc3a07a810
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFormattedFieldWrapper.java
@@ -0,0 +1,274 @@
+/*************************************************************************
+ *
+ * $RCSfile: OFormattedFieldWrapper.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.FormTools;
+import util.WriterTools;
+import util.utils;
+
+/**
+ * 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::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._XPropertySet
+ * @see ifc.form._XLoadListener
+ * @see ifc.awt._UnoControlFormattedFieldModel
+ * @see ifc.container._XChild
+ */
+public class OFormattedFieldWrapper extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates a new text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes the text document created before
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates FormattedField in the Form, then binds it to
+ * 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>
+ * </ul>
+ * @see ifc.form._XUpdateBroadcaster
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ XControlShape aShape = FormTools.createControlShapeWithDefaultControl(
+ xTextDoc,3000,4500,15000,10000,"DatabaseFormattedField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = FormTools.bindForm(xTextDoc);
+
+ final XPropertySet ps = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ try {
+ ps.setPropertyValue("DataField", "Custom2") ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ }
+
+ log.println( "creating a new environment for OFormattedFieldWrapper object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ String objName = "Edit";
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC",aShape.getControl());
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL",formLoader);
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+ final XLoadable formLoaderF = formLoader ;
+ final PrintWriter fLog = log ;
+
+ 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() ;
+ Object gVal = ps.getPropertyValue("Text") ;
+ fLog.println("Old: '" + gVal + "'") ;
+ lastText = utils.isVoid(lastText) ? "1" : "1" + (String)gVal ;
+ fLog.println("New: '" + lastText + "'") ;
+ 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 {
+ formLoaderF.reload() ;
+
+ String getS = (String) ps.getPropertyValue("Text") ;
+ fLog.println("Result: '" + getS + "'") ;
+ return lastText.equals(getS) ;
+ }
+ }) ;
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // 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..6e1c86140424
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OFormsCollection.java
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * $RCSfile: OFormsCollection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.form.XForm;
+import com.sun.star.lang.XComponent;
+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;
+
+/**
+* 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( tParam.getMSF() );
+ }
+
+ /**
+ * Disposes drawing document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ XForm oForm = 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 = 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..9f5a2097003d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OGridControlModel.java
@@ -0,0 +1,319 @@
+/*************************************************************************
+ *
+ * $RCSfile: OGridControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.form.XGridColumnFactory;
+import com.sun.star.lang.XComponent;
+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.FormTools;
+import util.SOfficeFactory;
+import java.util.Comparator;
+import com.sun.star.container.XNamed;
+
+/**
+* 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::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.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 TestCase {
+
+ XComponent xDrawDoc = null;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * <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;
+ 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
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF() );
+ 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");
+ } 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});
+ 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;
+ } });
+
+ int THRCNT = Integer.parseInt((String)Param.get("THRCNT"));
+
+ // 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()) ;
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+
+ // adding relation for XContainer
+ tEnv.addObjRelation("INSTANCE", aControl3) ;
+ tEnv.addObjRelation("INSTANCE2", aControl4) ;
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ 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..e231d964ab96
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java
@@ -0,0 +1,231 @@
+/*************************************************************************
+ *
+ * $RCSfile: OGroupBoxControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object anotherCtrl = null ;
+ XWindowPeer the_win = null;
+ XWindowPeer the_win2 = 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..3c3271aa21aa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OGroupBoxModel.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * $RCSfile: OGroupBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.lang.XComponent;
+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.SOfficeFactory;
+
+/**
+* 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::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.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 TestCase {
+
+ XComponent xDrawDoc = null ;
+
+ /**
+ * Creates Drawing document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * <code>GroupBox</code> component created and added to the draw
+ * page.
+ * 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( Param.getMSF());
+
+ //get GroupBoxModel
+ String objName = "GroupBox";
+
+ XControlShape shape = FormTools.insertControlShape
+ (xDrawDoc, 5000, 7000, 2000, 2000, objName) ;
+ oObj = shape.getControl() ;
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ log.println( "adding DrawDocument as obj relation to environment" );
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // 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..8fa3c7ba74cf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OHiddenModel.java
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * $RCSfile: OHiddenModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.lang.XComponent;
+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.SOfficeFactory;
+
+/**
+* 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::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.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( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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( 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) 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");
+
+ 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..e87aba382b42
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * $RCSfile: OImageButtonControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..eb528adf81e1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OImageButtonModel.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * $RCSfile: OImageButtonModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.lang.XComponent;
+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.SOfficeFactory;
+
+/**
+* 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::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.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 TestCase {
+
+ XComponent xDrawDoc;
+
+ /**
+ * Creates Draw document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 Draw document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * Creates Image button and adds it to the document.
+ * 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( Param.getMSF());
+ String objName = "ImageButton";
+ //get ImageButtonModel
+
+ XControlShape shape = FormTools.insertControlShape
+ (xDrawDoc, 5000, 7000, 2000, 2000, objName) ;
+ oObj = shape.getControl() ;
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // 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..1effe5bbc35d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OImageControlControl.java
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * $RCSfile: OImageControlControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..5ae51baf6729
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OImageControlModel.java
@@ -0,0 +1,266 @@
+/*************************************************************************
+ *
+ * $RCSfile: OImageControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.form.XLoadable;
+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.DBTools;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * First <code>TestDB</code> database is registered.
+ * Creates ImageControl in the Form, then binds it to TestDB
+ * database and returns component'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>'DataAwareControlModel.NewFieldName'</code> : for
+ * <code>com.sun.star.form.DataAwareControlModel</code> service
+ * which contains new name of the field to bind control to.
+ * </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( Param.getMSF());
+ String objName = "DatabaseImageControl";
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,objName);
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = null ;
+ try {
+ DBTools dbTools = new DBTools(Param.getMSF()) ;
+ dbTools.registerTestDB((String) System.getProperty("DOCPTH")) ;
+
+ formLoader = FormTools.bindForm(xTextDoc,
+ "APITestDatabase", "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) ;
+ }
+
+ final XPropertySet ps = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ try {
+ ps.setPropertyValue("DataField", DBTools.TST_BINARY_STREAM_F) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ }
+
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.one.form.component.ImageControl");
+
+ // adding relations for DataAwareControlModel service
+ tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
+ DBTools.TST_CHARACTER_STREAM_F) ;
+ tEnv.addObjRelation("FL", formLoader) ;
+ tEnv.addObjRelation("LC", aShape.getControl()) ;
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // 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..230f48bce538
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OListBoxControl.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * $RCSfile: OListBoxControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+public class OListBoxControl extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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);
+
+ tEnv.addObjRelation("XWindow.AnotherWindow",forObjRel);
+ tEnv.addObjRelation("XWindow.ControlShape",aShape);
+
+ // 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..b0bf06825868
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OListBoxModel.java
@@ -0,0 +1,297 @@
+/*************************************************************************
+ *
+ * $RCSfile: OListBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * First <code>TestDB</code> database is registered.
+ * Creates ListBox 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 to bind control to.
+ * </li>
+ * </ul>
+ * @see ifc.form._XUpdateBroadcaster
+ */
+ 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( Param.getMSF());
+ String objName = "ListBox";
+
+ //get ListBoxModel
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,objName);
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = null ;
+ try {
+ DBTools dbTools = new DBTools(Param.getMSF()) ;
+ dbTools.registerTestDB((String) System.getProperty("DOCPTH")) ;
+
+ formLoader = FormTools.bindForm(xTextDoc,
+ "APITestDatabase", "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) ;
+ }
+
+ final XPropertySet ps = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ try {
+ ps.setPropertyValue("DataField", DBTools.TST_STRING_F) ;
+ ps.setPropertyValue("ListSource",
+ new String[] {"OListBoxModel1", "OListBoxModel2",
+ "OListBoxModel3"}) ;
+ }
+ catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ }
+
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("OBJNAME",
+ "stardiv.one.form.component." + objName);
+
+ // adding relations for DataAwareControlModel service
+ tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
+ DBTools.TST_STRING_F) ;
+ tEnv.addObjRelation("FL", formLoader) ;
+ tEnv.addObjRelation("LC", aShape.getControl()) ;
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+ final XLoadable formLoaderF = formLoader ;
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new ifc.form._XUpdateBroadcaster.UpdateChecker() {
+ private short lastItem = (short) 0 ;
+ public void update() throws com.sun.star.uno.Exception {
+ if (!formLoaderF.isLoaded())
+ formLoaderF.load() ;
+ lastItem = (short) (1 - lastItem) ;
+ ps.setPropertyValue("SelectedItems",
+ new short[] {lastItem} ) ;
+ }
+ 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() ;
+
+ short[] getS = (short[]) ps.getPropertyValue
+ ("SelectedItems") ;
+ return getS.length > 0 && lastItem == getS[0] ;
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class OListBoxModel
+
diff --git a/qadevOOo/tests/java/mod/_forms/ONumericControl.java b/qadevOOo/tests/java/mod/_forms/ONumericControl.java
new file mode 100644
index 000000000000..a743a388803d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ONumericControl.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * $RCSfile: ONumericControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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);
+
+ 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..eab2209ae939
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ONumericModel.java
@@ -0,0 +1,295 @@
+/*************************************************************************
+ *
+ * $RCSfile: ONumericModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * First <code>TestDB</code> database is registered.
+ * Creates Numeric field 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 to bind control to.
+ * </li>
+ * </ul>
+ * @see ifc.form._XUpdateBroadcaster
+ */
+ 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( Param.getMSF());
+ String objName = "NumericField";
+
+ //get ListBoxModel
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,objName);
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = null ;
+ try {
+ DBTools dbTools = new DBTools(Param.getMSF()) ;
+ dbTools.registerTestDB((String) System.getProperty("DOCPTH")) ;
+
+ formLoader = FormTools.bindForm(xTextDoc,
+ "APITestDatabase", "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) ;
+ }
+
+ final XPropertySet ps = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ try {
+ ps.setPropertyValue("DataField", DBTools.TST_DOUBLE_F) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ }
+
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+
+ // adding relations for DataAwareControlModel service
+ tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
+ DBTools.TST_DOUBLE_F) ;
+ tEnv.addObjRelation("FL", formLoader) ;
+ tEnv.addObjRelation("LC", aShape.getControl()) ;
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+ final XLoadable formLoaderF = formLoader ;
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new ifc.form._XUpdateBroadcaster.UpdateChecker() {
+ private double lastVal = 0 ;
+ public void update() throws com.sun.star.uno.Exception {
+ if (!formLoaderF.isLoaded())
+ formLoaderF.load() ;
+ lastVal = lastVal + 1.1 ;
+ ps.setPropertyValue("Value", new Double(lastVal)) ;
+ }
+ 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() ;
+
+ Double getV = (Double) ps.getPropertyValue("Value") ;
+ return lastVal == getV.doubleValue() ;
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // 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..5b4909baa6b6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OPatternControl.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * $RCSfile: OPatternControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..5330f9e60fac
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OPatternModel.java
@@ -0,0 +1,303 @@
+/*************************************************************************
+ *
+ * $RCSfile: OPatternModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+/**
+ * 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * First <code>TestDB</code> database is registered.
+ * Creates Pattern field 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 to bind control to.
+ * </li>
+ * </ul>
+ * @see ifc.form._XUpdateBroadcaster
+ */
+ 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( Param.getMSF());
+ String objName = "PatternField";
+
+ //get PatternModel
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,objName);
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = null ;
+ try {
+ DBTools dbTools = new DBTools(Param.getMSF()) ;
+ dbTools.registerTestDB((String) System.getProperty("DOCPTH")) ;
+
+ formLoader = FormTools.bindForm(xTextDoc,
+ "APITestDatabase", "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) ;
+ }
+
+ final XPropertySet ps = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ try {
+ ps.setPropertyValue("DataField", DBTools.TST_STRING_F) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ }
+
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC",aShape.getControl());
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL",formLoader);
+ tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
+ DBTools.TST_STRING_F) ;
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+ final XLoadable formLoaderF = formLoader ;
+
+ 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 {
+ formLoaderF.reload() ;
+
+ String getS = (String) ps.getPropertyValue("Text") ;
+ return lastText.equals(getS) ;
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // 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..5c9293c96dbe
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java
@@ -0,0 +1,240 @@
+/*************************************************************************
+ *
+ * $RCSfile: ORadioButtonControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..78d8ccc58129
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/ORadioButtonModel.java
@@ -0,0 +1,301 @@
+/*************************************************************************
+ *
+ * $RCSfile: ORadioButtonModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.WriterTools;
+
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ log.println( "creating a text document" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * First <code>TestDB</code> database is registered.
+ * Creates radio button 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 to bind control to.
+ * </li>
+ * </ul>
+ * @see ifc.form._XUpdateBroadcaster
+ */
+ 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( Param.getMSF());
+
+ //get RadioButtonModel
+ String objName = "RadioButton";
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,objName);
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = null ;
+ try {
+ DBTools dbTools = new DBTools(Param.getMSF()) ;
+ dbTools.registerTestDB((String) System.getProperty("DOCPTH")) ;
+
+ formLoader = FormTools.bindForm(xTextDoc,
+ "APITestDatabase", "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) ;
+ }
+
+ final XPropertySet ps = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ try {
+ ps.setPropertyValue("DataField", DBTools.TST_STRING_F) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ }
+
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"GroupBox");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC",aShape.getControl());
+
+ //adding ObjRelation for XPersistObject
+ tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL",formLoader);
+ tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
+ DBTools.TST_INT_F) ;
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+ final XLoadable formLoaderF = formLoader ;
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new ifc.form._XUpdateBroadcaster.UpdateChecker() {
+ private short lastVal = 0 ;
+ public void update() throws com.sun.star.uno.Exception {
+ if (!formLoaderF.isLoaded())
+ formLoaderF.load() ;
+ lastVal = (short) (1 - lastVal) ;
+ ps.setPropertyValue("State", new Short(lastVal)) ;
+ }
+ 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) ;
+
+ // XBoundComponent is optional here
+ if (bound != null) bound.commit() ;
+ update.updateRow() ;
+ }
+ public boolean wasCommited() throws com.sun.star.uno.Exception {
+ formLoaderF.reload() ;
+
+ Short getS = (Short) ps.getPropertyValue("State") ;
+ return getS != null && lastVal == getS.shortValue() ;
+ }
+ }) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class ORadioButtonModel
+
diff --git a/qadevOOo/tests/java/mod/_forms/OTimeControl.java b/qadevOOo/tests/java/mod/_forms/OTimeControl.java
new file mode 100644
index 000000000000..2ff0ce01479a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OTimeControl.java
@@ -0,0 +1,277 @@
+/*************************************************************************
+ *
+ * $RCSfile: OTimeControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.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;
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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(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..7a3e8ddfe404
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_forms/OTimeModel.java
@@ -0,0 +1,312 @@
+/*************************************************************************
+ *
+ * $RCSfile: OTimeModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:14:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._forms;
+
+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.XLoadable;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DBTools;
+import util.FormTools;
+import util.WriterTools;
+
+/**
+* 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::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.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 TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates Writer document where controls are placed.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * First <code>TestDB</code> database is registered.
+ * Creates Pattern field 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 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
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ XControlShape aShape = FormTools.createControlShape(
+ xTextDoc,3000,4500,15000,10000,"TimeField");
+
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+ oObj = aShape.getControl();
+
+ XLoadable formLoader = null ;
+ try {
+ DBTools dbTools = new DBTools(Param.getMSF()) ;
+ dbTools.registerTestDB((String) System.getProperty("DOCPTH")) ;
+
+ formLoader = FormTools.bindForm(xTextDoc,
+ "APITestDatabase", "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 );
+ String objName = "TimeField";
+ tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + objName);
+ aShape = FormTools.createControlShape(
+ xTextDoc,6000,4500,15000,10000,"FixedText");
+ WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
+
+ final XPropertySet ps = (XPropertySet)UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+ try {
+ ps.setPropertyValue("DataField", DBTools.TST_INT_F) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't set Default Date", e );
+ }
+
+ // added LabelControl for 'DataAwareControlModel'
+ tEnv.addObjRelation("LC",aShape.getControl());
+
+ // added FormLoader for 'DataAwareControlModel'
+ tEnv.addObjRelation("FL",formLoader);
+
+ // adding relation for XUpdateBroadcaster
+ final XInterface ctrl = oObj ;
+ final XLoadable formLoaderF = formLoader ;
+
+ tEnv.addObjRelation("XUpdateBroadcaster.Checker",
+ new ifc.form._XUpdateBroadcaster.UpdateChecker() {
+ 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 ;
+ }
+ }) ;
+
+ // adding relation for DataAwareControlModel service
+ tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
+ DBTools.TST_INT_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);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // 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..2e26e17a7fb5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fps/FilePicker.java
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * $RCSfile: FilePicker.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fps;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ui.dialogs.XFilePickerControlAccess;
+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.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 = Param.getMSF();
+ Object relationContainer = null ;
+
+ 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" );
+
+ XFilePickerControlAccess ca = (XFilePickerControlAccess)
+ UnoRuntime.queryInterface(XFilePickerControlAccess.class,
+ oInterface) ;
+ } 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..722a2e34607a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ftransl/DataFormatTranslator.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: DataFormatTranslator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ftransl;
+
+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.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 = 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/Desktop.java b/qadevOOo/tests/java/mod/_fwk/Desktop.java
new file mode 100644
index 000000000000..d097b4c59495
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/Desktop.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * $RCSfile: Desktop.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.frame.XDesktop;
+import util.SOfficeFactory;
+
+/**
+* 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( Param.getMSF());
+
+ String url = util.utils.getFullTestURL("XDocumentInsertable.sxw");
+
+ 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)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
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java
new file mode 100644
index 000000000000..11f95955f80d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * $RCSfile: DispatchRecorder.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.beans.XPropertySet;
+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.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;
+import util.SysUtils;
+
+/**
+* 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;
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(Param.getMSF());
+ oDoc = SOF.createTextDoc(null);
+
+ try {
+ Thread.sleep(1000);
+ }
+ catch (InterruptedException ex) {
+ }
+
+ xFrame = SysUtils.getActiveFrame(Param.getMSF());
+
+ XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xFrame);
+ Object oDRS = xFramePS.getPropertyValue("DispatchRecorderSupplier");
+ XDispatchRecorderSupplier xDRS = null;
+ if (oDRS == null) {
+ oDRS = Param.getMSF().createInstance(
+ "com.sun.star.comp.framework.DispatchRecorderSupplier");
+ xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS);
+ }
+ xDRS = (XDispatchRecorderSupplier)
+ UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS);
+
+ XDispatchRecorder xDR = xDRS.getDispatchRecorder();
+ if (xDR != null) {
+ oObj = xDR;
+ } else {
+ oObj = (XInterface)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);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XDispatchRecorder.Frame", xFrame);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ oDoc.dispose();
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java
new file mode 100644
index 000000000000..715f21576016
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorderSupplier.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: DispatchRecorderSupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.text.XTextDocument;
+import util.SOfficeFactory;
+import com.sun.star.frame.XDispatchRecorder;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* 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;
+ Object recorder = null;
+
+ try {
+ oObj = (XInterface)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
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java b/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java
new file mode 100644
index 000000000000..bee560fba75b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * $RCSfile: DocumentProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.text.XTextDocument;
+import util.SOfficeFactory;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.document.XDocumentInfoSupplier;
+
+/**
+* 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( 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) ;
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fwk/Frame.java b/qadevOOo/tests/java/mod/_fwk/Frame.java
new file mode 100644
index 000000000000..b11590212413
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/Frame.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * $RCSfile: Frame.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.util.*;
+import com.sun.star.beans.*;
+import com.sun.star.uno.XInterface;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.frame.*;
+import com.sun.star.uno.UnoRuntime;
+import util.SOfficeFactory;
+import util.DesktopTools;
+
+/**
+* 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( 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 {
+ xTextDoc.dispose();
+ frame.dispose();
+ } catch(Exception e){}
+
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java
new file mode 100644
index 000000000000..2491af1c398c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java
@@ -0,0 +1,371 @@
+/*************************************************************************
+ *
+ * $RCSfile: JobExecutor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.comp.helper.RegistryServiceFactory;
+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.registry.XImplementationRegistration;
+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 java.io.PrintWriter;
+import lib.Status;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+//import tools.SOLink;
+import util.utils;
+
+/**
+ * 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>SOLink.getMSF()</code> call.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ boolean serviceRegistered = false;
+ boolean configured = false;
+
+ try {
+ Object obj = 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.");
+
+
+ XNameAccess jobs = null;
+ XNameAccess events = null;
+ try {
+ Object obj = 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");
+ xNewJobNR.replaceByName("AdminTime", "01.01.2001/00:00:01");
+ xNewJobNR.replaceByName("UserTime", "01.01.2001/00:00:00");
+ 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();
+ XNameReplace xNewEventNR = (XNameReplace)
+ UnoRuntime.queryInterface(XNameReplace.class, oNewEvent);
+ xNewEventNR.replaceByName("Joblist", new String[] {"TestJob"});
+ 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);
+ }
+ }
+
+ String regFile = utils.getOfficeURL(Param.getMSF()) + "/types.rdb";
+
+ if (!configured || !serviceRegistered) {
+ log.println("Destroying SOffice ...");
+// SOLink link = Param.getSOLink();
+// link.destroyConnection();
+ }
+
+ if (!serviceRegistered) {
+ try {
+ log.println("Registry: " + regFile);
+ Object serviceManager = RegistryServiceFactory.create(regFile);
+ XMultiServiceFactory serviceManager_xMultiServiceFactory =
+ (XMultiServiceFactory)UnoRuntime.queryInterface(
+ XMultiServiceFactory.class, serviceManager);
+
+ Object implementationRegistration =
+ serviceManager_xMultiServiceFactory.createInstance
+ ("com.sun.star.registry.ImplementationRegistration");
+ XImplementationRegistration
+ implementationRegistration_xImplementationRegistration =
+ (XImplementationRegistration)UnoRuntime.queryInterface
+ (XImplementationRegistration.class, implementationRegistration);
+
+ String compURL =
+ utils.getFullTestURL("qadevlibs/JobExecutor.jar");
+ log.println("Registering " + compURL);
+
+ implementationRegistration_xImplementationRegistration.
+ registerImplementation
+ ("com.sun.star.loader.Java2", compURL, null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Cann't register service", 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)Param.getMSF().createInstance(
+ "com.sun.star.comp.framework.JobExecutor");
+ job = (XInterface)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/MailToDispatcher.java b/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java
new file mode 100644
index 000000000000..c65f6c5360b8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/MailToDispatcher.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: MailToDispatcher.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+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;
+
+/**
+* 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)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
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java b/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java
new file mode 100644
index 000000000000..574da583ebee
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/ServiceHandler.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: ServiceHandler.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+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;
+
+/**
+* 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)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
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fwk/URLTransformer.java b/qadevOOo/tests/java/mod/_fwk/URLTransformer.java
new file mode 100644
index 000000000000..8f0849bc5a6f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwk/URLTransformer.java
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * $RCSfile: URLTransformer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwk;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.text.XTextDocument;
+import util.SOfficeFactory;
+
+/**
+* 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)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
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_fwl/FilterFactory.java b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java
new file mode 100644
index 000000000000..891505f4d631
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * $RCSfile: FilterFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+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;
+
+/**
+ * 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 ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = Param.getMSF().createInstance
+ ("com.sun.star.comp.framework.FilterFactory") ;
+ } 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 );
+
+ XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, oObj);
+ String[] filterNames = xNA.getElementNames();
+ Vector vFTypes = new Vector();
+ Vector vFArgs = new Vector();
+ for (int i = 0; i < filterNames.length; i++) {
+ PropertyValue[] filterProps = null;
+ try {
+ 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) getPropertyValue
+ (filterProps, "FilterService");
+ if (filterImpl != null && filterImpl.length() > 0) {
+ String filterType = (String) getPropertyValue
+ (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()][]));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+ protected Object getPropertyValue(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;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java b/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java
new file mode 100644
index 000000000000..130e619fb67f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/FrameLoaderFactory.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: FrameLoaderFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import com.sun.star.container.XNameAccess;
+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.utils;
+
+/**
+ * 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 ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = 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 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 );
+
+ XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
+ (XNameAccess.class, oObj);
+ tEnv.addObjRelation("XMSF.serviceNames", xNA.getElementNames());
+
+ 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..c77d41412dd3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/PathSettings.java
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * $RCSfile: PathSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import java.util.*;
+import lib.Status;
+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.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 {
+
+ /**
+ * 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 = 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);
+
+ 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..c12f7457843c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: TypeDetection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._fwl;
+
+import com.sun.star.container.XNameAccess;
+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.utils;
+
+/**
+ * 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 TypeDetection 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 ;
+
+ //now get the OButtonControl
+ try {
+ oInterface = 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 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 );
+
+// XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
+// (XNameAccess.class, oObj);
+// tEnv.addObjRelation("XMSF.serviceNames", xNA.getElementNames());
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_i18n/BreakIterator.java b/qadevOOo/tests/java/mod/_i18n/BreakIterator.java
new file mode 100644
index 000000000000..7625224c9c4b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/BreakIterator.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: BreakIterator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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;
+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.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( 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 = 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..7433ee373398
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/CalendarImpl.java
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * $RCSfile: CalendarImpl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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.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 = 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..99950b85ffdb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/ChapterCollator.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChapterCollator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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.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 = 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..0491c83f00a9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/CharacterClassification.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * $RCSfile: CharacterClassification.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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.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 = 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..5dd2b8e2c7ae
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/Collator.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: Collator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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.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 = 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..79c204a78b64
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/IndexEntrySupplier.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * $RCSfile: IndexEntrySupplier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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.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 = 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..39ce418d2f56
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/LocaleData.java
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * $RCSfile: LocaleData.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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.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 = 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..0e332ae1a081
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/NumberFormatCodeMapper.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: NumberFormatCodeMapper.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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.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 = 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..3b95ce5693de
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/TextSearch.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: TextSearch.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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.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 = 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..372dd3ff3d68
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_i18n/Transliteration.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: Transliteration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._i18n;
+
+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.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 = 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/_impreg/ImplementationRegistration.java b/qadevOOo/tests/java/mod/_impreg/ImplementationRegistration.java
new file mode 100644
index 000000000000..fb91829d3325
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_impreg/ImplementationRegistration.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * $RCSfile: ImplementationRegistration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._impreg;
+
+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.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 = 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..32938134b31b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_insp/Introspection.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: Introspection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._insp;
+
+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.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 = 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/_inv/Invocation.java b/qadevOOo/tests/java/mod/_inv/Invocation.java
new file mode 100644
index 000000000000..a614fab1644c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_inv/Invocation.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * $RCSfile: Invocation.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._inv;
+
+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 = 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..be2b61e533b8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_invadp/InvocationAdapterFactory.java
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: InvocationAdapterFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._invadp;
+
+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 = 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/_javaloader/JavaComponentLoader.java b/qadevOOo/tests/java/mod/_javaloader/JavaComponentLoader.java
new file mode 100644
index 000000000000..3b3f7ace965b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_javaloader/JavaComponentLoader.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: JavaComponentLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._javaloader;
+
+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.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 = 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 jarname = "MyPersistentObjectImpl.jar";
+ 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/_jdbc/JDBCDriver.java b/qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java
new file mode 100644
index 000000000000..829fe29c4086
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_jdbc/JDBCDriver.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * $RCSfile: JDBCDriver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._jdbc;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.beans.PropertyValue;
+import util.DBTools;
+
+
+/**
+* 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)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;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_jen/JavaVirtualMachine.java b/qadevOOo/tests/java/mod/_jen/JavaVirtualMachine.java
new file mode 100644
index 000000000000..ea98ee76fa2c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_jen/JavaVirtualMachine.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * $RCSfile: JavaVirtualMachine.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._jen;
+
+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 = 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..50b45e712f87
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lng/DicList.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * $RCSfile: DicList.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._lng;
+
+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;
+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.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 = 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..964739474999
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lng/LinguProps.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: LinguProps.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._lng;
+
+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.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 = 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..e6bc04741186
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lng/LngSvcMgr.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * $RCSfile: LngSvcMgr.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._lng;
+
+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.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 = 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..950442453a7d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lnn/Hyphenator.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: Hyphenator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._lnn;
+
+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 lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+ * 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 = 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..3c08ddfa46b7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lnn/SpellChecker.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * $RCSfile: SpellChecker.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._lnn;
+
+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.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 = tParam.getMSF();
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface)xMSF.createInstance
+ ("com.sun.star.linguistic2.SpellChecker");
+ } 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/_lnn/Thesaurus.java b/qadevOOo/tests/java/mod/_lnn/Thesaurus.java
new file mode 100644
index 000000000000..393d4936f36d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_lnn/Thesaurus.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: Thesaurus.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._lnn;
+
+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.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 = 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..a9127d7eca4a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_mcnttype/MimeContentTypeFactory.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: MimeContentTypeFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._mcnttype;
+
+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.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 = Param.getMSF();
+ Object relationContainer = null ;
+
+
+ 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..98a1fcea737a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_mozab/MozabDriver.java
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * $RCSfile: MozabDriver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:15:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._mozab;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.uno.XInterface;
+import com.sun.star.beans.PropertyValue;
+
+/**
+* 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)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;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_namingservice/NamingService.java b/qadevOOo/tests/java/mod/_namingservice/NamingService.java
new file mode 100644
index 000000000000..5c601389c4e7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_namingservice/NamingService.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: NamingService.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._namingservice;
+
+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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = 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",
+ 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/_odbc/ODBCDriver.java b/qadevOOo/tests/java/mod/_odbc/ODBCDriver.java
new file mode 100644
index 000000000000..818e4f1982a0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_odbc/ODBCDriver.java
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: ODBCDriver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._odbc;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import lib.StatusException;
+import com.sun.star.uno.XInterface;
+import lib.Status;
+import com.sun.star.beans.PropertyValue;
+
+/**
+ * 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)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;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_proxyfac/ProxyFactory.java b/qadevOOo/tests/java/mod/_proxyfac/ProxyFactory.java
new file mode 100644
index 000000000000..57855afc521a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_proxyfac/ProxyFactory.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: ProxyFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._proxyfac;
+
+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 = 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..8ccb7e2d21db
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * $RCSfile: SOffice52ProxySettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._proxyset;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import java.util.Hashtable;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+ * 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 = 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..3b9dbe6e78e7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * $RCSfile: SystemProxySettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._proxyset;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import java.util.Hashtable;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+ * 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 = 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/_rdbtdp/RegistryTypeDescriptionProvider.java b/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java
new file mode 100644
index 000000000000..a7caf02d7529
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * $RCSfile: RegistryTypeDescriptionProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._rdbtdp;
+
+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 java.io.PrintWriter;
+import lib.Status;
+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.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 = 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();
+ }
+ 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/_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..eb9c747cfce2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_remotebridge/various.java
@@ -0,0 +1,319 @@
+/*************************************************************************
+ *
+ * $RCSfile: various.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._remotebridge;
+
+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.EventObject;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XEventListener;
+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.utils;
+
+/**
+* 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 ;
+
+ private XAcceptor xAcctr;
+ 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
+ {
+ 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) ;
+ XBridge xBridge = 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 = 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") ;
+ XConnector xCntr = (XConnector)UnoRuntime.queryInterface(
+ XConnector.class, oCntr);
+
+ // create bridge factory
+ XInterface oBrdg = (XInterface)xMSF.createInstance(
+ "com.sun.star.bridge.BridgeFactory") ;
+ XBridgeFactory 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) {
+ xAcctr.stopAccepting();
+ if (accThread.isAlive()) {
+ accThread.interrupt();
+ }
+
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, bridge);
+ if (xComp != null && !bridgeDisposed[0])
+ xComp.dispose();
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java
new file mode 100644
index 000000000000..c8b5de1a98de
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessibleCell.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.awt.XWindow;
+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.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.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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 cell in the spreadsheet. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleTable</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleTable
+ * @see drafts.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 {
+
+ 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( 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);
+
+ XController xController = aModel.getCurrentController();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.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 = "Text for testing of the interface XAccessibleText";
+ try {
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) oIndexSheets.getByIndex(0);
+ xCell = oSheet.getCellByPosition(1, 0) ;
+ 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);
+ }
+
+ 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 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 " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ oComp.dispose();
+ }
+} \ 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..837e5fbf79a3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java
@@ -0,0 +1,240 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessibleCsvCell.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:16:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.awt.XWindow;
+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.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.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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 ScAccessibleCsvCell extends TestCase {
+
+ Thread lThread = null;
+ 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) 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();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //at.printAccessibleTree(log,xRoot);
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON, "Cancel");
+
+ accAction = (XAccessibleAction) UnoRuntime.queryInterface(XAccessibleAction.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.TABLE);
+
+ //util.dbg.printInterfaces(oObj);
+
+ XAccessibleContext cont = (XAccessibleContext)
+ UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
+
+ int count = cont.getAccessibleChildCount();
+
+ String name = "";
+ try {
+ XAccessible acc = cont.getAccessibleChild(3);
+ name = acc.getAccessibleContext().getAccessibleName();
+ System.out.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 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( " 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( Param.getMSF());
+
+ log.println("opening dialog");
+
+ lThread = new loadThread(SOF);
+ lThread.start();
+
+ }
+
+ /**
+ * 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 ;
+ public XComponent xSpreadSheedDoc = null;
+
+ public loadThread(SOfficeFactory SOF) {
+ this.SOF = SOF ;
+ }
+
+ public void run() {
+ try {
+ String url= utils.getFullTestURL("10test.csv");
+ log.println("loading "+url);
+ XComponent xSpreadsheetDoc = SOF.loadDocument(url);
+ } 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/ScAccessibleCsvGrid.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java
new file mode 100644
index 000000000000..a03da2c01f32
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessibleCsvGrid.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.awt.XWindow;
+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.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.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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 ScAccessibleCsvGrid extends TestCase {
+
+ Thread lThread = null;
+ 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) 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();
+
+ //log.println("Found "+tk.getTopWindowCount()+ " Windows");
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON, "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);
+
+ //at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.TABLE);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ XAccessibleComponent comp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ 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( " 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( Param.getMSF());
+
+ log.println("opening dialog");
+
+ lThread = new loadThread(SOF);
+ lThread.start();
+
+ }
+
+ /**
+ * 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 ;
+ public XComponent xSpreadSheedDoc = null;
+
+ public loadThread(SOfficeFactory SOF) {
+ this.SOF = SOF ;
+ }
+
+ public void run() {
+ try {
+ String url= utils.getFullTestURL("10test.csv");
+ log.println("loading "+url);
+ XComponent xSpreadsheetDoc = SOF.loadDocument(url);
+ } 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/ScAccessibleCsvRuler.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java
new file mode 100644
index 000000000000..7e1d77d580e3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessibleCsvRuler.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.awt.XWindow;
+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.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.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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 ScAccessibleCsvRuler extends TestCase {
+
+ Thread lThread = null;
+ 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) 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();
+
+ //log.println("Found "+tk.getTopWindowCount()+ " Windows");
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON, "Cancel");
+
+ accAction = (XAccessibleAction) UnoRuntime.queryInterface(XAccessibleAction.class, oObj);
+
+ XAccessibleContext acc = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.RADIOBUTTON);
+
+ System.out.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);
+
+ //at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.TEXT,"Ruler");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ XAccessibleComponent comp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ 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( " 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( Param.getMSF());
+
+ log.println("opening dialog");
+
+ lThread = new loadThread(SOF);
+ lThread.start();
+
+ }
+
+ /**
+ * 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 ;
+ public XComponent xSpreadSheedDoc = null;
+
+ public loadThread(SOfficeFactory SOF) {
+ this.SOF = SOF ;
+ }
+
+ public void run() {
+ try {
+ String url= utils.getFullTestURL("10test.csv");
+ log.println("loading "+url);
+ XComponent xSpreadsheetDoc = SOF.loadDocument(url);
+ } 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/ScAccessibleDocument.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java
new file mode 100644
index 000000000000..7531bd2b3b30
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java
@@ -0,0 +1,206 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessibleDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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;
+
+
+/**
+ * Test for object which is represented by accessible component of
+ * a spreadsheet document.
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.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 {
+
+ 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT, "");
+ //at.printAccessibleTree(log, xRoot);
+ 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() {
+ xDocWin.setFocus();
+ }
+ });
+
+ 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 " );
+ xSpreadsheetDoc.dispose();
+ }
+
+ /**
+ * 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( 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) ;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java
new file mode 100644
index 000000000000..bab289cdefce
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java
@@ -0,0 +1,281 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessibleDocumentPagePreview.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.Rectangle;
+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.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.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+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;
+
+/**
+ * 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>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.n.star.accessibility._XAccessibleComponent
+ * @see ifc.n.star.accessibility._XAccessibleContext
+ */
+public class ScAccessibleDocumentPagePreview extends TestCase {
+
+ 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) oIndexSheets.getByIndex(1);
+ xCell = oSheet.getCellByPosition(0, 0) ;
+ xCell.setFormula("ScAccessibleDocumentPagePreview - Page 2");
+ oSheet = (XSpreadsheet) oIndexSheets.getByIndex(2);
+ xCell = oSheet.getCellByPosition(0, 0) ;
+ xCell.setFormula("ScAccessibleDocumentPagePreview - Page 3");
+
+ oSheet = (XSpreadsheet) oIndexSheets.getByIndex(0);
+ 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,
+ 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ XAccessibleContext mainWin = at.getAccessibleObjectForRole(xRoot,AccessibleRole.LAYEREDPANE);
+ //Jump to last page and back to first to verify that #
+ try {
+ XAccessible PageViewObjectBar = mainWin.getAccessibleChild(2);
+ XAccessible FirstPage =
+ PageViewObjectBar.getAccessibleContext().getAccessibleChild(2);
+ log.println("Getting: "+
+ FirstPage.getAccessibleContext().getAccessibleName());
+ XAccessible LastPage =
+ PageViewObjectBar.getAccessibleContext().getAccessibleChild(3);
+ log.println("Getting "+
+ LastPage.getAccessibleContext().getAccessibleName());
+ XAccessibleAction pressLast = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, LastPage);
+ XAccessibleAction pressFirst = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, FirstPage);
+ pressLast.doAccessibleAction(0);
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+ pressFirst.doAccessibleAction(0);
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ibe) {}
+
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.DOCUMENT, "");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XDesktop desk = (XDesktop) UnoRuntime.queryInterface(
+ XDesktop.class,util.DesktopTools.createDesktop(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-1,rec.Width-1, (short) 15);
+ win.setPosSize(rec.X,rec.Y,rec.Height,rec.Width, (short) 15);
+ }
+ });
+
+ 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 " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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( 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));
+ } 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/ScAccessiblePageHeader.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
new file mode 100644
index 000000000000..69e96904e455
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
@@ -0,0 +1,297 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessiblePageHeader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.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.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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;
+
+/**
+ * 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>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.n.star.accessibility._XAccessibleComponent
+ * @see ifc.n.star.accessibility._XAccessibleContext
+ */
+public class ScAccessiblePageHeader extends TestCase {
+
+ 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) oIndexSheets.getByIndex(0);
+ 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,
+ 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.HEADER, "");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+// at.printAccessibleTree(log, xRoot);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ XStyle StdStyle = null;
+
+ try{
+ XNameAccess PageStyles = (XNameAccess)
+ StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle)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);
+ }
+
+ //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)
+ 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);
+ }
+
+ 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 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 " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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( 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..3045ba388f22
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java
@@ -0,0 +1,295 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessiblePageHeaderArea.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:16:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.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.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+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.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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 drafts.com.sun.star.accessibility.XAccessibleStateSet;
+
+/**
+ * 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>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.n.star.accessibility._XAccessibleComponent
+ * @see ifc.n.star.accessibility._XAccessibleContext
+ */
+public class ScAccessiblePageHeaderArea extends TestCase {
+
+ 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) 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);
+ }
+
+ 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,
+ 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(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)) {
+ System.out.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);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ XStyle StdStyle = null;
+
+ try{
+ XNameAccess PageStyles = (XNameAccess)
+ StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle)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);
+ }
+
+ XAccessible zoomIn = null;
+ try {
+ XAccessibleContext mainWin =
+ at.getAccessibleObjectForRole(xRoot,AccessibleRole.LAYEREDPANE);
+
+ XAccessible PageViewObjectBar = mainWin.getAccessibleChild(2);
+
+ zoomIn =
+ PageViewObjectBar.getAccessibleContext().getAccessibleChild(5);
+ log.println("Getting "+
+ zoomIn.getAccessibleContext().getAccessibleName());
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ibe) {}
+
+ 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 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 " );
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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( 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..d8466dfaa3f7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessiblePreviewCell.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import lib.TestCase;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.util.URL;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.StatusException;
+import util.SOfficeFactory;
+import util.AccessibilityTools;
+import lib.TestEnvironment;
+import util.utils;
+import lib.Status;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.frame.XModel;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.XCell;
+
+/**
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code>
+ * </li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code>
+ * </li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleValue</code>
+ * </li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul>
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.com.sun.star.accessibility.XAccessibleValue
+ * @see drafts.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+
+ /**
+ * 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) 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);
+ }
+
+ 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,
+ 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(Param.getMSF(), xModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL);
+
+ oObj = at.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);
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java
new file mode 100644
index 000000000000..896f8fc2fca7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java
@@ -0,0 +1,306 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessiblePreviewHeaderCell.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import lib.TestCase;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.util.URL;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.StatusException;
+import util.SOfficeFactory;
+import util.AccessibilityTools;
+import lib.TestEnvironment;
+import util.utils;
+import lib.Status;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.frame.XModel;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.XCell;
+
+import com.sun.star.sheet.XHeaderFooterContent;
+import com.sun.star.style.XStyle;
+import com.sun.star.text.XText;
+
+/**
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code>
+ * </li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code>
+ * </li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleValue</code>
+ * </li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul>
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.com.sun.star.accessibility.XAccessibleValue
+ * @see drafts.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 {
+ 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 ) {
+ XComponent oComp = (XComponent)UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc);
+ oComp.dispose();
+ }
+ }
+
+
+ /**
+ * 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);
+ oComp.dispose();
+ }
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) 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);
+ }
+
+ 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,
+ 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(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, "A");
+ }
+
+ 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..27ced391e782
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
@@ -0,0 +1,233 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessiblePreviewTable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import lib.TestCase;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.util.URL;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.StatusException;
+import util.SOfficeFactory;
+import util.AccessibilityTools;
+import lib.TestEnvironment;
+import util.utils;
+import lib.Status;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.frame.XModel;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.XCell;
+
+/**
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code>
+ * </li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code>
+ * </li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleTable</code>
+ * </li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul>
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.com.sun.star.accessibility.XAccessibleTable
+ * @see drafts.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Obtains the accessible object for a table in preview mode.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ 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) 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);
+ }
+
+ 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,
+ 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(Param.getMSF(), xModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ }
+ });
+
+ 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/ScAccessibleSpreadsheet.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
new file mode 100644
index 000000000000..ecbb0ffaab06
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAccessibleSpreadsheet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import lib.Status;
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.StatusException;
+import util.SOfficeFactory;
+import util.AccessibilityTools;
+import lib.TestEnvironment;
+import util.utils;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.frame.XModel;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.table.XCell;
+import com.sun.star.container.XIndexAccess;
+
+/**
+ * Test for accessible object of spreadsheet document.<p>
+ * Object implements the following interfaces:
+ * <ul>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code>
+ * </li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code>
+ * </li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleTable</code>
+ * </li>
+ * </ul>
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+
+ /**
+ * 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(Param.getMSF(), xModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE );
+
+ oObj = at.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) 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);
+ }
+
+ final XCell fCell = xCell ;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ fCell.setFormula("firing event");
+ fCell.setFormula(text);
+ }
+ });
+
+ return tEnv;
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java
new file mode 100644
index 000000000000..7c96424e9d44
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAnnotationObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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 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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates a spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+
+ /**
+ * 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 oInterface = null;
+ XInterface oObj = null;
+ boolean result = true;
+ 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" );
+
+ 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)
+ 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);
+ }
+
+ 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/ScAnnotationsObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java
new file mode 100644
index 000000000000..392374d282a9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAnnotationsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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.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 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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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.
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ boolean result = true;
+ 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" );
+
+ 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)
+ 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) ;
+ }
+
+ 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..81e9ecdd921b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAreaLinkObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XAreaLinks;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellAddress;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+
+ /**
+ * 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) props.getPropertyValue("AreaLinks") ;
+ CellAddress addr = new CellAddress ((short) 1,2,3) ;
+ links.insertAtPosition (addr, "", "a2:b5", "", "") ;
+
+ oObj = (XInterface) 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);
+ }
+
+ 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..37c008907d84
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAreaLinksObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XAreaLinks;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellAddress;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+
+ /**
+ * 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) 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) ;
+ links.insertAtPosition (addr, "", "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);
+ }
+
+ 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..2c46c078fb29
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAutoFormatFieldObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+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.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 {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF() );
+ log.println ("create Object ...") ;
+ // creation of testobject here
+ XInterface formats = (XInterface)Param.getMSF().createInstance
+ ("com.sun.star.sheet.TableAutoFormats");
+ XIndexAccess formatsIndex = (XIndexAccess)UnoRuntime.queryInterface
+ (XIndexAccess.class, formats);
+ XInterface format = (XInterface)formatsIndex.getByIndex(0);
+ XIndexAccess formatIndex = (XIndexAccess) UnoRuntime.queryInterface
+ (XIndexAccess.class, format);
+ oObj = (XInterface)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..dc3beaca74f2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAutoFormatObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+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.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)tParam.getMSF();
+ try {
+ XInterface formats = (XInterface)oMSF.createInstance
+ ("com.sun.star.sheet.TableAutoFormats");
+ XIndexAccess formatsIndex = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, formats);
+ oObj = (XInterface) 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..38a5c7f86f3e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScAutoFormatsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+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.SOfficeFactory;
+
+/**
+* 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{
+ XSpreadsheetDocument xSheetDoc = null;
+ SOfficeFactory SOF = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+
+ /**
+ * 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 oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = null;
+
+ try {
+ // creation of testobject here
+ // get AutoFormats
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc);
+ oObj = (XInterface)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 = 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..65855f2e4db6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellCursorObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XSheetCellCursor;
+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.XCellRange;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null ;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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);
+
+ oComp.dispose();
+ }
+
+ /**
+ * 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;
+ XSheetCellCursor oCellCursor = 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)
+ oSpreadsheets.getByName(oSpreadsheets.getElementNames()[0]) ;
+
+ XCellRange testRange = oSheet.getCellRangeByName("$A$1:$D$4") ;
+ XSheetCellRange testSheetRange = (XSheetCellRange)
+ UnoRuntime.queryInterface(XSheetCellRange.class, testRange);
+ oCellCursor = oSheet.createCursorByRange(testSheetRange) ;
+ oSheet.getCellByPosition(1,1).setValue(1) ;
+ oSheet.getCellByPosition(4,5).setValue(1) ;
+ } 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);
+ }
+
+ log.println("Test object successfully created.") ;
+
+ tEnv = new TestEnvironment(oCellCursor);
+
+ tEnv.addObjRelation("CRDESC","Column and RowDescriptions can't be changed for this Object");
+
+ tEnv.addObjRelation( "SHEET", oSheet );
+ tEnv.addObjRelation("NewData", new Object[][]{{"","","",""},
+ {"","2","3","4"},
+ {"","2","3","4"},
+ {"","2","3","4"}});
+
+ XPropertySet PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oCellCursor);
+ tEnv.addObjRelation("PropSet",PropSet);
+
+ return tEnv ;
+
+ } // finish method startAutoTest
+
+
+
+} // 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..95a16639f00c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java
@@ -0,0 +1,227 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellFieldObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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.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 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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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 oInterface = null;
+ 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)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..8e64a1655063
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellFieldsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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.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 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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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 oInterface = null;
+ 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)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..3c0ba1f975c7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellFormatsEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oInterface = null;
+ 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)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);
+ }
+
+ 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..fab2f03d5802
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellFormatsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment (
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oInterface = null;
+ 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)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);
+ }
+
+ 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..4ad8f4546e73
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellObj.java
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+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;
+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;
+
+/**
+* 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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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 oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = 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( Param.getMSF() );
+
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) oIndexSheets.getByIndex(0);
+
+ log.println("Getting a cell from sheet") ;
+ oObj = oSheet.getCellByPosition(2, 3) ;
+ } 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);
+ }
+
+ 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 ) );
+
+ 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..f3f7d3647a81
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellRangeObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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;
+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.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( 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( "Couldnt 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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 oInterface = null;
+ 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" );
+
+ XSpreadsheets oSpreadsheets = ( (XSpreadsheetDocument)
+ UnoRuntime.queryInterface(
+ XSpreadsheetDocument.class,
+ xSheetDoc) ).getSheets() ;
+ XNameAccess oNames = (XNameAccess)
+ UnoRuntime.queryInterface( XNameAccess.class, oSpreadsheets);
+
+ XSpreadsheet oSheet = null;
+ try {
+ oSheet = (XSpreadsheet)
+ oNames.getByName(oNames.getElementNames()[0]);
+
+ oObj = oSheet.getCellRangeByPosition( 0, 0, 3, 4 );
+ } 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);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation( "SHEET", oSheet );
+
+ XPropertySet PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ tEnv.addObjRelation("PropSet",PropSet);
+
+ 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..d11a16716007
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java
@@ -0,0 +1,269 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellRangesObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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( 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) 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 = 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);
+
+ 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..b8648196acab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellSearchObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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;
+import com.sun.star.util.XSearchable;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ 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" );
+
+ 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)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);
+ }
+
+ 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..2e6e0a219e32
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellTextCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ 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) 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) ;
+ }
+
+ 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..c39942997556
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellsEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = 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)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);
+ }
+
+ 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..45eae2eb55ca
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScCellsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = null;
+ XSpreadsheetDocument oSheetDoc = 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)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);
+ }
+
+ 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..d27a8c0bd9bd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScChartObj.java
@@ -0,0 +1,306 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScChartObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.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.UnoRuntime;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XSpreadsheet oSheet=null;
+
+ try {
+ System.out.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ oSheet = (XSpreadsheet) 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);
+ }
+
+ 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 {
+ oChart = (XTableChart) ((XNameAccess)UnoRuntime.queryInterface(
+ XNameAccess.class, oCharts)).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);
+ }
+
+ 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..3ab209c349fc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java
@@ -0,0 +1,300 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScChartsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.awt.Rectangle;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.UnoRuntime;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XSpreadsheet oSheet=null;
+
+ try {
+ System.out.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ oSheet = (XSpreadsheet) 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);
+ }
+
+ 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);
+
+ XTableChart oChart = null;
+
+ 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..021d526fa67c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScConsolidationDescriptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XConsolidatable;
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ 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" );
+
+ 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)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);
+ }
+
+ 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..9a7d2f19a103
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java
@@ -0,0 +1,283 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDDELinkObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+ XComponent oDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ if (oDoc != null) {
+ oDoc.dispose();
+ }
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+ XInterface oObj = null;
+
+ if (oDoc != null) {
+ oDoc.dispose();
+ }
+
+ // 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 = Param.getMSF();
+ try {
+ oInterface = oMSF.createInstance("com.sun.star.frame.Desktop");
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ // query the desktop interface and then it's componentloader
+ XDesktop oDesktop = ( XDesktop )
+ UnoRuntime.queryInterface(XDesktop.class, oInterface);
+ XComponentLoader oCLoader = ( XComponentLoader )
+ UnoRuntime.queryInterface(XComponentLoader.class, oDesktop);
+
+ // 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)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);
+ }
+
+ 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)
+ UnoRuntime.queryInterface(
+ XNameAccess.class,
+ docProps.getPropertyValue("DDELinks") );
+ String[] linkNames = links.getElementNames();
+
+ oObj = (XInterface)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) ;
+ }
+
+ 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..897110c44fe0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDDELinksObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+ XComponent oDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ oDoc.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+ 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 = Param.getMSF();
+ try {
+ oInterface = oMSF.createInstance("com.sun.star.frame.Desktop" );
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ // query the desktop interface and then it's componentloader
+ XDesktop oDesktop = ( XDesktop )
+ UnoRuntime.queryInterface(XDesktop.class, oInterface);
+ XComponentLoader oCLoader = ( XComponentLoader )
+ UnoRuntime.queryInterface(XComponentLoader.class, oDesktop);
+
+ // 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)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);
+ }
+
+ 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)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) ;
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ 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..30ea3955688e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java
@@ -0,0 +1,228 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDataPilotFieldObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+ 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)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);
+ }
+
+ try {
+ log.println("Filling 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));
+
+ if (DPT.hasByName("DataPilotTable")) {
+ DPT.removeByName("DataPilotTable");
+ }
+
+ DPT.insertNewByName(
+ "DataPilotTable",
+ new CellAddress((short)0, 5, 5), DPDsc);
+
+ XIndexAccess IA = DPDsc.getDataPilotFields();
+ try {
+ oObj = (XInterface)IA.getByIndex(0);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get data pilot field", e);
+ }
+
+ 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/ScDataPilotFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java
new file mode 100644
index 000000000000..0727676bb32c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDataPilotFieldsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+ 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)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);
+ }
+
+ 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/ScDataPilotTableObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java
new file mode 100644
index 000000000000..8893189ffa27
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java
@@ -0,0 +1,307 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDataPilotTableObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+ 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 = (XSpreadsheets)xSheetDoc.getSheets();
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ XSpreadsheet oSheet = null;
+ Object oChangeCell = null;
+ Object oCheckCell = null;
+ try {
+ oSheet = (XSpreadsheet)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);
+ }
+ 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].StringValue = "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].StringValue = "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)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);
+ }
+
+ 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));
+
+ return tEnv;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java
new file mode 100644
index 000000000000..da83193df518
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDataPilotTablesObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+ 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)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);
+ }
+
+ 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..cdb043ff7130
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDatabaseRangeObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ boolean result = true;
+
+ // 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)
+ docProps.getPropertyValue("DatabaseRanges");
+ } 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);
+ }
+
+ if (dbRanges.hasByName("dbRange")) {
+ dbRanges.removeByName("dbRange");
+ }
+
+ CellRangeAddress aRange = new CellRangeAddress((short)0, 2, 4, 5, 6);
+ dbRanges.addNewByName("dbRange", aRange);
+
+ XNameAccess dbrNA = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, dbRanges);
+
+ try {
+ Object objRange = dbrNA.getByName("dbRange");
+ oObj = (XInterface)objRange;
+ } 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) ;
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // Other parameters required for interface tests
+ tEnv.addObjRelation("DATAAREA", aRange);
+
+ XSpreadsheets sheets = xSheetDoc.getSheets();
+ String names[] = sheets.getElementNames();
+ 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;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java
new file mode 100644
index 000000000000..dfd20db2c1ca
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDatabaseRangesObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XDatabaseRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellRangeAddress;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ boolean result = true;
+
+ // 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)
+ 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) ;
+ }
+
+ 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/ScDrawPageObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java
new file mode 100644
index 000000000000..c9a5497131b5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDrawPageObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.sheet.XSpreadsheetDocument;
+import com.sun.star.lang.XComponent;
+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.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+public class ScDrawPageObj extends TestCase {
+
+ XSpreadsheetDocument xDoc = null;
+
+ /**
+ * Creates a new Draw document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ xComp.dispose();
+ }
+
+
+ /**
+ * 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) oDP.getByIndex(0);
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ }
+
+ // 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..4210e7a3be82
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScDrawPagesObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+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.SOfficeFactory;
+
+/**
+* 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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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..6e63d5589509
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScFilterDescriptorBase.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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)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);
+ }
+
+ 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/ScFunctionListObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java
new file mode 100644
index 000000000000..4453cfe0b4d2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScFunctionListObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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 = 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..52b507f6c45c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java
@@ -0,0 +1,265 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScHeaderFieldObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+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.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.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 {
+ XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XPropertySetInfo PropSetInfo;
+ 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)StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle)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);
+ }
+
+ //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)
+ 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);
+ }
+
+ 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..6193ec7c4cc7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java
@@ -0,0 +1,250 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScHeaderFieldsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+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.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 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 {
+ XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XPropertySetInfo PropSetInfo;
+ 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)StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle)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);
+ }
+
+ //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)
+ 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);
+ }
+
+ 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);
+ }
+
+ 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);
+ }
+
+ 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..05f55eb717d5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScHeaderFooterContentObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XPropertySetInfo PropSetInfo;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ try{
+ PageStyles = (XNameAccess)StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle)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);
+ }
+
+ //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)
+ 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);
+ }
+
+ 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..c3b3c674c2c5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java
@@ -0,0 +1,252 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScHeaderFooterTextCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XPropertySetInfo PropSetInfo;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ try{
+ PageStyles = (XNameAccess)StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle)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);
+ }
+
+ //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)
+ 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);
+ }
+
+ 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..c0f5258c0dcf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java
@@ -0,0 +1,302 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScHeaderFooterTextObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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.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.DefaultDsc;
+import util.InstCreator;
+import util.ParagraphDsc;
+import util.SOfficeFactory;
+
+/**
+* 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 {
+
+ XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XPropertySetInfo PropSetInfo;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ try{
+ PageStyles = (XNameAccess)StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle)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);
+ }
+
+ //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)
+ 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);
+ }
+
+ 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/ScIndexEnumeration_CellAnnotationsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java
new file mode 100644
index 000000000000..7e602ddcdb71
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_CellAnnotationsEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XSheetAnnotationsSupplier;
+import com.sun.star.sheet.XSheetAnnotations;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+
+public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oInterface = null;
+ 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)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);
+ }
+
+ 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..a5f3b729ca5d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_CellAreaLinksEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XAreaLinks;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellAddress;
+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 ScIndexEnumeration_CellAreaLinksEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+
+ 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) 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) ;
+ links.insertAtPosition (addr, "", "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);
+ }
+
+ 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..aad31e2a8f04
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_DDELinksEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.utils;
+
+public class ScIndexEnumeration_DDELinksEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+ XComponent oDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ oDoc.dispose();
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ Object oInterface = null;
+ 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 = Param.getMSF();
+ try {
+ oInterface = oMSF.createInstance("com.sun.star.frame.Desktop" );
+ } catch(com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create instance", e);
+ }
+
+ // query the desktop interface and then it's componentloader
+ XDesktop oDesktop = ( XDesktop )
+ UnoRuntime.queryInterface(XDesktop.class, oInterface);
+ XComponentLoader oCLoader = ( XComponentLoader )
+ UnoRuntime.queryInterface(XComponentLoader.class, oDesktop);
+
+ // 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)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);
+ }
+
+ 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)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) ;
+ }
+
+ 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..eafa07aa82e6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_DataPilotFieldsEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+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.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 ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ Object oInterface = null;
+ 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)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);
+ }
+
+ 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_DataPilotTablesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java
new file mode 100644
index 000000000000..c55dca1df8da
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_DataPilotTablesEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+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.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 ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ Object oInterface = null;
+ 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)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);
+ }
+
+ 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..5cda26c6fe8e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_DatabaseRangesEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XDatabaseRanges;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.table.CellRangeAddress;
+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 ScIndexEnumeration_DatabaseRangesEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ boolean result = true;
+
+ // 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)
+ 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) ;
+ }
+
+ 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..e8e44f84b982
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_FunctionDescriptionEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+public class ScIndexEnumeration_FunctionDescriptionEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ 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 = 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..4d849b6ff0e3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_LabelRangesEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ 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..ce5c8c838cc2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_NamedRangesEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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 ScIndexEnumeration_NamedRangesEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oInterface = null;
+ 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) 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);
+ }
+
+ // 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..18b2768cbd8c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_ScenariosEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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 ScIndexEnumeration_ScenariosEnumeration extends TestCase {
+ public XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ 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)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);
+ }
+
+ 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..246690960b7f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_SheetCellRangesEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.XNameContainer;
+import com.sun.star.lang.XComponent;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ 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( 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) 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..fc63436ca344
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_SheetLinksEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.XComponent;
+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.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 ScIndexEnumeration_SheetLinksEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oInterface = null;
+ 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) 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);
+ }
+
+ 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.
+ SL.link("dummy.sdc", "AnySheet", "", "",
+ 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..6bc034aa7b46
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XViewPane;
+import com.sun.star.table.CellRangeAddress;
+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 ScIndexEnumeration_SpreadsheetViewPanesEnumeration extends TestCase {
+ private XSpreadsheetDocument xSpreadsheetDoc;
+ private SOfficeFactory SOF;
+ private XInterface oObj;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+ SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ 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)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);
+ }
+
+ 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..b3ec6a836652
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_SpreadsheetsEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+public class ScIndexEnumeration_SpreadsheetsEnumeration extends TestCase {
+ private XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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");
+ 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_SubTotalFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java
new file mode 100644
index 000000000000..390733f26412
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_SubTotalFieldsEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+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.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 ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase {
+ public 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( 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) ;
+ oComp.dispose();
+ }
+
+ 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)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);
+ }
+
+ 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
+} \ No newline at end of file
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..cd0765e75219
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_TableAutoFormatEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+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.SOfficeFactory;
+
+public class ScIndexEnumeration_TableAutoFormatEnumeration extends TestCase{
+ XSpreadsheetDocument xSheetDoc = null;
+ SOfficeFactory SOF = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = null;
+
+ try {
+ // creation of testobject here
+ // get AutoFormats
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface
+ (XComponent.class, xSheetDoc);
+ oObj = (XInterface)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_TableColumnsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java
new file mode 100644
index 000000000000..866b52ceaf91
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_TableColumnsEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+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.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 ScIndexEnumeration_TableColumnsEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
+
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = 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)
+ 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);
+ }
+
+ 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..7e29e499ad3d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java
@@ -0,0 +1,233 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_TableConditionalEntryEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+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.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;
+import util.utils;
+
+public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCase {
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ 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)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);
+ }
+
+ 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)) {
+ System.out.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..f7e29cd02832
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_TableRowsEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.lang.XComponent;
+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.XCellRange;
+import com.sun.star.table.XTableRows;
+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 ScIndexEnumeration_TableRowsEnumeration extends TestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ 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)
+ 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);
+ }
+
+ 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..6714ac371547
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScIndexEnumeration_TextFieldEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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.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 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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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 oInterface = null;
+ 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)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..0b8b93ea667b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScLabelRangeObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ 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 = (XLabelRange) 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) ;
+ }
+
+ 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..4aa19241eb03
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScLabelRangesObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XComponent;
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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..82755a730b5a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScModelObj.java
@@ -0,0 +1,231 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScModelObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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.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.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 XSpreadsheetDocument xSpreadsheetDoc;
+ public XSpreadsheetDocument xSecondsheetDoc;
+
+ /**
+ * Disposes Spreadsheet documents.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xSheetDoc " );
+
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc);
+ oComp.dispose();
+
+ oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSecondsheetDoc);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ // 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( Param.getMSF());
+
+ if (xSpreadsheetDoc != null) {
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc);
+ oComp.dispose();
+ }
+ if (xSecondsheetDoc != null) {
+ XComponent oComp = (XComponent)
+ UnoRuntime.queryInterface (XComponent.class, xSecondsheetDoc);
+ oComp.dispose();
+ }
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ 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();
+
+ XSelectionSupplier sel = (XSelectionSupplier)
+ UnoRuntime.queryInterface(XSelectionSupplier.class, cont1);
+
+ XCell toSel = null;
+
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = (XSpreadsheet) oIndexSheets.getByIndex(0);
+
+ log.println("Getting a cell from sheet") ;
+ toSel = oSheet.getCellByPosition(2, 3) ;
+ } 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);
+ }
+
+ log.println( "Adding SelectionSupplier and Shape to select for XModel");
+ tEnv.addObjRelation("SELSUPP", sel);
+ tEnv.addObjRelation("TOSELECT", toSel);
+
+ log.println( "adding Controller as ObjRelation for XModel");
+ tEnv.addObjRelation("CONT2", cont2);
+
+ 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..5e0e24d4dad3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java
@@ -0,0 +1,220 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScNamedRangeObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oInterface = null;
+ 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 ") ;
+ XSpreadsheets oSheets = xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ XSpreadsheet oSheet = null;
+ try {
+ oSheet = (XSpreadsheet) 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);
+ }
+
+ // 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)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);
+ }
+
+ 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..6a51160adbdd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScNamedRangesObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oInterface = null;
+ 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) 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);
+ }
+
+ // 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..6277f6e1452c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScRecentFunctionsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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 oInterface = null;
+ 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 = 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..e5b7ebb3ab6f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScScenariosObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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)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);
+ }
+
+ 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/ScSheetLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java
new file mode 100644
index 000000000000..262664cdae64
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScSheetLinkObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.lang.XComponent;
+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.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;
+import util.utils;
+
+/**
+* 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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oInterface = null;
+ 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) 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);
+ }
+
+ 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)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);
+ }
+
+ 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..d88d72af6fbc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScSheetLinksObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oInterface = null;
+ 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) 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);
+ }
+
+ 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.
+ SL.link("dummy.sdc", "AnySheet", "", "",
+ 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/ScSpreadsheetSettings.java b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java
new file mode 100644
index 000000000000..211e9fd64751
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScSpreadsheetSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.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)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..5b5ad05968eb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScSpreadsheetSettingsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.lang.XComponent;
+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.SOfficeFactory;
+
+/**
+* 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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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 oInterface = null;
+ XInterface oObj = null;
+ boolean result = true;
+
+ // 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..f028b8df7740
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScStyleFamiliesObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.uno.UnoRuntime;
+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.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 {
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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..e08d424a3573
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java
@@ -0,0 +1,240 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScStyleFamilyObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyleFamiliesSupplier;
+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.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 {
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ 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" );
+
+ 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)
+ 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);
+ }
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 = 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..0596833cc257
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java
@@ -0,0 +1,295 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScStyleObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.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;
+import util.SOfficeFactory;
+
+/**
+* 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 {
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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");
+
+ 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)
+ oStyleFamiliesIndexAccess.getByIndex(0);
+
+ XIndexAccess oStyleFamilyIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,
+ oStyleFamilyNameAccess);
+ oStyle = (XStyle)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);
+ }
+
+ 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) 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);
+ }
+ 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..647653adc598
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScSubTotalDescriptorBase.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 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( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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)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);
+ }
+
+ XSubTotalCalculatable xSTC = (XSubTotalCalculatable)
+ UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet);
+
+ XInterface oObj = xSTC.createSubTotalDescriptor(true);
+
+ 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..9e117c6a7d78
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScSubTotalFieldObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 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( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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)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);
+ }
+
+ 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 ) 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);
+ }
+
+ 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..d457b5a88eca
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTabViewObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+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.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;
+import java.util.Comparator;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.table.CellRangeAddress;
+import util.ValueComparer;
+import com.sun.star.view.XSelectionSupplier;
+
+/**
+* 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 XSpreadsheetDocument xSpreadsheetDoc;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ 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)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);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("adding 'Sheet' as ObjRelation");
+ tEnv.addObjRelation("Sheet", oSheet);
+
+
+ //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;
+ } });
+
+ 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..474f782a4cbe
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTableColumnObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = 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)
+ 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);
+ }
+
+ XColumnRowRange oColumnRowRange = (XColumnRowRange)
+ UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet);
+ XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns();
+ XIndexAccess oIndexAccess = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oColumns);
+ try {
+ oObj = (XInterface) 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);
+ }
+
+ 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..1899ce86a976
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTableColumnsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = 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)
+ 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);
+ }
+
+ 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 ScTableRowsObj
+
diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java
new file mode 100644
index 000000000000..b58a9d89a376
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTableConditionalEntry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.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.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;
+import util.utils;
+
+/**
+* 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 {
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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)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);
+ }
+
+ 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)) {
+ System.out.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) 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..27f3720f71c1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTableConditionalFormat.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.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.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.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 {
+
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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)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);
+ }
+
+ 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) 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);
+ }
+
+ 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..9e107d2fcb78
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTableRowObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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.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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oInterface = null;
+ 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)
+ 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) 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);
+ }
+
+ 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..44cdf1389a09
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTableRowsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+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.XCellRange;
+import com.sun.star.table.XTableRows;
+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.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( 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( "Couldnt 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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)
+ 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);
+ }
+
+ 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..e463fa5fe1b9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java
@@ -0,0 +1,248 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTableSheetObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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 oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = 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)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);
+ }
+
+ 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);
+ }
+
+ oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, oSheet);
+
+ log.println("creating a new environment for object");
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ 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);
+
+ 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..8e267cff6b62
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTableSheetsObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.lang.XComponent;
+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;
+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.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 XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 oSheet = null;
+ XSpreadsheet oSecondSheet = null;
+
+ try {
+ oSheet = SOF.createSpreadsheet(xSpreadsheetDoc);
+ 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" );
+ XComponent xComp = (XComponent)
+ UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc);
+ int 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..c87542e62942
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScTableValidationObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+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;
+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.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 {
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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)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);
+ }
+
+ 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) 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);
+ }
+
+ 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/ScViewPaneObj.java b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java
new file mode 100644
index 000000000000..54d9dea2dccc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * $RCSfile: ScViewPaneObj.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XViewPane;
+import com.sun.star.table.CellRangeAddress;
+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.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 {
+ private XSpreadsheetDocument xSpreadsheetDoc;
+ private SOfficeFactory SOF;
+ private XInterface oObj;
+
+ /**
+ * Creates Spreadsheet document.
+ */
+ public void initialize( TestParameters Param, PrintWriter log ) {
+ // get a soffice factory object
+ SOF = SOfficeFactory.getFactory( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XModel xm = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+ XController xc = xm.getCurrentController();
+ XIndexAccess xIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xc);
+ try {
+ oObj = (XInterface)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);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ XViewPane VP = (XViewPane)
+ UnoRuntime.queryInterface(XViewPane.class, oObj);
+ CellRangeAddress dataArea = VP.getVisibleRange();
+ tEnv.addObjRelation("DATAAREA", dataArea);
+
+ 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..ba6f4feee746
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java
@@ -0,0 +1,242 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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 {
+
+ XComponent xSheetDoc;
+ ContentFilterChecker Filter;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ xSheetDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = 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) xSheetsIndexArray.getByIndex(0);
+ XCell xCell = xSheet.getCellByPosition(0, 0);
+ xCell.setFormula(CELL_TEXT);
+
+ } 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("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..92dab9d05f42
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.document.XImporter;
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc;
+ XComponent comp ;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ comp.dispose();
+ }
+
+ /**
+ * 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 = 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 impCellContent = "XMLContentImporter_Test";
+ 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();
+ XIndexAccess xSheetsIndexArray = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, xSheets);
+ XSpreadsheet xSheet = null;
+
+ 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..ec45f07e4cf0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLExporter.java
@@ -0,0 +1,249 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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 {
+ XComponent xSheetDoc;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+ try {
+ log.println( "creating a textdocument" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ xSheetDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XMultiServiceFactory xMSF = 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) xSheetsIndexArray.getByIndex(0);
+ XNamed xSheetNamed = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class, xSheet);
+ xSheetNamed.setName(SHEET_NAME);
+ } 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: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..df44eb0afe6b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLImporter.java
@@ -0,0 +1,227 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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;
+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.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 {
+
+ XComponent xSheetDoc;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ xSheetDoc.dispose();
+ }
+
+ /**
+ * 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 = 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..352e256c4325
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+
+/**
+ * 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 {
+
+ XComponent xSheetDoc;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ xSheetDoc.dispose();
+ }
+
+ /**
+ * 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 = 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");
+ } catch (com.sun.star.uno.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..f63d9ce70005
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc;
+ XComponent comp ;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ comp.dispose();
+ }
+
+ /**
+ * 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 = 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..7811c1262a2b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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 {
+
+ XComponent xSheetDoc;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ xSheetDoc.dispose();
+ }
+
+ /**
+ * 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 = 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");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", 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..558d2a622b64
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc;
+ XComponent comp ;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ comp.dispose();
+ }
+
+ /**
+ * 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 = 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..998792aa3fdb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.xml.sax.XDocumentHandler;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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 {
+ XComponent xSheetDoc;
+ protected int counter = 0;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xSheetDoc = SOF.openDoc("scalc","_blank");
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document disposed
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xCalcDoc " );
+ xSheetDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) throws StatusException {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+ XMultiServiceFactory xMSF = 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)
+ 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);
+ } catch (com.sun.star.uno.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..afdbb69fbbbf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java
@@ -0,0 +1,248 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:16:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sc;
+
+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;
+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.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 {
+ XSpreadsheetDocument xSheetDoc;
+ XComponent comp ;
+
+ /**
+ * New spreadsheet document created.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Spreadsheet document destroyed.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ comp.dispose();
+ }
+
+ /**
+ * 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 ;
+ final int impValue = 777 ;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory xMSF = 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..dab319c240b8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccArea.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccArea.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+
+public class AccArea extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log,xRoot);
+
+ 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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccAxis.java b/qadevOOo/tests/java/mod/_sch/AccAxis.java
new file mode 100644
index 000000000000..e8386f2ee8a3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccAxis.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccAxis.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.chart.XAxisXSupplier;
+
+public class AccAxis extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccDataPoint.java b/qadevOOo/tests/java/mod/_sch/AccDataPoint.java
new file mode 100644
index 000000000000..d9991d75a44f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccDataPoint.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccDataPoint.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.view.XSelectionSupplier;
+
+public class AccDataPoint extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //at.printAccessibleTree(log,xRoot);
+
+ 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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sch/AccDataSeries.java b/qadevOOo/tests/java/mod/_sch/AccDataSeries.java
new file mode 100644
index 000000000000..a9976ddb6da7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccDataSeries.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccDataSeries.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.view.XSelectionSupplier;
+
+public class AccDataSeries extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //at.printAccessibleTree(log,xRoot);
+
+ 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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sch/AccDiagram.java b/qadevOOo/tests/java/mod/_sch/AccDiagram.java
new file mode 100644
index 000000000000..99a2f3fefe9d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccDiagram.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccDiagram.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+
+public class AccDiagram extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //at.printAccessibleTree(log,xRoot);
+
+ 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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sch/AccFloor.java b/qadevOOo/tests/java/mod/_sch/AccFloor.java
new file mode 100644
index 000000000000..bd03fb45db3c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccFloor.java
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccFloor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.chart.X3DDisplay;
+import lib.Status;
+
+public class AccFloor extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //at.printAccessibleTree(log,xRoot);
+
+ 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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sch/AccGrid.java b/qadevOOo/tests/java/mod/_sch/AccGrid.java
new file mode 100644
index 000000000000..7ca12b1f9893
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccGrid.java
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccGrid.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.chart.XAxisYSupplier;
+
+public class AccGrid extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //at.printAccessibleTree(log,xRoot);
+
+ 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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sch/AccLegend.java b/qadevOOo/tests/java/mod/_sch/AccLegend.java
new file mode 100644
index 000000000000..c73e1bd6fce4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccLegend.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccLegend.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.chart.XAxisXSupplier;
+
+public class AccLegend extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java b/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java
new file mode 100644
index 000000000000..4cfb614aa53f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccLegendEntry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.chart.XAxisXSupplier;
+
+public class AccLegendEntry extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java b/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java
new file mode 100644
index 000000000000..3c4f3cb0083c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccStatisticsObject.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.chart.XAxisXSupplier;
+
+public class AccStatisticsObject extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccTitle.java b/qadevOOo/tests/java/mod/_sch/AccTitle.java
new file mode 100644
index 000000000000..db0257860392
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccTitle.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccTitle.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.chart.XAxisXSupplier;
+
+public class AccTitle extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_sch/AccWall.java b/qadevOOo/tests/java/mod/_sch/AccWall.java
new file mode 100644
index 000000000000..e81ae398a118
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccWall.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccWall.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+import com.sun.star.chart.X3DDisplay;
+import lib.Status;
+
+public class AccWall extends TestCase {
+
+ XChartDocument xChartDoc = null;
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ if (xChartDoc != null) xChartDoc.dispose();
+ log.println( "creating a chart document" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //at.printAccessibleTree(log,xRoot);
+
+ 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) {
+ log.println("dispose chart document");
+ xChartDoc.dispose();
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java
new file mode 100644
index 000000000000..a18b77214278
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleDocumentView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:17:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sch;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import util.SOfficeFactory;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.PosSize;
+
+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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+
+ oObj = at.SearchedContext;
+
+ if (oObj == null) {
+ log.println("DocumentView hasn't the role 'Document'");
+ log.println("trying the role 'Shape'");
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE);
+ oObj = at.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) {
+ log.println("dispose text document");
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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( 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..d8e1c70e2078
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChXChartAxis.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+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.uno.UnoRuntime;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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..9ddec05c647a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartData.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChXChartData.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+import com.sun.star.chart.XChartData;
+import com.sun.star.chart.XChartDocument;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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..5fefc2f2039f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChXChartDataArray.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+import com.sun.star.chart.XChartData;
+import com.sun.star.chart.XChartDocument;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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..c5a954f315d1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChXChartDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ doc2.dispose();
+ }
+
+ /**
+ * 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( 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();
+
+ 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..aba7feacb08b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXChartView.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChXChartView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+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.uno.UnoRuntime;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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..ca07a00d72bd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChXDataPoint.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+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.uno.UnoRuntime;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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( 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..fa506ff45170
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXDataRow.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChXDataRow.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+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.uno.UnoRuntime;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+
+ /**
+ * 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( 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..b4aa38007b3f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChXDiagram.java
@@ -0,0 +1,431 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChXDiagram.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import java.io.PrintWriter;
+import java.util.*;
+
+import util.*;
+import lib.*;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.XInterface;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+import com.sun.star.drawing.XShape;
+import com.sun.star.chart.XChartDataArray;
+import com.sun.star.sheet.*;
+import com.sun.star.table.*;
+import com.sun.star.document.XEmbeddedObjectSupplier;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.awt.Rectangle;
+
+/**
+* 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( 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);
+ oComp.dispose();
+ }
+
+ /**
+ * 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) 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);
+ }
+
+ 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)((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);
+ }
+
+ 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( 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..3c686035f66e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartArea.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChartArea.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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..434852b43396
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartGrid.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChartGrid.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+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.uno.UnoRuntime;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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..e6bf84fe534a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartLegend.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChartLegend.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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..23cad4f130cd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartLine.java
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChartLine.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.chart.XDiagram;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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( Param.getMSF());
+ oDiagram = SOF.createDiagram(xChartDoc, "BarDiagram");
+
+ log.println( "getting Line-Diagram" );
+ xChartDoc.setDiagram(oDiagram);
+
+ // get the Line
+ try {
+ log.println( "getting Line" );
+ XPropertySet RowProps = oDiagram.getDataRowProperties(1);
+ oObj = (XPropertySet)
+ 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 );
+ }
+
+ 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..280a3c3ab225
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sch/ChartTitle.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * $RCSfile: ChartTitle.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sch;
+
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.drawing.XShape;
+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.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( 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 ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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..143f6fa457af
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleDrawDocumentView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XDrawView;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.XAccessible;
+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 util.DrawTools;
+
+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( 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) 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);
+ }
+
+ //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 (Param.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //Role 100 for documents, see
+ //drafts.com.sun.star.accessibility.AccessibleRole
+ at.getAccessibleObjectForRole(xRoot, (short) 100);
+
+ oObj = at.SearchedContext;
+
+ System.out.println("ImplementationName "+utils.getImplName(oObj));
+
+ at.printAccessibleTree(log, xRoot);
+
+ 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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( 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..65b51a703877
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java
@@ -0,0 +1,213 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleOutlineView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XDrawView;
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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 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 (Param.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+
+ oObj = at.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();
+ final XDrawView xView = (XDrawView) UnoRuntime.queryInterface
+ (XDrawView.class, aModel.getCurrentController()) ;
+
+ 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");
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * 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( 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,
+ 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..b3a3c8d31936
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleSlideView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.awt.XWindow;
+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.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+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();
+ final XDrawPage fDP1 = oDPn.insertNewByIndex(1);
+ final XDrawPage fDP2 = oDPn.insertNewByIndex(2);
+
+ shortWait();
+
+ XWindow xWindow = at.getCurrentWindow (Param.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+
+ oObj = at.SearchedContext;
+
+ System.out.println("ImplementationName "+utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ util.dbg.printInterfaces(oObj);
+
+ final XDrawView xView = (XDrawView) UnoRuntime.queryInterface
+ (XDrawView.class, aModel.getCurrentController()) ;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ xView.setCurrentPage(fDP1);
+ xView.setCurrentPage(fDP2);
+ }
+ });
+
+ 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");
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * 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( 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,
+ 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/SdDocLinkTargets.java b/qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java
new file mode 100644
index 000000000000..430ceec9dfab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdDocLinkTargets.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.document.XLinkTargetSupplier;
+import com.sun.star.lang.XComponent;
+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.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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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..cff60e85262a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdDrawPage.java
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdDrawPage.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.XMasterPagesSupplier;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+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.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+import com.sun.star.drawing.XControlShape;
+import util.FormTools;
+import com.sun.star.drawing.XShape;
+
+/**
+* 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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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( 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) 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 );
+ }
+
+ //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..af1d654ca6cb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdDrawPagesAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.lang.XComponent;
+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.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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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..ace7685256e2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdGenericDrawPage.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.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.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+/**
+* 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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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( 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) 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..54cd54252f7c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdLayer.java
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdLayer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.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.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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ 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) 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);
+ }
+
+ 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..01662eb3dc80
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdLayerManager.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdLayerManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.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.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+/**
+* 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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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
+ */
+ 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
+ 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) 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);
+ }
+
+ 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..6381bc39435e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdMasterPage.java
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdMasterPage.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.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.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+/**
+* 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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public 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 oMPn = oMPS.getMasterPages();
+ XIndexAccess oMPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oMPn);
+
+ log.println( "getting MasterPage" );
+ XInterface oObj = null;
+ try {
+ oObj = (XDrawPage) 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);
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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..dd19f04618d5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdMasterPagesAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XMasterPagesSupplier;
+import com.sun.star.lang.XComponent;
+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.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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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..d21aedf261da
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdPageLinkTargets.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.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.SOfficeFactory;
+
+/**
+* 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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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( 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..30de4fc6e820
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java
@@ -0,0 +1,339 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdUnoDrawView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XModifiable;
+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.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 {
+ XDesktop the_Desk;
+ XComponent xDrawDoc;
+ 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(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");
+ xDrawDoc.dispose();
+ xSecondDrawDoc.dispose();
+ }
+
+ /**
+ * 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( Param.getMSF());
+
+ try {
+ log.println( "creating a 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) 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);
+ }
+
+ //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);
+ }
+
+ Object oShapeCol1 = null;
+ Object oShapeCol2 = null;
+ try {
+ oShapeCol1 = Param.getMSF().
+ createInstance("com.sun.star.drawing.ShapeCollection");
+ oShapeCol2 = 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);
+
+ 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);
+
+ 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..e4ab42b6fc49
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java
@@ -0,0 +1,264 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdUnoOutlineView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.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.DesktopTools;
+import util.SOfficeFactory;
+import util.utils;
+/**
+* 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(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");
+ xImpressDoc.dispose();
+ xSecondDrawDoc.dispose();
+ }
+
+ /**
+ * 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( 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);
+ }
+
+ 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,
+ 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);
+
+ 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..ee4fb4d919ab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java
@@ -0,0 +1,292 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdUnoPresView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XModifiable;
+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.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 {
+ 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(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");
+ xImpressDoc.dispose();
+ xSecondDrawDoc.dispose();
+ }
+
+ /**
+ * 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( Param.getMSF());
+
+ try {
+ log.println( "creating a 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) oDPi.getByIndex(0);
+ the_pages.insertNewByIndex(0);
+ secondDrawPage = (XDrawPage) oDPi.getByIndex(1);
+ } 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);
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ XShapes oShapes = (XShapes)
+ UnoRuntime.queryInterface(XShapes.class, oDrawPage);
+ XShape shape1 = SOF.createShape(
+ xImpressDoc, 3000, 4500, 15000, 1000, "Ellipse");
+ XShape shape2 = SOF.createShape(
+ xImpressDoc, 5000, 3500, 7500, 5000, "Rectangle");
+ oShapes.add(shape1);
+ oShapes.add(shape2);
+
+ 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("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);
+
+ 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);
+
+ 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/SdXCustomPresentation.java b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java
new file mode 100644
index 000000000000..226a27296d4e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java
@@ -0,0 +1,263 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdXCustomPresentation.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.XSingleServiceFactory;
+import com.sun.star.presentation.XCustomPresentationSupplier;
+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.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( 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");
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * 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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF());
+
+ 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) 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);
+ }
+
+ 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 = 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) 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);
+ }
+
+ 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..b043738f8d97
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdXCustomPresentationAccess.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.presentation.XCustomPresentationSupplier;
+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.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( 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");
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * 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 {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF());
+
+ 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 = 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..83741bf74f2f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdXImpressDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.lang.XComponent;
+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.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;
+
+ /**
+ * 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");
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * 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( 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 );
+ }
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( xImpressDoc );
+
+ 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..2051f61b63bc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXPresentation.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdXPresentation.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.XComponent;
+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;
+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.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( 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");
+ xImpressDoc.dispose();
+ }
+
+ /**
+ * 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..49d86a2952d7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sd/SdXShape.java
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * $RCSfile: SdXShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sd;
+
+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.style.XStyle;
+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.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( 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");
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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
+ */
+ 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( 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) 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);
+ }
+
+ //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) 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) 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);
+ }
+
+ 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/_sfx/AppDispatchProvider.java b/qadevOOo/tests/java/mod/_sfx/AppDispatchProvider.java
new file mode 100644
index 000000000000..0222a0e6fb15
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/AppDispatchProvider.java
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * $RCSfile: AppDispatchProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+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.dbg;
+import util.utils;
+
+/**
+ * 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 = 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 XFrameLoader
+ tEnv.addObjRelation("XDispatchProvider.URL", "slot:5302") ;
+
+
+ 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..8ec91c993bfc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * $RCSfile: DocumentTemplates.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+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;
+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.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(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 = 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..b0c51b088b92
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/FrameLoader.java
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * $RCSfile: FrameLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+import com.sun.star.uno.*;
+import com.sun.star.lang.*;
+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;
+
+/**
+* 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 = Param.getMSF().createInstance
+ ("com.sun.star.frame.FrameLoaderFactory") ;
+ XMultiServiceFactory facMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class,
+ oInterface);
+ oInterface = facMSF.createInstance
+ ("com.sun.star.frame.Bibliography");
+
+ } 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",".component:Bibliography/View1");
+
+ 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..b4668601dbf1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/SfxMacroLoader.java
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * $RCSfile: SfxMacroLoader.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+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.dbg;
+import util.utils;
+
+/**
+ * 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 = 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(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..dbbe1f2e5ec4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * $RCSfile: StandaloneDocumentInfo.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sfx;
+
+import com.sun.star.document.XStandaloneDocumentInfo;
+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.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(tParam.getMSF()) +
+ "SfxStandaloneDocInfoObject.sdw";
+
+ utils.overwriteFile(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 = 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",e);
+ }
+ tEnv.addObjRelation("DOCURL",destUrl);
+ return tEnv;
+ }
+
+} // finish class TestCase
+
diff --git a/qadevOOo/tests/java/mod/_simreg/SimpleRegistry.java b/qadevOOo/tests/java/mod/_simreg/SimpleRegistry.java
new file mode 100644
index 000000000000..7074c0965684
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_simreg/SimpleRegistry.java
@@ -0,0 +1,199 @@
+/*************************************************************************
+ *
+ * $RCSfile: SimpleRegistry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._simreg;
+
+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.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.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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ XInterface oObj = null;
+ Object oInterface = null;
+ final String tmpDir = utils.getOfficeTempDirSys(Param.getMSF()) ;
+ final String openF = "XSimpleRegistry_open.rdb" ;
+ final String destroyF = "XSimpleRegistry_destroy.rdb" ;
+ final String mergeF = "XSimpleRegistry_merge.rdb" ;
+
+
+ try {
+ XMultiServiceFactory xMSF = 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..521b9890e0eb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * $RCSfile: SmEditAccessible.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import com.sun.star.lang.XComponent;
+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.uno.XInterface;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import util.utils;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessible
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.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>.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+
+ XController xController = aModel.getCurrentController();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PANEL, "Commands");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ try {
+ 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/SmGraphicAccessible.java b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java
new file mode 100644
index 000000000000..c5ecd93275df
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * $RCSfile: SmGraphicAccessible.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import java.io.PrintWriter;
+
+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.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+
+
+/**
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessible
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.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>.
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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);
+
+ XController xController = aModel.getCurrentController();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.DOCUMENT, "Formula");
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ try {
+ 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..5d787bd9fb89
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/SmModel.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: SmModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+import com.sun.star.lang.XComponent;
+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
+ * <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( 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..4aaf5fdde656
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLExporter.java
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..6098baf41dab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLImporter.java
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+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;
+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.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( 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 = 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..ec0374856c28
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..fa28394bf8e3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+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;
+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.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( 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 = 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..e54ddfaf3faf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..696e9d20f3c5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sm/XMLSettingsImporter.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sm;
+
+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;
+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.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( 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 = Param.getMSF();
+ XInterface oObj = null;
+ final short impMargin = 67 ;
+
+ final XDocumentInfoSupplier xDocInfoSup ;
+ try {
+ oObj = (XInterface)xMSF.createInstance(
+ "com.sun.star.comp.Math.XMLSettingsImporter");
+
+ 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-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..9811726b73fa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_smgr/OServiceManager.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * $RCSfile: OServiceManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._smgr;
+
+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;
+
+/**
+ * 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 = 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 enum = set1.createEnumeration();
+ Object srv = enum.nextElement();
+
+ set.insert(srv) ;
+
+ newElement = enum.nextElement();
+
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, oInterface);
+ if (xProp != null) {
+ xContext = (XComponentContext)
+ 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..3ce1a95b39ed
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_smplmail/SimpleSystemMail.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * $RCSfile: SimpleSystemMail.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._smplmail;
+
+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.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 = 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..408859e98e8c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_srtrs/SortedDynamicResultSetFactory.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: SortedDynamicResultSetFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._srtrs;
+
+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.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 = 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..9aaa621f3cc0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/DataInputStream.java
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * $RCSfile: DataInputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+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>
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+
+ XMultiServiceFactory xMSF = 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..467012be9252
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/DataOutputStream.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * $RCSfile: DataOutputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+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>
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ XInterface oPipe = null;
+ XMultiServiceFactory xMSF = null ;
+
+ try {
+ xMSF = 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..83fdb64f72ac
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * $RCSfile: MarkableInputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XMultiServiceFactory xMSF = 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 moStream = (XOutputStream)
+ UnoRuntime.queryInterface(XOutputStream.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..ba8d197708aa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java
@@ -0,0 +1,243 @@
+/*************************************************************************
+ *
+ * $RCSfile: MarkableOutputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ Object ostream = null;
+
+ Object istream = null ;
+ XOutputStream moStream = null ;
+
+ XMultiServiceFactory xMSF = 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..11abf5f12e1f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java
@@ -0,0 +1,331 @@
+/*************************************************************************
+ *
+ * $RCSfile: ObjectInputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+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 = 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 = 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..4803c64d5f2f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java
@@ -0,0 +1,352 @@
+/*************************************************************************
+ *
+ * $RCSfile: ObjectOutputStream.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+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 = 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 = 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..7a6092f06a42
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/Pipe.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * $RCSfile: Pipe.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = 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 XMultiServiceFactory msf = Param.getMSF();
+ 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..83c9f83ccc93
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_stm/Pump.java
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * $RCSfile: Pump.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._stm;
+
+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
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = 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/_svtools/AccessibleBrowseBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java
new file mode 100644
index 000000000000..a0f3e64fa6cc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java
@@ -0,0 +1,270 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleBrowseBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+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.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.XControlAccess;
+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 util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.Rectangle;
+
+public class AccessibleBrowseBox 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(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( 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;
+
+ final Object[] fParams = params;
+
+ shortWait();
+
+ try {
+ oObj = (XInterface) 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();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //at.printAccessibleTree(log,xRoot);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PANEL);
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ final XTextDocument aDoc = xTextDoc;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ try {
+ xInit.initialize(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.currentThread().sleep(500) ;
+ } 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..f491ae0b0c5d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java
@@ -0,0 +1,249 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleBrowseBoxHeaderBar.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+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.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li>
+ * <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleBrowseBoxHeaderBar 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(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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( 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;
+
+ try {
+ oObj = (XInterface) 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();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
+
+ 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.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/_svtools/AccessibleBrowseBoxHeaderCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java
new file mode 100644
index 000000000000..83ce28c73ed3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java
@@ -0,0 +1,276 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleBrowseBoxHeaderCell.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+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.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li>
+ * <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleBrowseBoxHeaderCell 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(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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( 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;
+
+ final Object[] fParams = params;
+
+ try {
+ oObj = (XInterface) tParam.getMSF().createInstance
+ ("com.sun.star.awt.Toolkit");
+ xInit.initialize(params);
+ } 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);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.COLUMNHEADER, "Identifier");
+
+ log.println("ImplementationName: "+ util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XTextDocument aDoc = xTextDoc;
+
+ 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/_svtools/AccessibleBrowseBoxTable.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java
new file mode 100644
index 000000000000..522b3efd7ea3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java
@@ -0,0 +1,253 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleBrowseBoxTable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+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.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li>
+ * <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleBrowseBoxTable 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(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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( 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;
+
+ try {
+ oObj = (XInterface) 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();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow());
+
+ 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() {
+ }
+ });
+
+ 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/_svtools/AccessibleBrowseBoxTableCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java
new file mode 100644
index 000000000000..feccfe525750
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java
@@ -0,0 +1,288 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleBrowseBoxTableCell.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+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.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.XControlAccess;
+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 util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.Rectangle;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li>
+ * <code>drafts::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li>
+ * <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleContext
+ */
+public class AccessibleBrowseBoxTableCell 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(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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( 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();
+
+ try {
+ oObj = (XInterface) tParam.getMSF().createInstance
+ ("com.sun.star.awt.Toolkit") ;
+ xInit.initialize(params);
+ } 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();
+
+ 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);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL);
+
+ log.println("ImplementationName: "+util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ final XTextDocument aDoc = xTextDoc;
+
+ 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/_svtools/AccessibleIconChoiceCtrl.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java
new file mode 100644
index 000000000000..c2e706064af3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java
@@ -0,0 +1,294 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleIconChoiceCtrl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+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.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.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 {
+
+ XDesktop the_Desk;
+ XTextDocument xTextDoc;
+ 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(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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( 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)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) 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.PUSHBUTTON, "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) {
+ }
+ }
+ });
+
+ 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/_svtools/AccessibleIconChoiceCtrlEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java
new file mode 100644
index 000000000000..377265dd65bd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java
@@ -0,0 +1,296 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleIconChoiceCtrlEntry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+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.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.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 {
+
+ XDesktop the_Desk;
+ XTextDocument xTextDoc;
+ 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(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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( 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)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) 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.PUSHBUTTON, "Close");
+
+ accCloseButton = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, closeButton);
+
+ log.println("ImplementationName: "+ util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XTextDocument aDoc = xTextDoc;
+
+ 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");
+
+ 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/_svtools/AccessibleTabBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java
new file mode 100644
index 000000000000..241f246236bf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleTabBar.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+
+
+public class AccessibleTabBar extends TestCase {
+
+ 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) {
+ xDoc.dispose();
+ }
+ }
+
+ /**
+ * 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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( tParam.getMSF());
+
+ try {
+ log.println( "creating a 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;
+
+ try {
+ oObj = (XInterface) 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);
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ 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.currentThread().sleep(500) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java
new file mode 100644
index 000000000000..3ac194e27628
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleTabBarPage.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DesktopTools;
+import util.SOfficeFactory;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleComponent
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li>
+ * <code>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.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 {
+
+ 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) {
+ xDoc.dispose();
+ }
+ }
+
+ /**
+ * 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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( tParam.getMSF());
+
+ try {
+ log.println( "creating a 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) 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);
+ oObj = at.getAccessibleObjectForRole(xRoot, (short) 30);
+ //AccessibleRole.PAGETAB), "Sheet1");
+
+ 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.currentThread().sleep(500) ;
+ } 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..28d5223e93fe
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java
@@ -0,0 +1,220 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleTabBarPageList.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleComponent
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li>
+ * <code>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.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 {
+
+ 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) {
+ xDoc.dispose();
+ }
+ }
+
+ /**
+ * 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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( tParam.getMSF());
+
+ try {
+ log.println( "creating a spreadsheet 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) 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.PAGETABLIST);
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("XAccessibleSelection.multiSelection",
+ new Boolean(false));
+
+ 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) ;
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java
new file mode 100644
index 000000000000..0e3b825f5df7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java
@@ -0,0 +1,268 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleTreeListBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+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.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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.lang.XInitialization;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleComponent
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.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 {
+
+ 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(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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( 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;
+
+ try {
+ oObj = (XInterface) 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();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE);
+
+ log.println("ImplementationName: "+ util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent fXComp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ fXComp.grabFocus();
+ }
+ });
+
+ 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(2000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java
new file mode 100644
index 000000000000..ee34f7634826
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java
@@ -0,0 +1,286 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleTreeListBoxEntry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:17:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svtools;
+
+import java.io.PrintWriter;
+
+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.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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.lang.XInitialization;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleComponent
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleContext
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleAction
+ * </code></li>
+ * <li><code>drafts::com::sun::star::accessibility::XAccessibleText
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.com.sun.star.accessibility.XAccessibleAction
+ * @see drafts.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 {
+
+ 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(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.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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see ifc.accessibility._XAccessibleText
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.com.sun.star.accessibility.XAccessibleText
+ */
+ 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( 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;
+
+ try {
+ oObj = (XInterface) 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();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.LABEL, "Bibliography");
+
+ log.println("ImplementationName: "+ util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent fXComp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+
+ 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.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/_svx/AccessibleControlShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java
new file mode 100644
index 000000000000..633c3e9aaeb4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleControlShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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;
+
+public class AccessibleControlShape extends TestCase {
+
+ XComponent xDrawDoc;
+ XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ 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();
+
+ XWindow xWindow = at.getCurrentWindow (tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE,
+ "PushButton");
+
+ // 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/AccessibleGraphicShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java
new file mode 100644
index 000000000000..994f1415b8c9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleGraphicShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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;
+
+public class AccessibleGraphicShape extends TestCase {
+
+ XComponent xDrawDoc;
+ XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ 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( 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 (tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.SHAPE, "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..5a63378c9ba0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleOLEShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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;
+
+public class AccessibleOLEShape extends TestCase {
+
+ XComponent xDrawDoc;
+ XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ 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( 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 (tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log,xRoot);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.SHAPE, "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..67ccb06f5418
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessiblePageShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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;
+
+public class AccessiblePageShape extends TestCase {
+
+ XComponent xDrawDoc;
+ XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ 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" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF());
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow (tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE,
+ "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..039abaf07eb9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessiblePresentationGraphicShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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.beans.XPropertySet;
+
+public class AccessiblePresentationGraphicShape extends TestCase {
+
+ XComponent xDoc;
+ XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDoc.dispose();
+ }
+
+ 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( tParam.getMSF());
+ 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 (tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.SHAPE, "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..b50f8fb39d8c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessiblePresentationOLEShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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.beans.XPropertySet;
+
+public class AccessiblePresentationOLEShape extends TestCase {
+
+ XComponent xDrawDoc;
+ XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ 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( tParam.getMSF());
+ 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 (tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+ //at.printAccessibleTree(log,xRoot);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.SHAPE, "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..33b195dddb81
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessiblePresentationShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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;
+
+public class AccessiblePresentationShape extends TestCase {
+
+ XComponent xDrawDoc;
+ XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ 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( tParam.getMSF());
+ 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 (tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ //at.printAccessibleTree(log,xRoot);
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.SHAPE, "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..dc4cca073ef1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleShape.java
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+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;
+
+public class AccessibleShape extends TestCase {
+
+ XComponent xDrawDoc;
+ XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ 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( 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 (tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.SHAPE, "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..fee9c29ba26e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/GraphicExporter.java
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ * $RCSfile: GraphicExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XComponent xDrawDoc;
+
+ /**
+ * Creates a new draw document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes the draw document created before
+ */
+ 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.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 = 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( 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(tParam.getMSF())+"picture.jpg";
+
+ final XSimpleFileAccess fAcc ;
+ try {
+ Object oFAcc = 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("CANCEL", new Boolean(false));
+
+
+ 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..ab4997c1ec30
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxDrawPage.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.XMasterPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.lang.XComponent;
+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.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 {
+
+ XSpreadsheetDocument xDoc = null;
+
+ /**
+ * Creates a new Draw document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ //xDoc.dispose();
+ }
+
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ 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) oDP.getByIndex(0);
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ }
+
+ // 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);
+
+ // 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..065b0fb64370
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java
@@ -0,0 +1,286 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxGraphCtrlAccessibleContext.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:18:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XFrame;
+import com.sun.star.lang.XComponent;
+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;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.DrawTools;
+import util.utils;
+
+
+/**
+ *
+ * @author sw93809
+ * @version
+ */
+public class SvxGraphCtrlAccessibleContext extends TestCase{
+
+ 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( 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,
+ 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 {
+ oObj = (XInterface) 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);
+
+ 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);
+ final XShape shape = oShape;
+
+ 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,
+ 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 " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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( 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..d6dcb6d3e3ee
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java
@@ -0,0 +1,290 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxGraphicObject.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.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.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+/**
+ * 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 {
+
+ XComponent xDrawDoc;
+
+ /**
+ * Creates a new Draw document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes the Draw document created before
+ */
+ 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.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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ 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( 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) oShapeProps.getPropertyValue("Style");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+ tEnv.addObjRelation("Style1",aStyle);
+
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) oShapeProps.getPropertyValue("Style");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException 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) 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) 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);
+
+ // 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..45f259c608b5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShape.java
@@ -0,0 +1,253 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.style.XStyle;
+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.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+/**
+ * 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 {
+
+ 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( 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 " );
+ xDrawDoc.dispose();
+ }
+
+ /**
+ * 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( 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) oShapeProps.getPropertyValue("Style");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+ tEnv.addObjRelation("Style1",aStyle);
+
+ oShapeProps = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) oShapeProps.getPropertyValue("Style");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException 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..ca32439cb305
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java
@@ -0,0 +1,275 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxShapeCircle.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.style.XStyle;
+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.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+/**
+ * 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 {
+
+ 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( 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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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>
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ 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(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) oShapeProps.getPropertyValue("Style");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) oShapeProps.getPropertyValue("Style");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException 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..d3575f243b31
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxShapeCollection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+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.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+public class SvxShapeCollection extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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( tParam.getMSF());
+ Object col = 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..c54b484e2165
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxShapeConnector.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.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.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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 {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * * 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( 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) oShapeProps.getPropertyValue("Style");
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) 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..0e1ef04874dc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxShapeControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.style.XStyle;
+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.SOfficeFactory;
+
+public class SvxShapeControl extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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;
+ 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(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) oShapeProps.getPropertyValue("Style");
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) 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..df0867559f98
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java
@@ -0,0 +1,206 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxShapeDimensioning.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.style.XStyle;
+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.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+public class SvxShapeDimensioning extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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;
+ 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( tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,4000,4000,3000,3000,"Measure");
+
+ XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oShape) ;
+
+ //xProps.setPropertyValue("LineStart",
+ // new Point[] {new Point(3000, 3000)}) ;
+ //xProps.setPropertyValue("LineEnd",
+ // new Point[] {new Point(5000, 6000)}) ;
+
+ 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(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) oShapeProps.getPropertyValue("Style");
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) 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..989247eee273
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxShapeGroup.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.style.XStyle;
+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.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.drawing._XDrawPage
+ *
+ */
+
+public class SvxShapeGroup extends TestCase {
+
+ 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( 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");
+ xDrawDoc.dispose();
+
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ XShapes oShapes = null;
+ XDrawPage oMasterPage = null;
+ XDrawPages oGroup = 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( 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) 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) oShapeProps.getPropertyValue("Style");
+ } catch (Exception e) {}
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,Shape2);
+ XStyle aStyle2 = null;
+ try {
+ aStyle2 = (XStyle) 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..a2ba9f5ddab1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java
@@ -0,0 +1,293 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxShapePolyPolygon.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.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.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+/**
+ * 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 {
+
+ 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( 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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * * 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( 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(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) oShapeProps.getPropertyValue("Style");
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) 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..f06eea7beb81
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java
@@ -0,0 +1,307 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxShapePolyPolygonBezier.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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.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.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+/**
+ * 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 {
+
+ 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( 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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * * 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( 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(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) oShapeProps.getPropertyValue("Style");
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) 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..90eb1865178c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxUnoNumberingRules.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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 {
+ XComponent xDrawDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc(tParam.getMSF());
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory docMSF = (XMultiServiceFactory)UnoRuntime.
+ queryInterface(XMultiServiceFactory.class, xDrawDoc);
+
+ try {
+ XInterface xInt = (XInterface)docMSF.createInstance(
+ "com.sun.star.text.NumberingRules");
+
+ TestEnvironment tEnv = new TestEnvironment(xInt);
+
+ return tEnv;
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ xDrawDoc.dispose();
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoText.java b/qadevOOo/tests/java/mod/_svx/SvxUnoText.java
new file mode 100644
index 000000000000..f3c2d176175e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoText.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxUnoText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+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;
+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;
+
+public class SvxUnoText extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * * 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;
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(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) ;
+ 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);
+ 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..81ce2c87ef36
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxUnoTextContent.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+public class SvxUnoTextContent extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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(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) 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..c4382a3d0635
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxUnoTextContentEnum.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+public class SvxUnoTextContentEnum extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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(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..ec633fbdb10e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxUnoTextCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+public class SvxUnoTextCursor extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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(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..bc1c5d1ace55
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxUnoTextField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+/**
+ *
+ * initial description
+ * @see ifc._XComponent
+ * @see ifc._TextContent
+ * @see ifc._XTextContent
+ * @see ifc._XTextField
+ *
+ */
+public class SvxUnoTextField extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+ /**
+ * 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;
+ 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( 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);
+ }
+
+ // create testobject here
+ try {
+
+ XText the_Text = (XText) UnoRuntime.queryInterface(XText.class,oShape);
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface( XMultiServiceFactory.class, xDrawDoc );
+ XTextCursor 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 );
+
+
+ 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..02f3ca603e49
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxUnoTextRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+public class SvxUnoTextRange extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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(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)
+ xEA.createEnumeration().nextElement() ;
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, oTextContent) ;
+
+ oObj = (XInterface) 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..cedba75fe520
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * $RCSfile: SvxUnoTextRangeEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._svx;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+public class SvxUnoTextRangeEnumeration extends TestCase {
+
+ 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(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 " );
+ xDrawDoc.dispose();
+ }
+
+
+ /**
+ * 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(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)
+ 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/SwAccessibleDocumentPageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
new file mode 100644
index 000000000000..125a0b3b851a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
@@ -0,0 +1,257 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleDocumentPageView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import lib.Status;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.util.XURLTransformer;
+import com.sun.star.util.URL;
+import com.sun.star.frame.XDispatch;
+
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.ControlCharacter;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+
+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,
+ 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT );
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ at.printAccessibleTree(log, xRoot);
+ util.dbg.printInterfaces(xController);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLLBAR);
+ final XAccessibleValue xAccVal = (XAccessibleValue) UnoRuntime.queryInterface
+ (XAccessibleValue.class, SearchedContext) ;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ xAccVal.setCurrentValue(xAccVal.getMaximumValue());
+ xAccVal.setCurrentValue(xAccVal.getMinimumValue());
+ }
+ });
+
+ 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");
+ }
+ }
+ }
+ }
+
+ /**
+ * Sleeps for 1 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) ;
+ }
+ }
+
+
+ /**
+ * 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(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..53c4036ace6f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleDocumentView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+
+/**
+* Test of accessible object for the text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see drafts.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;
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLLBAR);
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(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..38315abe3f8a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleEndnoteView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+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.view.XViewSettingsSupplier;
+import com.sun.star.beans.XPropertySet;
+
+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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.ENDNOTE);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot);
+
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(Param.getMSF());
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
new file mode 100644
index 000000000000..34e9154af09b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleFooterView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:18:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+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.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+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;
+
+/**
+* Test of accessible object for a footer of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see drafts.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) StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle) 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);
+ }
+
+ 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.FOOTER);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+// at.printAccessibleTree(log, xRoot);
+
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(Param.getMSF());
+ }
+
+ 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/_sw/SwAccessibleFootnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
new file mode 100644
index 000000000000..53ab1b285f95
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
@@ -0,0 +1,231 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleFootnoteView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+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.XFootnote;
+import com.sun.star.view.XViewSettingsSupplier;
+import com.sun.star.beans.XPropertySet;
+
+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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.FOOTNOTE);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ //at.printAccessibleTree(log, xRoot);
+
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(Param.getMSF());
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
new file mode 100644
index 000000000000..e99bbcaba8e5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleHeaderView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:18:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.style.XStyle;
+import com.sun.star.beans.XPropertySet;
+
+/**
+* Test of accessible object for a header of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see drafts.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) StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle) 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);
+ }
+
+ 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.HEADER);
+
+ oObj = at.SearchedContext;
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+ at.printAccessibleTree(log, xRoot);
+
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(Param.getMSF());
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java
new file mode 100644
index 000000000000..5991f5a738e5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessiblePageView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+import lib.Status;
+import lib.StatusException;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.util.XURLTransformer;
+import com.sun.star.util.URL;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.ControlCharacter;
+
+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;
+
+ 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 );
+ }
+
+ 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,
+ 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(Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot);
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLLBAR);
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(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) ;
+ }
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java
new file mode 100644
index 000000000000..0eecae27357e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleParagraphView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.ControlCharacter;
+
+/**
+* Test of accessible object for paragraph of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see drafts.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("Text for testing of the interface XAccessibleText");
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xTextDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(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 = "Text for testing of the interface 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(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..ef0249cd7d21
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleTableCellView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.text.XTextTable;
+
+/**
+* Test of accessible object for the table cell of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see drafts.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(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(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);
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(Param.getMSF());
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
new file mode 100644
index 000000000000..834af30210ab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleTableView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.text.XTextTable;
+import com.sun.star.view.XViewSettingsSupplier;
+import com.sun.star.beans.XPropertySet;
+
+/**
+* Test of accessible object for the table of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see drafts.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(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(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);
+
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(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..50b7661dfb60
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleTextEmbeddedObject.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.lang.XComponent;
+import com.sun.star.view.XViewSettingsSupplier;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.text.XTextDocument;
+
+/**
+* Test of accessible object for the text embedded object of a text document.<p>
+* Object implements the following interfaces :
+* <ul>
+* <li> <code>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see drafts.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(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);
+
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(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..e0c719bd9d05
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleTextFrameView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.awt.Size;
+import com.sun.star.text.XTextFrame;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.text.TextContentAnchorType;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextContent;
+import com.sun.star.beans.XPropertySet;
+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>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see drafts.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( Param.getMSF() );
+ // creating Frames
+ log.println( "creating Frames" );
+ Size oSize = new Size();
+ 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(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);
+
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(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..89c953eddfcf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
@@ -0,0 +1,210 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwAccessibleTextGraphicObject.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sw $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+package mod._sw;
+
+import lib.TestCase;
+import lib.TestParameters;
+import java.io.PrintWriter;
+import lib.TestEnvironment;
+import com.sun.star.uno.XInterface;
+import util.SOfficeFactory;
+import lib.StatusException;
+import com.sun.star.text.XTextDocument;
+import util.WriterTools;
+import com.sun.star.frame.XController;
+import util.AccessibilityTools;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.frame.XModel;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.awt.XWindow;
+import drafts.com.sun.star.accessibility.XAccessible;
+import util.utils;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextContent;
+import com.sun.star.beans.XPropertySet;
+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>drafts::com::sun::star::accessibility::XAccessible</code></li>
+* </ul>
+* @see drafts.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(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(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);
+
+ 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");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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(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..abd55633100c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXAutoTextContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:42 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XAutoTextContainer;
+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.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 {
+ XInterface oInterface = null;
+ 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 = 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..4257ce832709
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java
@@ -0,0 +1,271 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXAutoTextEntry.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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.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.DefaultDsc;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+/**
+ * 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 ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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 " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.text.AutoTextContainer</code>, then selects a non-empty
+ * group from the given container using <code>XIndexAccess</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 = 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);
+ }
+
+ XIndexAccess oContIndex = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oContainer);
+ try {
+ oObj = (XInterface) oContIndex.getByIndex(n);
+ XIndexAccess oObjCount = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oObj);
+ nCount = oObjCount.getCount();
+ while (nCount < 1) {
+ oObj = (XInterface) oContIndex.getByIndex(n++);
+ oObjCount = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oObj);
+ nCount = oObjCount.getCount();
+ }
+ } 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]);
+ }
+
+ // Some Debug info
+ XNameAccess dObj = null;
+ log.println("Some debugging info:");
+ for ( n=0; n < oContIndex.getCount(); n++ ) {
+ try {
+ dObj = (XNameAccess) oContIndex.getByIndex(n);
+ } catch ( com.sun.star.uno.Exception e ) {
+ e.printStackTrace(log);
+ }
+ XNamed namedGroup = (XNamed) UnoRuntime.queryInterface
+ (XNamed.class, dObj);
+ log.println(" " + namedGroup.getName() + ":");
+ String[] eNames = dObj.getElementNames();
+ for (int i=0; i<eNames.length; i++) {
+ log.print(eNames[i] + ", ");
+ }
+ log.println();
+ }
+ log.println("=======================================");
+
+
+ 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) 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);
+ }
+
+ 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..ca620ce4be1b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXAutoTextGroup.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.container.XElementAccess;
+import com.sun.star.container.XIndexAccess;
+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.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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.text.AutoTextContainer</code>, then selects
+ * non-empty group from the given container.<p>
+ * Object relations created :
+ * <ul>
+ * <li> <code>'TextRange'</code> for
+ * {@link ifc.text._XAutoTextGroup} range of text</li>
+ * </ul>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+
+ XInterface oObj = null;
+ XAutoTextContainer oContainer;
+
+ log.println( "creating a test environment" );
+ try {
+ XMultiServiceFactory myMSF = 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);
+ }
+
+ XIndexAccess oContIndex = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oContainer);
+
+ //search for a non-empty AutoTextGroup
+ try {
+ int n = 0;
+ int count = oContIndex.getCount();
+ oObj = (XInterface) oContIndex.getByIndex(n);
+ XElementAccess oElement = (XElementAccess)
+ UnoRuntime.queryInterface(XElementAccess.class, oObj);
+ while ( ( !oElement.hasElements() ) && ( n < count ) ) {
+ n++;
+ oObj = (XInterface) oContIndex.getByIndex(n);
+ oElement = (XElementAccess)
+ UnoRuntime.queryInterface(XElementAccess.class, oObj);
+ }
+ } catch ( com.sun.star.lang.WrappedTargetException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get AutoTextGroup", e);
+ } catch ( com.sun.star.lang.IndexOutOfBoundsException e ) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get AutoTextGroup", e);
+ }
+
+ 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..300b72284124
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXBodyText.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXBodyText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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.InstCreator;
+import util.ParagraphDsc;
+import util.SOfficeFactory;
+import util.TableDsc;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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..a546478222cd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXBookmark.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXBookmark.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:41 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextRange;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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( 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( "Couldnt 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..976c9ccdff58
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXBookmarks.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXBookmarks.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.container.XNameAccess;
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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( "Couldnt 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..db190fc4b6c5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXCell.java
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXCell.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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( 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..91a8c1f0ec39
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXCellRange.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXCellRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:40 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.UnoRuntime;
+
+import lib.*;
+
+import util.SOfficeFactory;
+import com.sun.star.lang.XMultiServiceFactory;
+import util.InstDescr;
+import util.TableDsc;
+import util.InstCreator;
+
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextTable;
+import com.sun.star.table.XCellRange;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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);
+
+ 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..6a0ff43acbed
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXChapterNumbering.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.text.XChapterNumberingSupplier;
+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 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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();
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ 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..ed1cf108ad8f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXDocumentIndex.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+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.XTextSection;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.*;
+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.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( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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) {
+ XInterface oObj = null;
+ XTextContent xTC = null;
+ XPropertySet xPS = null;
+ Object instance = null;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(tParam.getMSF());
+ log.println( "creating a test environment" );
+ try {
+ xTC = SOF.createIndex(xTextDoc, "com.sun.star.text.DocumentIndex");
+ xPS = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, xTC);
+ 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));
+
+ // 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..38491271207d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXDocumentIndexMark.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.text.DocumentIndexMark</code>, attaches text to
+ * created DocumentIndexMark, and inserts DocumentIndexMark to the
+ * text document.
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+ XInterface oObj = null;
+ XTextContent xTC = null;
+
+ log.println( "creating a test environment" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+
+ 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 {
+ xDIM.attach(oText);
+ //xDIM.setMarkEntry("SwXDocumentIndexMark");
+ } catch( com.sun.star.lang.IllegalArgumentException e ) {
+ log.println("Error: " + e);
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't attach IndexMark", e);
+ }
+
+ 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..b35e35032ab1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXDocumentIndexes.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+
+/**
+ * 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( 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 " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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( 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..df03b257ab8f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXDrawPage.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXDrawPage.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XShapes;
+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.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 SwXDrawPage extends TestCase {
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates text document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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;
+ XDrawPages xDPs = null;
+ XDrawPage xDP = null;
+ XDrawPage xDPage = null;
+ XShapes oShapes = null;
+
+ log.println( "creating a test environment" );
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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..697f0895eaae
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXEndnoteProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.dbg;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.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;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = null;
+ String oObjLog = null;
+ boolean bOK = true;
+ boolean result = true;
+ 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..3d64c94fdd7e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXFieldEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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..8f54da209031
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXFieldMaster.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.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..0edc54a298ac
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnote.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXFootnote.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+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.XTextContent;
+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.FrameDsc;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.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) {
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = null;
+ String oObjLog = null;
+ boolean bOK = true;
+ boolean result = true;
+ 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..34e991ac81d4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXFootnoteProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.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;
+ XComponentLoader oCLoader = null;
+ XDesktop oDesktop = null;
+ String oObjLog = null;
+ boolean bOK = true;
+ boolean result = true;
+ 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..ebb01a3bd349
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXFootnoteText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.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..52b669b11194
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXFootnotes.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.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..32c0e5fc3ea9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXFrames.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXFrames.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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.text.XTextFramesSupplier;
+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;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.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;
+ Integer fwp = new Integer(3);
+ XPropertySet PropSet = 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 );
+ PropSet = (XPropertySet)
+ UnoRuntime.queryInterface( XPropertySet.class, oFrame1 );
+ } 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..5b6fe7d691ec
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXHeadFootText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.container.XNameAccess;
+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.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.InstCreator;
+import util.ParagraphDsc;
+import util.SOfficeFactory;
+import util.TableDsc;
+
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) throws StatusException {
+ XInterface oObj = null;
+ XPropertySet PropSet;
+ XPropertySetInfo PropSetInfo;
+ XNameAccess PageStyles = null;
+ XStyle StdStyle = null;
+ XText oText = null;
+ XText oHeader = null;
+ XText oHeadFootTxt = null;
+ int i, x;
+
+ 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) StyleFamNames.getByName("PageStyles");
+ StdStyle = (XStyle) 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);
+ }
+
+ 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" );
+ } 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);
+ }
+
+ // get the bodytext of textdocument here
+ oObj = xTextDoc.getText();
+
+ 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 TextDocument as mod relation to environment" );
+ tEnv.addObjRelation("TEXTDOC", xTextDoc);
+
+ log.println( "adding InstDescriptor object" );
+ TableDsc tDsc = new TableDsc( 6, 4 );
+
+ log.println( "adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xTextDoc, tDsc ) );
+
+ 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..733d9a8070ac
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXLineNumberingProperties.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.dbg;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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/SwXModule.java b/qadevOOo/tests/java/mod/_sw/SwXModule.java
new file mode 100644
index 000000000000..55e05e6b8b36
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXModule.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXModule.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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.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 = 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..c1a401052932
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXNumberingRules.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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.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.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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ 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)
+ 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);
+ }
+
+ try {
+ oObj = (XInterface) NumStyleI.getByIndex(0);
+ XPropertySet props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oObj);
+ oObj = (XInterface) props.getPropertyValue("NumberingRules");
+ } 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);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ 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..e5269b7d0f97
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXParagraph.java
@@ -0,0 +1,289 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXParagraph.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+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.XTextContent;
+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;
+
+import com.sun.star.frame.XModel;
+
+/**
+ * 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 ) {
+
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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) {
+ xTextDoc.dispose();
+ }
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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" );
+
+ XModel mod = xTextDoc.getCurrentController().getModel();
+
+ 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) oEnum.nextElement();
+ XEnumerationAccess oEnumB = (XEnumerationAccess)
+ UnoRuntime.queryInterface( XEnumerationAccess.class, para );
+ XEnumeration oEnum2 = oEnumB.createEnumeration();
+ port = (XInterface) 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...");
+ }
+
+ 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 );
+ }
+
+ Object instance = null;
+
+ try {
+ oObj = (XInterface) 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..2bc3247f5b7a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXParagraphEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+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 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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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..722f7e0d1d0f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXPrintSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.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 = 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..65f4944cf245
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXPropertySet.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXPropertySet.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.text.XTextDocument;
+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 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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( 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( "Couldnt 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..ea6e5f230409
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXPropertySetInfo.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXPropertySetInfo.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+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 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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( 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( "Couldnt 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..9f315e74a7dd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXReferenceMark.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ 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.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( "Couldnt 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..a568e3a3847e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXReferenceMarks.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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( "Couldnt 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( "Couldnt 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..1e84b75043c0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXShape.java
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXShape.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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.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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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..15e8ad1904bf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXStyle.java
@@ -0,0 +1,275 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXStyle.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.SOfficeFactory;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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) {
+
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ 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) oSFsIA.getByIndex(0);
+ XIndexAccess oSFIA = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSFNA);
+ oStyle = (XStyle) 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 );
+ }
+
+ 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..949009c98173
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXStyleFamilies.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.style.XStyleFamiliesSupplier;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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 {
+ XInterface oInterface = null;
+ XInterface oObj = null;
+
+ 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..01bc0bf03794
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXStyleFamily.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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.style.XStyleFamiliesSupplier;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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>
+ */
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log ) throws StatusException {
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ XNameAccess oSFNA = null;
+
+ log.println( "Creating Test Environment..." );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) 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);
+ }
+
+ 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 = 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 SwXStyle
+
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java b/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java
new file mode 100644
index 000000000000..b6dca9aa15e0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTableCellText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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..9742e0be9d7f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTableColumns.java
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTableColumns.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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));
+
+ 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..808b32d47e2d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTableRows.java
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTableRows.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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( 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..d3c4596b14a4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java
@@ -0,0 +1,206 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextColumns.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+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.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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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.
+ */
+ public TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log ) throws StatusException {
+ 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) oSFIA.getByIndex(2);
+ oStyle = (XStyle) 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);
+ }
+
+ try {
+ log.println("Getting property ('TextColumns') value of style "
+ + oStyle.getName());
+ XPropertySet xProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oStyle);
+ oObj = (XTextColumns) 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);
+ }
+
+ 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..5e3470fdceb0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java
@@ -0,0 +1,321 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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;
+import java.io.PrintWriter;
+import java.util.Vector;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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 text = paragrCursor.getString();
+ out.println("Text after sorting:\n" + text);
+ boolean res = false;
+ if (isSortNumbering) {
+ if (isSortAscending) {
+ res = text.endsWith("\r\n3\r\n4\r\n23\r\n");
+ if (!res) {
+ out.println("Text must ends by:\n" +
+ "\r\n3\r\n4\r\n23\r\n");
+ }
+ } else {
+ res = text.startsWith("23\r\n4\r\n3\r\n");
+ if (!res) {
+ out.println("Text must starts with:\n" +
+ "23\r\n4\r\n3\r\n");
+ }
+ }
+ } else {
+ if (isSortAscending) {
+ res = text.equals("\r\n23\r\n3\r\n4\r\na\r\nab\r\nb\r\n");
+ 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.equals("b\r\nab\r\na\r\n4\r\n3\r\n23\r\n");
+ 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..270ab95b3a27
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextDefaults.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+//API Interfaces
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Disposes text document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java
new file mode 100644
index 000000000000..30008bc42384
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextDocument.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+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.XSelectionSupplier;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+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 " );
+ xTextDoc.dispose();
+ xSecondTextDoc.dispose();
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+
+ public synchronized TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ TestEnvironment tEnv = null;
+ XTextTable the_table = null;
+
+ if (xTextDoc != null) xTextDoc.dispose();
+ if (xSecondTextDoc != null) xSecondTextDoc.dispose();
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc( Param.getMSF() );
+
+ 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" );
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
+ 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( "creating a second textdocument" );
+ xSecondTextDoc = WriterTools.createTextDoc( Param.getMSF() );
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldnt 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();
+
+ 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..52d525ace2cb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextEmbeddedObject.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextEmbeddedObjectsSupplier;
+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;
+import util.utils;
+
+/**
+ *
+ * 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;
+ public XComponent 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( 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( "Couldnt 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 " );
+ xTextDoc.dispose();
+ oDoc.dispose();
+ }
+
+
+ /**
+ * 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( tParam.getMSF() );
+ String testdoc = utils.getFullTestURL("SwXTextEmbeddedObject.sdw");
+ System.out.println(testdoc);
+ try {
+ oDoc = SOF.loadDocument(testdoc);
+ }
+ catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't open document",e);
+ }
+ XTextEmbeddedObjectsSupplier oTEOS = (XTextEmbeddedObjectsSupplier)
+ UnoRuntime.queryInterface(XTextEmbeddedObjectsSupplier.class, oDoc);
+
+ XNameAccess oEmObj = oTEOS.getEmbeddedObjects();
+ XIndexAccess oEmIn = (XIndexAccess)UnoRuntime.queryInterface(
+ XIndexAccess.class, oEmObj);
+
+ try{
+ oObj = (XInterface)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");
+
+ 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..a98af5830c6e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextEmbeddedObjects.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextEmbeddedObjectsSupplier;
+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;
+import util.utils;
+
+
+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( tParam.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ oDoc = (XTextDocument) UnoRuntime.queryInterface
+ (XTextDocument.class, SOF.loadDocument
+ (utils.getFullTestURL("SwXTextEmbeddedObject.sdw")));
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldnt 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 " );
+ oDoc.dispose();
+ }
+
+
+ /**
+ * 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
+
+ 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..6aaeb9bdcf03
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextField.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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( 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( "Couldnt 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 " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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..494ab345ef36
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextFieldMasters.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFieldsSupplier;
+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;
+
+/**
+ *
+ * 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( 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( "Couldnt 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 " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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..c45994b4516e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextFieldTypes.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextFieldsSupplier;
+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;
+
+/**
+ *
+ * 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( 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( "Couldnt 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 " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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..9d4c6c6b59ff
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextFrame.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.awt.Size;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ XInterface oObjI = null;
+ XTextFrame oFrame1 = null;
+ XPropertySet oPropSet = null;
+ XPropertySetInfo oPropSetInfo = 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( Param.getMSF() );
+
+ // creating Frames
+ log.println( "creating Frames" );
+
+ Size oSize = new Size();
+
+ Object instance = null;
+
+ 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",
+ 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);
+ 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");
+ 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..db0b2b35f8db
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextFrameText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+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;
+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;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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;
+ XPropertySetInfo oPropSetInfo = 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( 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..5ad8b94c7baa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextGraphicObject.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+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( 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 " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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;
+ SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
+
+ Object instance = null;
+
+ try {
+ oGObject = SOF.createInstance
+ (xTextDoc,"com.sun.star.text.GraphicObject");
+ instance = 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("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());
+
+ 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..b17f459fbfcb
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextGraphicObjects.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+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( 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 " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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( 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..49b0ca1e5dec
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextPortion.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * * 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();
+ 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)oEnum.nextElement();
+ log.println("Element Nr.: " + n );
+ } 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();
+ try {
+ oObj = (XInterface)oEnum2.nextElement();
+ } catch ( Exception e) {
+ log.println("Couldn't get TextPortion");
+ e.printStackTrace();
+ 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..8564f9d44f84
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextPortionEnumeration.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.container.XEnumeration;
+import com.sun.star.container.XEnumerationAccess;
+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 java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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 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" );
+
+ short L = 1;
+
+ 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)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..3548f887e62e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextRange.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextRange.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+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.SOfficeFactory;
+import util.utils;
+
+public class SwXTextRange extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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..b888ad1cddb9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextRanges.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextRanges.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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..4f225f98959d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextSearch.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextSearch.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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..bf2ec7660dcd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextSection.java
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextSection.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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.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.InstCreator;
+import util.SOfficeFactory;
+import util.TableDsc;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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)
+ 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);
+ String[] oTSSNames = oTSSuppName.getElementNames();
+ XIndexAccess oTSSuppIndex = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oTSSuppName);
+ int TScount = oTSSuppIndex.getCount();
+ log.println( "getting a TextSection with the XTextSectionSupplier()" );
+ xTS = (XTextSection)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..bc7e4f332954
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextSections.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextSections.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XSimpleText;
+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.XTextSection;
+import com.sun.star.text.XTextSectionsSupplier;
+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;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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;
+ XTextSection xTS = 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();
+
+ XSimpleText oSText = (XSimpleText)
+ UnoRuntime.queryInterface( XSimpleText.class, oText );
+
+ 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..a4914b75f831
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextTable.java
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextTable.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.table.XCell;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextRange;
+import com.sun.star.text.XTextTable;
+import com.sun.star.uno.UnoRuntime;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.ValueComparer;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ 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, 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() {
+
+ String[] values = {"4", "b", "3", "a", "23", "ab"};
+ for(int i = 0; i < 6; i++) {
+ XCell cell = oTable.getCellByName("A" + (i+1));
+ XTextRange textRange = (XTextRange)
+ UnoRuntime.queryInterface(XTextRange.class, cell);
+ textRange.setString(values[i]);
+ }
+ }
+ 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);
+ } else {
+ String[] rightVal = {"23", "4", "3"};
+ String[] vals = {value[0], value[1], value[2]};
+ res = ValueComparer.equalValue(vals, rightVal);
+ }
+ } else {
+ if (isSortAscending) {
+ String[] rightVal = {"23", "3", "4", "a", "ab", "b"};
+ res = ValueComparer.equalValue(value, rightVal);
+ } else {
+ String[] rightVal = {"b", "ab", "a", "4", "3", "23"};
+ res = ValueComparer.equalValue(value, rightVal);
+ }
+ }
+
+ 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..e04b011c3906
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextTableCursor.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextTableCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.table.XCell;
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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( 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);
+ }
+
+ XCell oCell = oTable.getCellByName("A1");
+ XText oCellText = (XText)UnoRuntime.queryInterface(XText.class, oCell);
+
+ 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);
+
+ 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..38a09cbdaa56
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextTableRow.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+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.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 SwXTextTableRow extends TestCase {
+ XTextDocument xTextDoc;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+ public synchronized TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log )
+ throws StatusException {
+
+ XInterface oInterface = null;
+ XInterface oObj = null;
+ XTextTable oTable = null;
+ boolean result = true;
+
+
+ // 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( 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) 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..ad341af2c75d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextTables.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextTables.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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;
+ XInterface oInterface = null;
+ String oObjLog = 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( 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..166bae720649
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextView.java
@@ -0,0 +1,260 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextView.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import java.io.PrintWriter;
+import java.util.Comparator;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+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.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XSearchDescriptor;
+import com.sun.star.util.XSearchable;
+import com.sun.star.view.XSelectionSupplier;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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;
+
+ /**
+ * 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( 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( "Couldnt 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 " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * * 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
+ log.println( "creating a test environment" );
+
+ XController xContr = xTextDoc.getCurrentController();
+
+ TestEnvironment tEnv = new TestEnvironment(xContr);
+
+ util.dbg.getSuppServices(xContr);
+
+ SOfficeFactory SOF=SOfficeFactory.getFactory( 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);
+
+ 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..bea7ebb6fbc5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXTextViewCursor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextViewCursorSupplier;
+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;
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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 \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java b/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java
new file mode 100644
index 000000000000..a9fe9ae89f28
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwXViewSettings.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.view.XViewSettingsSupplier;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+
+/**
+ *
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * 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..2b1ad4e55e68
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java
@@ -0,0 +1,228 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ 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.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 = 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..8857c48a274b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLContentImporter.java
@@ -0,0 +1,211 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ 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.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 = 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..a2cd471939f9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLExporter.java
@@ -0,0 +1,231 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ 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.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 = 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..d355f5d1851d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLImporter.java
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ 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.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 = 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..908a72f49dd7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ 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.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 = 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..c7b6b369cf59
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentInfoSupplier;
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ 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.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 = 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..d838039b4dc4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+
+ }
+
+ /**
+ * Document disposed here.
+ */
+ 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.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 = 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..23070eb9ca04
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XImporter;
+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.XPrintSettingsSupplier;
+import com.sun.star.view.XViewSettingsSupplier;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ 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.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 ;
+ XPrintSettingsSupplier prnSetSup = 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Writer.XMLSettingsImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xTextDoc) ;
+
+ Object globSet = xMSF.createInstance
+ ("com.sun.star.text.GlobalSettings") ;
+ prnSetSup = (XPrintSettingsSupplier) UnoRuntime.queryInterface
+ (XPrintSettingsSupplier.class, globSet) ;
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace(log) ;
+ throw new StatusException("Can't create component.", e) ;
+ }
+
+ final XPropertySet prnSet = prnSetSup.getPrintSettings() ;
+
+ 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..ee77bcc66c50
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ 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.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 = 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();
+ PrintWriter logF = log ;
+
+ // Change property "Prefix"
+ try {
+ set.setPropertyValue("Prefix","New Property");
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldnt 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..4b1051907e1f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sw;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XImporter;
+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;
+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.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( 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( "Couldnt create document", e );
+ }
+ }
+
+ /**
+ * Text document destroyed.
+ */
+ 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.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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Writer.XMLStylesImporter") ;
+ 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-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..64f30a5567ec
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_sysdtrans/SystemClipboard.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: SystemClipboard.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:18:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._sysdtrans;
+
+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 SystemClipboard extends TestCase {
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = 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..b346aaaa30a0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_syssh/SystemShellExecute.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: SystemShellExecute.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._syssh;
+
+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 SystemShellExecute extends TestCase {
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory xMSF = 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..0b89c642281a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_tcv/TypeConverter.java
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: TypeConverter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._tcv;
+
+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 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 = 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..1cb7ac40fcb4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_tdmgr/TypeDescriptionManager.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: TypeDescriptionManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._tdmgr;
+
+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 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 = 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..b58d73a512cc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_text/DefaultNumberingProvider.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: DefaultNumberingProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._text;
+
+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.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 = 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..4444e64e4adf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java
@@ -0,0 +1,282 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleButton.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleText;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleValue
+ * @see drafts.com.sun.star.accessibility.XAccessibleAction
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ 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;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF());
+
+ try {
+ oObj = (XInterface) 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();
+
+ DiagThread psDiag = new DiagThread(xTextDoc,Param.getMSF());
+ psDiag.start();
+ try{
+ psDiag.join();
+ } catch (Exception e) {}
+
+ shortWait();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+// at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON,"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());
+
+ 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");
+ }
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Opens new writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ }
+ }
+
+ /**
+ * 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 = "slot:5302";
+ 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");
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java
new file mode 100644
index 000000000000..08b53272fa4a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java
@@ -0,0 +1,279 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleCheckBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleText;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleValue
+ * @see drafts.com.sun.star.accessibility.XAccessibleAction
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ XAccessibleAction action = 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) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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();
+
+ DiagThread psDiag = new DiagThread(xTextDoc,Param.getMSF());
+ psDiag.start();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ shortWait();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON,"Cancel");
+
+ action = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.CHECKBOX);
+
+ 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());
+
+ 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");
+ }
+ log.println(" disposing doc ");
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Opens new writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ }
+ }
+
+ /**
+ * 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");
+ }
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java
new file mode 100644
index 000000000000..1cb6e004c230
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java
@@ -0,0 +1,285 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleComboBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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.util.XURLTransformer;
+import com.sun.star.util.URL;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.lang.XMultiServiceFactory;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleEditableText;
+import drafts.com.sun.star.accessibility.XAccessibleText;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ 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;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ try {
+ oObj = (XInterface) 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,Param.getMSF());
+ psDiag.start();
+
+ shortWait();
+
+ Object atw = tk.getActiveTopWindow();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,atw);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON,"Cancel");
+ action = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PAGETABLIST);
+ XAccessibleSelection xAccSel = (XAccessibleSelection)
+ UnoRuntime.queryInterface(XAccessibleSelection.class, oObj);
+ try {
+ xAccSel.selectAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {}
+
+ at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.COMBOBOX, "", "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");
+ }
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Creates writer doc
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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(2000) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + 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..cf054850f5a0
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleDropDownComboBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleAction
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ XAccessibleAction action = null;
+
+ /**
+ * Finds AccessibleDropDownComboBox 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(Param.getMSF(), xTextDoc);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.COMBOBOX, "", "AccessibleDropDownComboBox");
+
+ 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();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) {
+ xTextDoc.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) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java
new file mode 100644
index 000000000000..c981a1aba38e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleDropDownListBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleText;
+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 style list box
+ * on toolbar of a document. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleAction
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ 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(Param.getMSF(), xTextDoc);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.COMBOBOX, "", "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( 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) {
+ xTextDoc.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/AccessibleEdit.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java
new file mode 100644
index 000000000000..bbe6b968ee44
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java
@@ -0,0 +1,268 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleEdit.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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.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 drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleEditableText;
+import drafts.com.sun.star.accessibility.XAccessibleText;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEditableText</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleEditableText
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ 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;
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF());
+
+ try {
+ oObj = (XInterface) 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)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.PUSHBUTTON, "Close");
+ action = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, oObj);
+ final XAccessibleComponent buttonAccComp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class,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");
+ }
+ });
+
+ 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");
+ }
+ xTextDoc.dispose();
+ }
+
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java
new file mode 100644
index 000000000000..325f9d43e183
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleFixedText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleText;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ XAccessibleAction action = null;
+ private 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 = 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("AccessibleFixedText");
+
+ 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) 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();
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot);
+
+ 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());
+
+ 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) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java
new file mode 100644
index 000000000000..8a6a609f7548
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java
@@ -0,0 +1,269 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleListBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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.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 drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ 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) 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)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);
+
+ // obtaining 'Close' button
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON,"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.COMBOBOX,
+ "", "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");
+ }
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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..be6b975ba4fc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java
@@ -0,0 +1,260 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleListItem.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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.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 drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ 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;
+
+ try {
+ oObj = (XInterface) 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)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);
+
+ // obtaining 'Close' button
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.PUSHBUTTON,"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.LISTITEM);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class,oObj) ;
+ final PrintWriter fLog = log;
+ 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");
+ }
+ xTextDoc.dispose();
+ }
+
+ /**
+ * Creates writer document
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java
new file mode 100644
index 000000000000..000d1155acbc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleMenu.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleText;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleAction
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.com.sun.star.accessibility.XAccessibleValue
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleText
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ 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) {
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF());
+ xTextDoc = SOF.createTextDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("Can't create document", e);
+ }
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ AccessibilityTools at = new AccessibilityTools();
+
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+// at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENU, "File");
+ Object menu2 = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.MENU, "Edit");
+
+ 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);
+ act1.doAccessibleAction(0);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e){}
+ }
+ });
+
+ XAccessibleText text = (XAccessibleText)
+ UnoRuntime.queryInterface(XAccessibleText.class,oObj) ;
+
+ tEnv.addObjRelation("XAccessibleText.Text", text.getText());
+
+ return tEnv;
+
+ }
+
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java
new file mode 100644
index 000000000000..a3e38c618784
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleMenuBar.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleSelection</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ 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) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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();
+
+ 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);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENUBAR);
+
+ 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();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) {
+ xTextDoc.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) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java
new file mode 100644
index 000000000000..70cad8c4d820
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java
@@ -0,0 +1,207 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleMenuItem.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleText;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleValue
+ * @see drafts.com.sun.star.accessibility.XAccessibleAction
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ XAccessibleAction action = 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) 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();
+
+ 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);
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.MENUITEM);
+
+ 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());
+
+ return tEnv;
+
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) {
+ xTextDoc.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) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java
new file mode 100644
index 000000000000..f5e8b42e2cfc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleMenuSeparator.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Date: 2003-01-27 18:19:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li> <code>drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.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 {
+
+ XTextDocument xTextDoc = null;
+ XAccessibleAction action = 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) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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();
+
+ 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);
+
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.SEPARATOR, "", "AccessibleMenuSeparator");
+
+ 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();
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Creates writer document.
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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) {
+ xTextDoc.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) ;
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java
new file mode 100644
index 000000000000..70d7d7fe04a3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java
@@ -0,0 +1,341 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleRadioButton.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import java.io.PrintWriter;
+
+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.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 drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+import drafts.com.sun.star.accessibility.XAccessibleValue;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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>
+ * drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleValue
+ * @see drafts.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 {
+
+ XDesktop the_Desk;
+ XTextDocument xTextDoc;
+ 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(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);
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * 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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleText
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log) {
+
+ log.println( "creating a test environment" );
+
+ try {
+ if (accCloseButton != null) {
+ log.println("closing HyperlinkDialog");
+ accCloseButton.doAccessibleAction(0);
+ }
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace(log);
+ }
+
+ if (xTextDoc != null) {
+ log.println("dispose a text document");
+ xTextDoc.dispose();
+ xTextDoc = null;
+ }
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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)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) 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 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);
+ }
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.RADIOBUTTON, "Internet");
+
+ XAccessibleContext anotherButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.RADIOBUTTON, "FTP");
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSHBUTTON, "Close");
+
+ accCloseButton = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, closeButton);
+
+ log.println("ImplementationName: "+ util.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() {
+ acomp.grabFocus();
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleText.Text", "Internet");
+
+ XAccessibleValue anotherButtonValue = (XAccessibleValue)
+ UnoRuntime.queryInterface(XAccessibleValue.class, anotherButton);
+
+ tEnv.addObjRelation("XAccessibleValue.anotherFromGroup",
+ anotherButtonValue);
+
+ return tEnv;
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.currentThread().sleep(2000) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java
new file mode 100644
index 000000000000..dd8a45ec2fa7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java
@@ -0,0 +1,211 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleScrollBar.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import java.io.PrintWriter;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+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>
+ * drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleValue
+ * @see drafts.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 {
+
+ 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(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.
+ * 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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( 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);
+
+ XController xController = aModel.getCurrentController();
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(tParam.getMSF(), aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.SCROLLBAR);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.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() {
+ acomp.grabFocus();
+ }
+ });
+
+ 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..6b17e84ff289
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java
@@ -0,0 +1,304 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleTabControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import java.io.PrintWriter;
+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.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleSelection
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.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 {
+
+ XDesktop the_Desk;
+ XTextDocument xTextDoc;
+ 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(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) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * 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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleSelection
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleSelection
+ */
+ 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( 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)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) 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.PAGETABLIST);
+
+ XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSHBUTTON, "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.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..56c8b0972e00
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java
@@ -0,0 +1,297 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleTabPage.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import java.io.PrintWriter;
+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.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+import drafts.com.sun.star.awt.XExtendedToolkit;
+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.util.XURLTransformer;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleContext;
+import drafts.com.sun.star.accessibility.XAccessibleSelection;
+
+/**
+ * Test for object that implements the following interfaces :
+ * <ul>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.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 {
+
+ XDesktop the_Desk;
+ XTextDocument xTextDoc;
+ 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(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);
+ }
+
+ log.println("disposing xTextDoc");
+
+ if (xTextDoc != null) {
+ xTextDoc.dispose();
+ }
+ }
+
+ /**
+ * 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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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);
+ }
+
+ if (xTextDoc != null) xTextDoc.dispose();
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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)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) 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.PUSHBUTTON, "Close");
+
+ accCloseButton = (XAccessibleAction)
+ UnoRuntime.queryInterface(XAccessibleAction.class, closeButton);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PAGETAB);
+
+ log.println("ImplementationName: "+ util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleComponent accComp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
+ public void fireEvent() {
+ accComp.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) ;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java
new file mode 100644
index 000000000000..f42352310e5f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleToolBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import java.io.PrintWriter;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+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>
+ * drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleExtendedComponent</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.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 {
+
+ 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(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.
+ * 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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see drafts.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( 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);
+
+ XController xController = aModel.getCurrentController();
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(tParam.getMSF(), aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.TOOLBAR);
+
+ final XAccessibleComponent acomp = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.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() {
+ acomp.grabFocus();
+ }
+ });
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java
new file mode 100644
index 000000000000..1cefae35674e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * $RCSfile: AccessibleToolBoxItem.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import java.io.PrintWriter;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import drafts.com.sun.star.accessibility.AccessibleRole;
+import drafts.com.sun.star.accessibility.XAccessible;
+import drafts.com.sun.star.accessibility.XAccessibleAction;
+import drafts.com.sun.star.accessibility.XAccessibleComponent;
+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>
+ * drafts::com::sun::star::accessibility::XAccessibleContext</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleComponent</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleExtendedComponent
+ * </code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleAction</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleText</code></li>
+ * <li><code>
+ * drafts::com::sun::star::accessibility::XAccessibleValue</code></li>
+ * </ul> <p>
+ *
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleContext
+ * @see drafts.com.sun.star.accessibility.XAccessibleComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleExtendedComponent
+ * @see drafts.com.sun.star.accessibility.XAccessibleAction
+ * @see drafts.com.sun.star.accessibility.XAccessibleText
+ * @see drafts.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 {
+
+ 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(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.
+ * 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 drafts.com.sun.star.accessibility.AccessibleRole
+ * @see ifc.accessibility._XAccessibleEventBroadcaster
+ * @see ifc.accessibility._XAccessibleText
+ * @see drafts.com.sun.star.accessibility.XAccessibleEventBroadcaster
+ * @see drafts.com.sun.star.accessibility.XAccessibleText
+ */
+ 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( 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);
+
+ XController xController = aModel.getCurrentController();
+
+ XInterface oObj = null;
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(tParam.getMSF(), aModel);
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ oObj = at.getAccessibleObjectForRole(xRoot,
+ AccessibleRole.PUSHBUTTON, "Bold");
+
+ log.println("ImplementationName: "+ util.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() {
+ }
+ });
+
+ tEnv.addObjRelation("XAccessibleText.Text", "Bold");
+
+ return tEnv;
+ }
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_toolkit/TabController.java b/qadevOOo/tests/java/mod/_toolkit/TabController.java
new file mode 100644
index 000000000000..8c208385b1c2
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/TabController.java
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * $RCSfile: TabController.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 TabController extends TestCase{
+
+ XTextDocument xTextDoc = null;
+
+ protected void initialize(TestParameters param, PrintWriter log) {
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(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" );
+ xTextDoc.dispose();
+ }
+
+ 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) (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)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;
+ }
+}
+
diff --git a/qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java b/qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java
new file mode 100644
index 000000000000..7eedba6d3044
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/TabControllerModel.java
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: TabControllerModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import com.sun.star.drawing.XControlShape;
+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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize(TestParameters param, PrintWriter log) {
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(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" );
+ xTextDoc.dispose();
+ }
+
+ 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) 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..81f23f56648b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/Toolkit.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * $RCSfile: Toolkit.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import com.sun.star.awt.XControl;
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ /**
+ * 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 {
+ XControl ctrl = the_access.getControl(the_Model) ;
+ win = cntrlr.getFrame().getContainerWindow();
+ //win = (XWindow) UnoRuntime.queryInterface(XWindow.class, ctrl) ;
+ the_win = the_access.getControl(the_Model).getPeer();
+ oObj = (XInterface) 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 );
+ }
+
+ 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);
+
+ // 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..f59d75d1a406
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlButton.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+ XTextDocument xTD2;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ xTD2 = WriterTools.createTextDoc(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 " );
+ xTextDoc.dispose();
+ xTD2.dispose();
+ }
+
+ 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..588389e291a6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlButtonModel.java
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlButtonModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+import com.sun.star.beans.XPropertySet;
+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 {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ XPropertySet props = null;
+ Object wat = null;
+
+ try {
+ oObj = (XInterface) 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..188bf9e4cd22
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java
@@ -0,0 +1,188 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlCheckBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+ XTextDocument xTD2;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ xTD2 = WriterTools.createTextDoc(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 " );
+ xTextDoc.dispose();
+ xTD2.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..59c74cdd8d40
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBoxModel.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlCheckBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..f83551ab7f8e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlComboBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 UnoControlComboBox extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..028a960acfa1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBoxModel.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlComboBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlComboBoxModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..91c5d1179c76
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlContainer.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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.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 {
+
+ XTextDocument xTextDoc;
+ XTextDocument xTD2;
+ XControl xCtrl1;
+ XControl xCtrl2;
+
+ protected void initialize(TestParameters param, PrintWriter log) {
+ try {
+ log.println( "creating a textdocument" );
+ xTD2 = WriterTools.createTextDoc(param.getMSF());
+ xTextDoc = WriterTools.createTextDoc(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" );
+ xTextDoc.dispose();
+ xTD2.dispose();
+ }
+
+ 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;
+ XDevice aDevice = null;
+ // create 2 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 {
+ xCtrl1 = 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,"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();
+ aDevice = the_kit.createScreenCompatibleDevice(200,200);
+ } 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) param.getMSF().createInstance(
+ "com.sun.star.awt.UnoControlContainer");
+ XControl xCtrl = (XControl)
+ UnoRuntime.queryInterface(XControl.class, oObj);
+ xCtrl.setModel(the_Model);
+ }
+ 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 );
+
+ String objName = "UnoControlContainer";
+ tEnv.addObjRelation("OBJNAME", "toolkit." + objName);
+ // 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..169da16ae574
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainerModel.java
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlContainerModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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) 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;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java
new file mode 100644
index 000000000000..cb9976c78467
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlCurrencyField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..95965750b595
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyFieldModel.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlCurrencyFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlCurrencyFieldModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..738f0c660259
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlDateField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+ XTextDocument xTD2;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF() );
+
+ try {
+ log.println( "creating a textdocument" );
+ xTextDoc = SOF.createTextDoc( null );
+ xTD2 = WriterTools.createTextDoc(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 " );
+ xTextDoc.dispose();
+ xTD2.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..ebe8c6052c4a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateFieldModel.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlDateFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:21 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlDateFieldModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..41cfd1b7a5ff
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlDialog.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.XToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+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.SOfficeFactory;
+import com.sun.star.text.XTextDocument;
+
+/**
+* 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 XWindow xWinDlg = null ;
+ public 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 = 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 ;
+
+ 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 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 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() ;
+ xTextDoc.dispose();
+ }
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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( "Couldnt 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..9971f8e04a34
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlDialogModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:20 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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>
+ */
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) Param.getMSF().createInstance(
+ "com.sun.star.awt.UnoControlDialogModel");
+ } catch (Exception e) {
+
+ }
+
+
+ log.println( "creating a new environment for object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("OBJNAME", "stardiv.vcl.controlmodel.Dialog");
+ System.out.println("ImplementationName: "+utils.getImplName(oObj));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java
new file mode 100644
index 000000000000..8be0750b5da4
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlEdit.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..a92131b21b58
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlEditModel.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlEditModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlEditModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..765f361c25fd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlFileControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:19 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..f87984ed187f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControlModel.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlFileControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlFileControlModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..26d3da153a53
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedLineModel.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlFixedLineModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:18 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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) 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
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java
new file mode 100644
index 000000000000..44271ad35f27
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlFixedText.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..a729778a88c7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedTextModel.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlFixedTextModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlFixedTextModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..96b1872610cf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java
@@ -0,0 +1,192 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlFormattedField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:17 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..67a52e6ad5f9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedFieldModel.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlFormattedFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlFormattedFieldModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..955fadfb9ea5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlGroupBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..b609d6868281
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBoxModel.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlGroupBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlGroupBoxModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..78312b99294d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlImageControl.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..1eff30e09f10
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControlModel.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlImageControlModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:15 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlImageControlModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..764232bdb30d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlListBox.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..0b4e06efa0df
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBoxModel.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlListBoxModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlListBoxModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..eb07635f207d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlNumericField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:14 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 UnoControlNumericField extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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);
+
+ 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..917116962075
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericFieldModel.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlNumericFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlNumericFieldModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..019b59b7ed32
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlPatternField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..647cb4e1bbab
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternFieldModel.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlPatternFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlPatternFieldModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..b2466cea1b24
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlProgressBarModel.java
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlProgressBarModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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) 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
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java
new file mode 100644
index 000000000000..cfa9d604f940
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlRadioButton.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:12 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..bce7e810338c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButtonModel.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlRadioButtonModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlRadioButtonModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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..d8ea6b2b3e6e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlScrollBarModel.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlScrollBarModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:11 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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) 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
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java
new file mode 100644
index 000000000000..65fc45a7dd3d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlTimeField.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+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.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 {
+
+ XTextDocument xTextDoc;
+
+ protected void initialize ( TestParameters Param, PrintWriter log) {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( 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 " );
+ xTextDoc.dispose();
+ }
+
+ public TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+ 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..a92d88115b5c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeFieldModel.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoControlTimeFieldModel.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._toolkit;
+
+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 UnoControlTimeFieldModel extends TestCase {
+
+ XTextDocument xTextDoc;
+
+ /**
+ * Creates StarOffice Writer document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a textdocument" );
+ xTextDoc = WriterTools.createTextDoc(tParam.getMSF());
+ }
+
+ /**
+ * Disposes StarOffice Writer document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xTextDoc " );
+ xTextDoc.dispose();
+ }
+
+
+ public synchronized TestEnvironment createTestEnvironment( TestParameters Param,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) 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/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/_ucb/UcbContentProviderProxyFactory.java b/qadevOOo/tests/java/mod/_ucb/UcbContentProviderProxyFactory.java
new file mode 100644
index 000000000000..204952c586d7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucb/UcbContentProviderProxyFactory.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * $RCSfile: UcbContentProviderProxyFactory.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:44 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucb;
+
+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.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 = 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..23461c018ac5
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucb/UcbPropertiesManager.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * $RCSfile: UcbPropertiesManager.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucb;
+
+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 UcbPropertiesManager extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = 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..4b4a3a92e3f3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucb/UcbStore.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * $RCSfile: UcbStore.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucb;
+
+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.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 = 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..12be40aa7efc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: UniversalContentBroker.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:43 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucb;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+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.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 = 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/_ucpdav/WebDAVContentProvider.java b/qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java
new file mode 100644
index 000000000000..813664b89aa9
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * $RCSfile: WebDAVContentProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:45 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucpdav;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+/**
+ * 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 = 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..491734e18617
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucpfile/FileProvider.java
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * $RCSfile: FileProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:46 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucpfile;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+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;
+
+public class FileProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param,PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ XMultiServiceFactory xMSF = 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(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/_ucphier/HierarchyContentProvider.java b/qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java
new file mode 100644
index 000000000000..65d03ef5c03a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * $RCSfile: HierarchyContentProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucphier;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+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;
+
+public class HierarchyContentProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ Object ucb = null;
+
+ try {
+ XMultiServiceFactory xMSF = 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..401d8b7a0ba3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucphier/HierarchyDataSource.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * $RCSfile: HierarchyDataSource.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucphier;
+
+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;
+
+/**
+ * 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 = 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..212d119703cc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: PackageContentProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucppkg;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+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;
+
+public class PackageContentProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param,PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ Object ucb = null;
+
+ try {
+ XMultiServiceFactory xMSF = 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..e14e56b2beb3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * $RCSfile: ContentProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucprmt;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+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;
+
+/**
+* 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;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = 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..1b5a00c036d7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: ProviderAcceptor.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucprmt;
+
+import com.sun.star.ucb.XRemoteContentProviderAcceptor;
+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;
+
+public class ProviderAcceptor extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+
+ try {
+ oInterface = 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..e67da2aca71a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * $RCSfile: ProxyProvider.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._ucprmt;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XContentIdentifierFactory;
+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;
+
+public class ProxyProvider extends TestCase {
+
+ public TestEnvironment createTestEnvironment
+ ( TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ Object oInterface = null;
+ XMultiServiceFactory xMSF = 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..46744a04c30c
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_uui/UUIInteractionHandler.java
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * $RCSfile: UUIInteractionHandler.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._uui;
+
+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.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 = 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/UnoUrlResolver.java b/qadevOOo/tests/java/mod/_uuresolver/UnoUrlResolver.java
new file mode 100644
index 000000000000..5010d80a588a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_uuresolver/UnoUrlResolver.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: UnoUrlResolver.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._uuresolver;
+
+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 = 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..555174d65750
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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 = 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..520ee6bca67b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.document.XImporter;
+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.SOfficeFactory;
+
+/**
+ * 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( 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;
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ comp.dispose();
+ }
+
+ /**
+ * 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 = tParam.getMSF() ;
+
+ final XPropertySet xTitleProp ;
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Chart.XMLContentImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xChartDoc) ;
+
+ 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..315a8b0a69bc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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 = 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..6939bec4a131
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.document.XImporter;
+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.SOfficeFactory;
+
+/**
+ * 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( 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;
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ comp.dispose();
+ }
+
+ /**
+ * 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 = tParam.getMSF() ;
+
+ final XPropertySet xTitleProp ;
+ try {
+ oInt = xMSF.createInstance("com.sun.star.comp.Chart.XMLImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xChartDoc) ;
+
+ 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..dda002c86ff6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 );
+ }
+ }
+
+ /**
+ * Document disposed here.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xChartDoc " );
+ xChartDoc.dispose();
+ }
+
+ /**
+ * 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 = tParam.getMSF() ;
+ XInterface oObj = null;
+ final String exportStr = "XMLStylesExporter" ;
+
+ 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..f2ee39eddd2f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesImporter.java
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Chart;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart.XChartDocument;
+import com.sun.star.document.XImporter;
+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.SOfficeFactory;
+
+/**
+ * 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( 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;
+ }
+
+ /**
+ * Disposes document.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing document " );
+ comp.dispose();
+ }
+
+ /**
+ * 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 ;
+ 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 = tParam.getMSF() ;
+
+ final XPropertySet xTitleProp ;
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Chart.XMLStylesImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xChartDoc) ;
+
+ 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-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..5ba54d7c5951
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..831ab4972747
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java
@@ -0,0 +1,246 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.document.XImporter;
+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;
+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.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( 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 ;
+ 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Draw.XMLContentImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ } 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..c2aa62f54e2e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..dea96e412ffa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java
@@ -0,0 +1,246 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.document.XImporter;
+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;
+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.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( 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance("com.sun.star.comp.Draw.XMLImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xDrawDoc);
+ } 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..944a10894c82
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..fee99d07d146
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+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;
+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.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( 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 ;
+ 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 = 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..5d26bf2db99f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java
@@ -0,0 +1,243 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..6fda8b714d24
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java
@@ -0,0 +1,234 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+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.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.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( 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Draw.XMLSettingsImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xDrawDoc);
+ } 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..9bbe279c3363
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java
@@ -0,0 +1,246 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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( tParam.getMSF() );
+ XMultiServiceFactory xMSF = 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..13b07abc5597
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:19:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Draw;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.document.XImporter;
+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;
+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.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( 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Draw.XMLStylesImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xDrawDoc);
+ } 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..fb7b89511a45
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java
@@ -0,0 +1,239 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..22b494438bec
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java
@@ -0,0 +1,256 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLContentImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:08 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.document.XImporter;
+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;
+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.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( 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLContentImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xImpressDoc);
+ } 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..ef3dedacc200
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java
@@ -0,0 +1,242 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..c94fe8517407
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.document.XImporter;
+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;
+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.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( 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 ;
+ 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xImpressDoc);
+ } 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..98e7859d1279
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..b2b25ee8d2dd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLMetaImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+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.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.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( 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLMetaImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ } 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..7e227f7cc5e6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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 = 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..79dd104d2cfc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java
@@ -0,0 +1,249 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLSettingsImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+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.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.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( 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 ;
+ 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLSettingsImporter") ;
+ XImporter imp = (XImporter)
+ UnoRuntime.queryInterface(XImporter.class, oInt) ;
+ //imp.setTargetDocument(xImpressDoc);
+ } 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..d91689695142
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesExporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+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;
+import java.io.PrintWriter;
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+/**
+ * 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( 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( tParam.getMSF() );
+ XMultiServiceFactory xMSF = 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..ef2c45665bf7
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLStylesImporter.java,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change:$Date: 2003-01-27 18:20:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+package mod._xmloff.Impress;
+
+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.style.XStyleFamiliesSupplier;
+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.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( 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 = tParam.getMSF() ;
+
+ try {
+ oInt = xMSF.createInstance
+ ("com.sun.star.comp.Impress.XMLStylesImporter") ;
+ XImporter imp = (XImporter) UnoRuntime.queryInterface
+ (XImporter.class, oInt) ;
+ //imp.setTargetDocument(xImpressDoc);
+ } 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
+
+}
+