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' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9'
10' Copyright 2000, 2010 Oracle and/or its affiliates.
11'
12' OpenOffice.org - a multi-platform office productivity suite
13'
14' This file is part of OpenOffice.org.
15'
16' OpenOffice.org is free software: you can redistribute it and/or modify
17' it under the terms of the GNU Lesser General Public License version 3
18' only, as published by the Free Software Foundation.
19'
20' OpenOffice.org is distributed in the hope that it will be useful,
21' but WITHOUT ANY WARRANTY; without even the implied warranty of
22' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23' GNU Lesser General Public License version 3 for more details
24' (a copy is included in the LICENSE file that accompanied this code).
25'
26' You should have received a copy of the GNU Lesser General Public License
27' version 3 along with OpenOffice.org.  If not, see
28' <http://www.openoffice.org/license.html>
29' for a copy of the LGPLv3 License.
30'
31'*************************************************************************
32'*************************************************************************
33
34
35
36' Be sure that all variables are dimensioned:
37option explicit
38
39'*************************************************************************
40' This Interface/Service test depends on the following GLOBAL variables,
41' which must be specified in the object creation:
42
43'      Global XTabControlModel1 as Object
44'       Global XTabControlModel2 as Object
45
46'*************************************************************************
47
48
49
50
51
52
53
54Sub RunTest()
55
56'*************************************************************************
57' INTERFACE:
58' com.sun.star.awt.XTabControllerModel
59'*************************************************************************
60On Error Goto ErrHndl
61    Dim bOK As Boolean
62    Dim ModelSeq1(0), ModelSeq2(0) As Variant
63    Dim ReturnModel(), ReturnSeq2(), ReturnSeq1() As Variant
64    Dim ReturnName, cName As String
65
66    cName = "XTabControllerModel"
67
68    Test.StartMethod("setGroupControl()")
69    bOK = true
70    oObj.setGroupControl(false)
71    Test.StartMethod("getGroupControl()")
72    bOK = bOK AND NOT oObj.getGroupControl()
73    oObj.setGroupControl(true)
74    bOK = bOK AND oObj.getGroupControl()
75    Test.MethodTested("getGroupControl()", bOK)
76    Test.MethodTested("setGroupControl()", bOK)
77
78    Test.StartMethod("setControlModels()")
79    bOK = true
80    ModelSeq1(0) = XTabControlModel1
81    oObj.setControlModels(ModelSeq1())
82    Test.StartMethod("getControlModels()")
83    ReturnSeq1 = oObj.getControlModels()
84    bOK = bOk AND (uBound(ReturnSeq1()) = uBound(ModelSeq1()))
85    Test.MethodTested("setControlModels()", bOK)
86    Test.MethodTested("getControlModels()", bOK)
87
88    Test.StartMethod("setGroup()")
89    bOK = true
90    ModelSeq2(0) = XTabControlModel2
91    oObj.setGroup(ModelSeq2(), cName)
92    Test.StartMethod("getGroup()")
93    oObj.getGroup(0,ReturnSeq2(), ReturnName)
94    bOK = bOK AND (ReturnName = cName)
95    bOK = bOK AND (uBound(ReturnSeq2()) = uBound(ModelSeq2()))
96    Test.MethodTested("setGroup()", bOK)
97    Test.MethodTested("getGroup()", bOK)
98
99    Test.StartMethod("getGroupCount()")
100    bOK = true
101    bOK = bOK AND (oObj.getGroupCount() &gt; 0)
102    bOK = bOK AND isNumeric(oObj.getGroupCount())
103    Test.MethodTested("getGroupCount()", bOK)
104
105    Test.StartMethod("getGroupByName()")
106    bOK = true
107    oObj.getGroupByName(cName, ReturnModel())
108    Test.MethodTested("getGroupByName()", bOK)
109
110
111Exit Sub
112ErrHndl:
113    Test.Exception()
114    bOK = false
115    resume next
116End Sub
117</script:module>
118