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: location.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:03:21 $
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 : joerg.skottke@sun.com
36 '* short description : Test the extension locator service
38 '\******************************************************************************
40 testcase tExtensionLocation
42 printlog( "Test the extension locator service" )
44 ' The location of the sample extension and helper document
45 dim cWorkPath as string
46 cWorkPath = gTesttoolPath & "extensions\optional\input\path_to_extension\"
47 cWorkPath = convertpath( cWorkPath )
49 const EXTENSION_NAME = "locationtest.oxt"
50 const DOCUMENT_NAME = "LocationTest.odt"
51 const MACRO_NAME = "tExtensionLocation"
57 printlog( "Using extension: " & cWorkPath & EXTENSION_NAME )
58 printlog( "Using document.: " & cWorkPath & DOCUMENT_NAME )
60 brc = hFileOpen( cWorkPath & DOCUMENT_NAME )
62 brc = hAllowMacroExecution()
64 warnlog( "This is not the macro execution warning" )
67 warnlog( "Macro execution warning is missing" )
70 irc = hMacroOrganizerRunMacro( MACRO_NAME )
72 warnlog( "No macro with the given name could be found, aborting" )
74 if ( Makro.exists() ) then
81 if ( active.exists( 2 ) ) then
82 cMsg = active.getText()
83 if ( cMsg <> "" ) then
84 warnlog( "The messagebox is not empty: " & cMsg )
86 printlog( "Messagebox is empty, good." )
90 warnlog( "No messagebox displayed, please check that the macro is executed" )
93 irc = hExtensionAddGUI( cWorkPath & EXTENSION_NAME , "verbose,InstallForUser" )
94 irc = hMacroOrganizerRunMacro( MACRO_NAME )
96 warnlog( "No macro with the given name could be found" )
100 if ( active.exists( 2 ) ) then
101 cMsg = active.getText()
103 if ( cMsg = "" ) then
104 warnlog( "The messagebox is empty, please check." )
107 printlog( "Content of messagebox: " & cMsg )
109 if ( instr( cMsg , "file:///" ) > 0 ) then
110 printlog( "Found File-URL" )
112 warnlog( "This does not appear to be a File-URL, please check!" )
115 if ( instr( cMsg , EXTENSION_NAME ) > 0 ) then
116 printlog( "Extension string is present" )
118 warnlog( "Extension name seems to be missing" )
121 if ( dir( cMsg ) = "" ) then
122 warnlog( "The extension could not be found at the expected location" )
124 printlog( "Extension found. Good." )
130 warnlog( "No messagebox displayed, please check that the macro is executed" )
133 irc = hExtensionRemoveGUI( EXTENSION_NAME )
135 warnlog( "the extension was NOT cleanly removed" )