1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: options_data.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : thorsten.bosbach@sun.com
36 '* short description : general option test ( datasource - group )
38 '\******************************************************************************
40 testcase tDatasourceConnections
41 Dim lsTimeout ( 20 ) as String
42 Dim lbPool ( 20 ) as Boolean
43 Dim i as Integer, iCounter as Integer
48 iCounter = 9 ' sorry only hard coded the number of entries, it gives no way to get the real count ( GetText crashes )
49 qaerrorLog "GetTextCrasjhes??? TBO"
50 '///check if all settings are saved in configuration ( Datasources / Connections )
52 '///open a new document
53 '///+open options 'Datasources' / 'Connections'
57 hToolsOptions ( "Datasources", "Connections" )
60 printlog " - save raw data"
61 bSave = ConnectionPoolingEnabled.IsChecked
62 ConnectionPoolingEnabled.Check
63 DriverList.TypeKeys "<Up>", 20
65 if i <> 1 then DriverList.TypeKeys "<Down>"
66 lbPool (i) = EnablePoolingForThisDriver.IsChecked
67 if lbPool (i) = TRUE then
68 lsTimeout (i) = Timeout.GetText
70 EnablePoolingForThisDriver.Check
71 lsTimeout (i) = Timeout.GetText
75 printlog " - change all settings"
76 DriverList.TypeKeys "<Up>", 20
78 if i <> 1 then DriverList.TypeKeys "<Down>"
80 if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then
81 EnablePoolingForThisDriver.Check
82 Timeout.SetText "4" + i
84 EnablePoolingForThisDriver.Uncheck
88 if bSave = TRUE then ConnectionPoolingEnabled.UnCheck
90 '///+close options dialog with OK, close all documents and exit StarOffice
91 Kontext "ExtrasOptionenDlg"
96 '///+wait until StarOffice is out of memory and restart it
97 printlog " - exit/restart StarOffice"
100 '///+open options 'Datasources' / 'Connections'
101 '///+check all changes
102 printlog " - check all changes"
104 hToolsOptions ( "Datasources", "Connections" )
106 if ConnectionPoolingEnabled.IsChecked = bSave then Warnlog "Connection pooling enabled => changes not saved!"
107 ConnectionPoolingEnabled.Check
109 DriverList.TypeKeys "<Up>", 20
111 if i <> 1 then DriverList.TypeKeys "<Down>"
113 if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then
114 if EnablePoolingForThisDriver.IsChecked <> TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
115 EnablePoolingForThisDriver.Check
116 if Timeout.GetText <> "4" + i then Warnlog "Entry " + i + " : timeout => changes not saved!"
118 if EnablePoolingForThisDriver.Ischecked = TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
124 printlog " - make second changes"
125 DriverList.TypeKeys "<Up>", 20
127 if i <> 1 then DriverList.TypeKeys "<Down>"
129 if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then
130 EnablePoolingForThisDriver.Uncheck
132 EnablePoolingForThisDriver.Check
134 Timeout.SetText "6" + i
136 Timeout.SetText "540"
142 '///+close options dialog with OK
143 Kontext "ExtrasOptionenDlg"
147 '///+open options 'Datasources' / 'Connections'
148 '///+check all changes
149 printlog " - check all changes"
151 hToolsOptions ( "Datasources", "Connections" )
153 DriverList.TypeKeys "<Up>", 20
155 if i <> 1 then DriverList.TypeKeys "<Down>"
157 if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then
158 if EnablePoolingForThisDriver.Ischecked = TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
160 if EnablePoolingForThisDriver.IsChecked <> TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
161 EnablePoolingForThisDriver.Check
163 if Timeout.GetText <> "6" + i then Warnlog "Entry " + i + " : timeout => changes not saved!"
165 if Timeout.GetText <> "540" then Warnlog "Entry " + i + " : timeout => changes not saved!"
172 '///+reset to raw data
173 printlog " - reset all settings"
174 DriverList.TypeKeys "<Up>", 20
176 if i <> 1 then DriverList.TypeKeys "<Down>"
177 EnablePoolingForThisDriver.Check
178 Timeout.SetText lsTimeout (i)
179 if lbPool (i) = TRUE then EnablePoolingForThisDriver.Check else EnablePoolingForThisDriver.UnCheck
181 if bSave = TRUE then ConnectionPoolingEnabled.Check else ConnectionPoolingEnabled.UnCheck
183 '///+close options dialog with OK
184 Kontext "ExtrasOptionenDlg"
188 '///+open options 'Datasources' / 'Connections'
189 '///+check the raw data
190 printlog " - check the raw data"
192 hToolsOptions ( "Datasources", "Connections" )
194 ConnectionPoolingEnabled.check
195 DriverList.TypeKeys "<Up>", 20
197 if i <> 1 then DriverList.TypeKeys "<Down>"
198 if EnablePoolingForThisDriver.IsChecked <> lbPool (i) then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
199 EnablePoolingForThisDriver.Check
200 if Timeout.GetText <> lsTimeout (i) then Warnlog "Entry " + i + " : timeout => changes not saved!"
201 if lbPool (i) = TRUE then EnablePoolingForThisDriver.Check else EnablePoolingForThisDriver.UnCheck
204 ConnectionPoolingEnabled.unCheck
206 '///+close options dialog
207 Kontext "ExtrasOptionenDlg"