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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : gregor.hartmann@oracle.com
30 '* short description :
32 '\******************************************************************************
34 testcase tBasicDialogI18nImport
36 printlog( "Dialogs that show up when importing multi locale dialogs into BASIC IDE" )
38 dim cDialogPath as string
39 cDialogPath = gTesttoolPath & "framework\required\input\basic_ide\Dialog5.xdl"
40 cDialogPath = convertpath( cDialogPath )
42 dim iNumberOfLanguages as integer
45 const LANGUAGE_COUNT = 5
48 const MODULE_NAME = "tDialogI18nImport"
49 const DIALOG_WAIT_TIMEOUT = 2
50 const MSG_LOCALE_CLASH_WARNING_BUTTONCOUNT = 4
51 const MSG_DIALOG_REPLACE_WARNING_BUTTONCOUNT = 3
53 printlog( "Open BASIC-IDE" )
55 hInitFormControls( MODULE_NAME )
57 kontext "ToolsCollectionBar"
58 if ( ToolsCollectionBar.exists() ) then ToolsCollectionBar.close()
61 if ( DialogBar.exists() ) then
63 printlog( "Click on <Import> button on <DialogBar>" )
67 if ( OeffnenDlg.exists( DIALOG_WAIT_TIMEOUT ) ) then
69 printlog( "Enter path to test dialog" )
70 DateiName.setText( cDialogPath )
73 printlog( "Test messagebox" )
75 if ( Active.exists( DIALOG_WAIT_TIMEOUT ) ) then
77 printlog( "Messagebox: " & Active.getText() )
78 if ( Active.getButtonCount() <> MSG_LOCALE_CLASH_WARNING_BUTTONCOUNT ) then
79 warnlog( "Incorrect messagebox, expected locale clash warning" )
82 call DialogTest( Active )
84 printlog( "Accept with yes" )
85 hCloseDialog( Active, "yes" )
87 Kontext "TranslationBar"
88 if ( TranslationBar.exists() ) then
90 for iTry = 1 to MAX_RETRIES
91 iNumberOfLanguages = CurrentLanguage.getItemCount()
92 if ( iNumberOfLanguages = LANGUAGE_COUNT ) then exit for
96 printlog( "Check number of imported languages" )
97 if ( iNumberOfLanguages <> LANGUAGE_COUNT ) then
98 warnlog( "Incorrect language count in listbox <CurrentLanguage>" )
99 printlog( "Expected: " & LANGUAGE_COUNT )
100 printlog( "Found...: " & iNumberOfLanguages )
104 if ( DialogBar.exists() ) then
106 printlog( "Click on <Import> button on <DialogBar>" )
110 if ( OeffnenDlg.exists( DIALOG_WAIT_TIMEOUT ) ) then
112 printlog( "Enter path to test dialog" )
113 DateiName.setText( cDialogPath )
116 printlog( "Test messagebox" )
118 if ( Active.exists( DIALOG_WAIT_TIMEOUT ) ) then
120 printlog( "Messagebox: " & Active.getText() )
121 if ( Active.getButtonCount() <> MSG_DIALOG_REPLACE_WARNING_BUTTONCOUNT ) then
122 warnlog( "Incorrect messagebox, expected dialog replace warning" )
125 call DialogTest( Active )
127 Printlog( "Rename the new dialog" )
128 hCloseDialog( Active, "yes" )
130 warnlog( "Overwrite warning missing" )
133 warnlog( "<OeffnenDlg> did not open" )
136 warnlog( "<DialogBar> is not available" )
139 warnlog( "<TranslationBar> is not available" )
142 warning( "Conflicting locales messagebox is missing" )
145 warnlog( "<OeffnenDlg> did not open" )
148 warnlog( "<DialogBar> is not available" )