summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Skottke [jsk] <jsk@openoffice.org>2010-05-12 14:37:02 +0200
committerJoerg Skottke [jsk] <jsk@openoffice.org>2010-05-12 14:37:02 +0200
commiteeb5df7198d067da77e4f885bf7c5eb36f98854f (patch)
tree7bf804bf130d2181884a766f4d054c0e5ef7e30b
parente5f7d2ba5749113bf392d95bf629d95b9f5ee2d6 (diff)
npower13_objectmodules: #i110724 - Created test case. I wonder if it works when run from our internal servers. There might be an issue with the accessrights. However, i then just need to update the Strings to check for.
-rwxr-xr-xtestautomation/framework/optional/f_basic_vba-compat.bas18
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_application-union.inc126
-rwxr-xr-xtestautomation/framework/optional/input/vba-compat/vba-application-union.xlsbin0 -> 31744 bytes
3 files changed, 136 insertions, 8 deletions
diff --git a/testautomation/framework/optional/f_basic_vba-compat.bas b/testautomation/framework/optional/f_basic_vba-compat.bas
index 9a6f30d3e61d..6f4cbeba8da8 100755
--- a/testautomation/framework/optional/f_basic_vba-compat.bas
+++ b/testautomation/framework/optional/f_basic_vba-compat.bas
@@ -33,17 +33,19 @@
sub main
- 'use "framework\optional\includes\basic_vba-compat_import_nothing.inc"
- 'use "framework\optional\includes\basic_vba-compat_import_disabled.inc"
- 'use "framework\optional\includes\basic_vba-compat_import_enabled.inc"
+ use "framework\optional\includes\basic_vba-compat_import_nothing.inc"
+ use "framework\optional\includes\basic_vba-compat_import_disabled.inc"
+ use "framework\optional\includes\basic_vba-compat_import_enabled.inc"
use "framework\optional\includes\basic_vba-compat_thisworkbook.inc"
+ use "framework\optional\includes\basic_vba-compat_application-union.inc"
- 'call hStatusIn( "framework" , "f_basic_vba-compat.bas" )
- 'call tBasicVBACompatImportNothing()
- 'call tBasicVBACompatImportDisabled()
- 'call tBasicVBACompatImportEnabled()
+ call hStatusIn( "framework" , "f_basic_vba-compat.bas" )
+ call tBasicVBACompatImportNothing()
+ call tBasicVBACompatImportDisabled()
+ call tBasicVBACompatImportEnabled()
call tBasicVBACompatThisWorkBook()
- 'call hStatusOut()
+ call tBasicVBACompatApplicationUnion()
+ call hStatusOut()
end sub
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc b/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc
new file mode 100755
index 000000000000..4f0ab6c11922
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc
@@ -0,0 +1,126 @@
+'encoding UTF-8 Do not remove or change this line!
+'*******************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/******************************************************************************
+'*
+'* owner : joerg.skottke@sun.com
+'*
+'* short description : Test VBA compatibility switches
+'*
+'\******************************************************************************
+
+testcase tBasicVBACompatApplicationUnion()
+
+ printlog( "Functionality of Application.Union" )
+ ' Based on issue #i110724
+
+ const IMPORT_EXCEL_MACROS = TRUE
+ const EXEC_EXCEL_MACROS = TRUE
+ const DOCUMENT_NAME = "vba-application-union.xls"
+ const LIBRARY_NAME = "Standard"
+ const MODULE_NAME = "Module1"
+ const EXPECTED_MACRO_COUNT = 6
+ const MAX_WAIT = 2
+
+ dim macro_identifier( EXPECTED_MACRO_COUNT )
+ macro_identifier( 1 ) = "1: True"
+ macro_identifier( 2 ) = "2: True"
+ macro_identifier( 3 ) = "3: True"
+ macro_identifier( 4 ) = "4: True"
+ macro_identifier( 5 ) = "5: True"
+ macro_identifier( 6 ) = "6: True"
+
+ dim cTestFile as string
+ cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/" & DOCUMENT_NAME
+
+ dim iMacroPosition as integer
+ dim iCurrentMacro as integer
+ dim iRepeat as integer
+
+ printlog( "Set macro security to low" )
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW )
+
+ printlog( "Open Tools/Options" )
+ hSetExcelBasicImportMode( IMPORT_EXCEL_MACROS, EXEC_EXCEL_MACROS )
+
+ printlog( "Load the test file" )
+ hFileOpen( cTestFile )
+
+ ToolsMacro_uno
+
+ kontext "Makro"
+ if ( Makro.exists( MAX_WAIT ) ) then
+
+ iMacroPosition = hSelectNodeByName( MakroAus, DOCUMENT_NAME )
+ hExpandNode( MakroAus, iMacroPosition )
+
+ printlog( "Move to node <" & LIBRARY_NAME & ">" )
+ iMacroPosition = hSelectNextNode( MakroAus )
+ if ( not hVerifyNodeName( MakroAus, LIBRARY_NAME ) ) then
+ warnlog( "This is not the expected library" )
+ endif
+
+ printlog( "Move to node <" & MODULE_NAME & ">" )
+ hSelectNextNode( MakroAus )
+ if ( not hVerifyNodeName( MakroAus, MODULE_NAME ) ) then
+ warnlog( "This is not the expected module" )
+ endif
+
+ printlog( "Click <Ausfuehren> to execute the macro" )
+ iMacroPosition = hClickButton( Ausfuehren )
+
+ printlog( "Check for the " & EXPECTED_MACRO_COUNT & " expected messageboxes" )
+ for iCurrentMacro = 1 to EXPECTED_MACRO_COUNT
+
+ kontext "Active"
+ printlog( iCurrentMacro & ": Check for messagebox: " & macro_identifier( iCurrentMacro ) )
+ if ( Active.exists( MAX_WAIT ) ) then
+
+ if ( Active.getText() = macro_identifier( iCurrentMacro ) ) then
+ printlog( "The expected macro was executed" )
+ else
+ warnlog( "Unexpected macro executed: " & Active.getText() )
+ printlog( Active.getText() )
+ endif
+ Active.ok()
+
+ else
+ warnlog( "Expected messagebox not displayed within reasonable timeframe" )
+ goto endsub
+ endif
+
+ next iCurrentMacro
+ else
+ warnlog( "Failed to open BASIC organizer" )
+ endif
+
+ printlog( "Cleanup" )
+ hCloseDocument()
+ hSetExcelImportModeDefault()
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
+
+endcase
+
+
diff --git a/testautomation/framework/optional/input/vba-compat/vba-application-union.xls b/testautomation/framework/optional/input/vba-compat/vba-application-union.xls
new file mode 100755
index 000000000000..b1f1be816b7b
--- /dev/null
+++ b/testautomation/framework/optional/input/vba-compat/vba-application-union.xls
Binary files differ