| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> |
| <script:module xmlns:script="http://openoffice.org/2000/script" script:name="sdbc_XDriver" script:language="StarBasic"> |
| |
| |
| '************************************************************************* |
| ' |
| ' Licensed to the Apache Software Foundation (ASF) under one |
| ' or more contributor license agreements. See the NOTICE file |
| ' distributed with this work for additional information |
| ' regarding copyright ownership. The ASF licenses this file |
| ' to you under the Apache License, Version 2.0 (the |
| ' "License"); you may not use this file except in compliance |
| ' with the License. You may obtain a copy of the License at |
| ' |
| ' http://www.apache.org/licenses/LICENSE-2.0 |
| ' |
| ' Unless required by applicable law or agreed to in writing, |
| ' software distributed under the License is distributed on an |
| ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ' KIND, either express or implied. See the License for the |
| ' specific language governing permissions and limitations |
| ' under the License. |
| ' |
| '************************************************************************* |
| |
| |
| |
| |
| |
| ' Be sure that all variables are dimensioned: |
| option explicit |
| |
| '************************************************************************* |
| ' This Interface/Service test depends on the following GLOBAL variables, |
| ' which must be specified in the object creation: |
| |
| ' - Global URL as String |
| ' Global info As Variant |
| |
| '************************************************************************* |
| |
| |
| |
| |
| |
| Sub RunTest() |
| |
| '************************************************************************* |
| ' INTERFACE: |
| ' com.sun.star.sdbc.XDriver |
| '************************************************************************* |
| On Error Goto ErrHndl |
| Dim bOK As Boolean |
| |
| Test.StartMethod("acceptsURL()") |
| bOK = oObj.acceptsURL(URL) |
| Out.log("acceptsURL('" + URL + "')? " + bOK) |
| Test.MethodTested("acceptsURL()", bOK) |
| |
| Test.StartMethod("connect()") |
| Out.log("connecting to '" + URL + "'") |
| Dim connection As Object |
| connection = oObj.connect(URL, info) |
| bOK = Not IsNull(connection) |
| Test.MethodTested("connect()", bOK) |
| |
| Test.StartMethod("getPropertyInfo()") |
| Dim dpi As Variant |
| dpi = oObj.getPropertyInfo(URL, info) |
| bOK = Not IsNull(dpi) |
| if bOK then |
| Dim i As Integer |
| for i = 0 to ubound(dpi) |
| Out.log(dpi(i).Name + ": " + dpi(i).Value) |
| next i |
| endif |
| Test.MethodTested("getPropertyInfo()", bOK) |
| |
| Test.StartMethod("getMajorVersion()") |
| bOK = true |
| Dim majVer As Integer |
| majVer = oObj.getMajorVersion() |
| Out.log("Major version: " + majVer) |
| Test.MethodTested("getMajorVersion()", bOK) |
| |
| Test.StartMethod("getMinorVersion()") |
| bOK = true |
| Dim minVer As Integer |
| minVer = oObj.getMinorVersion() |
| Out.log("Minor version: " + minVer) |
| Test.MethodTested("getMinorVersion()", bOK) |
| Exit Sub |
| ErrHndl: |
| Test.Exception() |
| bOK = false |
| resume next |
| End Sub |
| </script:module> |