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 : Import BASIC library via Package Manager GUI as UNO Package
32 '\******************************************************************************
34 testcase tBasicPackageImport
36 ' Assumption: All actions take place in the user/work directory
37 ' macro taken from global/input/macros.txt::tBasicLibraryExport
39 printlog( "Import BASIC library via Package Manager GUI as UNO Package" )
41 dim package_name as string : package_name = "tBasicExport.oxt"
43 const LIBRARY_NAME = "tBasicExport"
45 const LIBRARIES_TAB = 3
48 dim cDocumentName as string
49 dim cLibraryName as string
51 dim iNodeCount as integer
52 dim iCurrentLib as integer
53 dim iStatus as integer
55 dim cFile as string : cFile = hGetWorkPath() & package_name
57 printlog( "Probe for test extension created by basic_packege_export" )
58 if ( Not FileExists( cFile ) or ( FileLen( cFile ) = 0 ) ) then
59 warnlog( "#i105719# - Test extension is missing or has zero size. This is most likely" & _
60 " a follow-up error from the prior test case. Test stopped." )
64 gApplication = "WRITER"
66 iStatus = hExtensionAddGUI( cFile, "InstallForUser,NoLicense,NoUpdate" )
68 ' Evaluate the returncode. Anything different from 0 causes the test to end.
69 if ( iStatus <= 0 ) then
70 warnlog( "Error adding extension. Aborting." )
74 hMacroOrganizerRunMacro( LIBRARY_NAME )
77 if ( active.exists( 5 ) ) then
80 warnlog( "The macro was not executed" )
86 MakroAus.select( MY_MACROS )
90 hSelectBasicObjectOrganizerTab( LIBRARIES_TAB )
92 kontext "TabBibliotheken"
93 Bibliothek.select( SHORT_WAIT )
95 printlog( "Select the new library" )
96 kontext "TabBibliotheken"
97 for iCurrentLib = 1 to Bibliotheksliste.getItemCount()
98 Bibliotheksliste.select( iCurrentLib )
99 if ( Bibliotheksliste.getSelText() = LIBRARY_NAME ) then
103 cLibraryName = BibliotheksListe.getSelText()
105 hClickButton( Hinzufuegen )
108 hCloseDialog( OeffnenDlg, "cancel" )
110 printlog( "Cleanup: Delete Library, close dialogs and remove package" )
112 ' Note: It is assumed that the library is selected
113 kontext "TabBibliotheken"
114 cLibraryName = BibliotheksListe.getSelText()
115 if ( cLibraryName <> LIBRARY_NAME ) then
116 warnlog( "Incorrect library is selected" & cLibraryName )
121 if ( active.exists( SHORT_WAIT ) ) then
124 warnlog( "No warning for library deletion" )
128 kontext "TabBibliotheken"
129 hCloseDialog( TabBibliotheken, "cancel" )
132 hCloseDialog( Makro, "cancel" )
134 hExtensionRemoveGUI( package_name )