1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> 3<script:module xmlns:script="http://openoffice.org/2000/script" script:name="awt_XTabControllerModel" script:language="StarBasic"> 4 5 6'************************************************************************* 7' 8' Licensed to the Apache Software Foundation (ASF) under one 9' or more contributor license agreements. See the NOTICE file 10' distributed with this work for additional information 11' regarding copyright ownership. The ASF licenses this file 12' to you under the Apache License, Version 2.0 (the 13' "License"); you may not use this file except in compliance 14' with the License. You may obtain a copy of the License at 15' 16' http://www.apache.org/licenses/LICENSE-2.0 17' 18' Unless required by applicable law or agreed to in writing, 19' software distributed under the License is distributed on an 20' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 21' KIND, either express or implied. See the License for the 22' specific language governing permissions and limitations 23' under the License. 24' 25'************************************************************************* 26 27 28 29 30 31' Be sure that all variables are dimensioned: 32option explicit 33 34'************************************************************************* 35' This Interface/Service test depends on the following GLOBAL variables, 36' which must be specified in the object creation: 37 38' Global XTabControlModel1 as Object 39' Global XTabControlModel2 as Object 40 41'************************************************************************* 42 43 44 45 46 47 48 49Sub RunTest() 50 51'************************************************************************* 52' INTERFACE: 53' com.sun.star.awt.XTabControllerModel 54'************************************************************************* 55On Error Goto ErrHndl 56 Dim bOK As Boolean 57 Dim ModelSeq1(0), ModelSeq2(0) As Variant 58 Dim ReturnModel(), ReturnSeq2(), ReturnSeq1() As Variant 59 Dim ReturnName, cName As String 60 61 cName = "XTabControllerModel" 62 63 Test.StartMethod("setGroupControl()") 64 bOK = true 65 oObj.setGroupControl(false) 66 Test.StartMethod("getGroupControl()") 67 bOK = bOK AND NOT oObj.getGroupControl() 68 oObj.setGroupControl(true) 69 bOK = bOK AND oObj.getGroupControl() 70 Test.MethodTested("getGroupControl()", bOK) 71 Test.MethodTested("setGroupControl()", bOK) 72 73 Test.StartMethod("setControlModels()") 74 bOK = true 75 ModelSeq1(0) = XTabControlModel1 76 oObj.setControlModels(ModelSeq1()) 77 Test.StartMethod("getControlModels()") 78 ReturnSeq1 = oObj.getControlModels() 79 bOK = bOk AND (uBound(ReturnSeq1()) = uBound(ModelSeq1())) 80 Test.MethodTested("setControlModels()", bOK) 81 Test.MethodTested("getControlModels()", bOK) 82 83 Test.StartMethod("setGroup()") 84 bOK = true 85 ModelSeq2(0) = XTabControlModel2 86 oObj.setGroup(ModelSeq2(), cName) 87 Test.StartMethod("getGroup()") 88 oObj.getGroup(0,ReturnSeq2(), ReturnName) 89 bOK = bOK AND (ReturnName = cName) 90 bOK = bOK AND (uBound(ReturnSeq2()) = uBound(ModelSeq2())) 91 Test.MethodTested("setGroup()", bOK) 92 Test.MethodTested("getGroup()", bOK) 93 94 Test.StartMethod("getGroupCount()") 95 bOK = true 96 bOK = bOK AND (oObj.getGroupCount() > 0) 97 bOK = bOK AND isNumeric(oObj.getGroupCount()) 98 Test.MethodTested("getGroupCount()", bOK) 99 100 Test.StartMethod("getGroupByName()") 101 bOK = true 102 oObj.getGroupByName(cName, ReturnModel()) 103 Test.MethodTested("getGroupByName()", bOK) 104 105 106Exit Sub 107ErrHndl: 108 Test.Exception() 109 bOK = false 110 resume next 111End Sub 112</script:module> 113