diff options
author | ms93807 <ms93807@x4240-so5> | 2010-02-05 08:39:58 +0100 |
---|---|---|
committer | ms93807 <ms93807@x4240-so5> | 2010-02-05 08:39:58 +0100 |
commit | 220073a41a5bc68e84aaf19124ef487ab361a31b (patch) | |
tree | 3af46050dfdcb02206e29b1c0a543d3e86b0d954 /testautomation/dbaccess | |
parent | 090bc5591c2bc09c2097771b1bf182bcfc45dd0a (diff) |
dba33e: #108973# refactor and code cleanup
Diffstat (limited to 'testautomation/dbaccess')
7 files changed, 999 insertions, 833 deletions
diff --git a/testautomation/dbaccess/optional/includes/ctrl_General.inc b/testautomation/dbaccess/optional/includes/ctrl_General.inc index 80fc173652b2..af63b06545bd 100755 --- a/testautomation/dbaccess/optional/includes/ctrl_General.inc +++ b/testautomation/dbaccess/optional/includes/ctrl_General.inc @@ -1031,7 +1031,7 @@ testcase tAddFields Liste.TypeKeys "<DOWN>" , 4, true sControlName2 = Liste.getSelText if sControlName1 <> sControlName2 then - qaerrorlog "#i98316# The control name is not the same as the fieldname." + warnlog "The control name is not the same as the fieldname. controlname = " + sControlName2 + " fieldname = " + sControlName1 endif sleep (2) diff --git a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc index b2571dfd64ac..d5db37e4f527 100755 --- a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc +++ b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc @@ -42,27 +42,44 @@ testcase db_JDBCMySQL ' databases specific settings for JDBC MySQL ' ************************************************** - qaerrorlog "due to issue 98387 this test will not work anymore." - goto endsub - - Dim sFileName as string + dim sDBConfigFile as string + + sDBConfigFile = environ ( "VTT_DB_CONFIG_FILE" ) + + printlog sDBConfigFile + + if (sDBConfigFile = "") then + qaerrorlog "settings for external databases not found. see wiki page. This test ist stopped now" + goto endsub + else + if Dir( sDBConfigFile ) = "" then ' the file does not exists + qaerrorlog "settings for external databases not found. see wiki page. This test ist stopped now" + else + ' file exists , so we can do th next step + endif + + endif + + + + Dim sFileName as string sFileName = gOfficePath + Convertpath("user/work/TT_JDBC-MYSQL.odb") - - Dim sTableName as string - sTableName = "tt_test_create-table" - - Dim sUser as string - sUser = "testtool" - - Dim sPWD as string - sPWD = "testtool" - - dim sCatalog as string - sCatalog = " " ' not used in this ds - - dim sSchema as string - sSchema = " " ' not used in this ds - + + Dim sTableName as string + sTableName = "tt_test_create-table" + + Dim sUser as string + sUser = "testtool" + + Dim sPWD as string + sPWD = "testtool" + + dim sCatalog as string + sCatalog = " " ' not used in this ds + + dim sSchema as string + sSchema = " " ' not used in this ds + Dim aFieldTypeContent(30,2) as string 'database specific data matrix aFieldTypeContent(1,1)="tt_bool" @@ -162,39 +179,38 @@ testcase db_JDBCMySQL aFieldContent(1,4)="1" aFieldContent(1,5)="1" aFieldContent(1,6)="1" - - call fSetJDBCDriverFiles(gTesttoolPath + Convertpath("dbaccess/optional/input/driver/mysql_jconnector.jar")) - 'after changing the classpath the office has to be restarted. - call ExitRestartTheOffice - dim dbok as boolean - dbok = false - - dim aDatabaseProperties(5) as string - aDatabaseProperties() = tools_dbtools_fgetMySQLJDBCDatabaseProperties() - - ' if and only if no properties are defined in the environment file the test is stopped - if(aDatabaseProperties(1) = "no") then - qaerrorlog "No database properties from Mysql defiened. The Test is stopped here." - goto endsub - endif - - dbok = fCreateMySQL_JDBC_Datasource(sFileName,aDatabaseProperties(3),aDatabaseProperties(2),aDatabaseProperties(4),aDatabaseProperties(5)) - if dbok = true then - - call fOpendatabase(sFileName,aDatabaseProperties(6)) - call fCreateTable( aFieldTypeContent(), sTableName) - call fInsertIntoTable( aFieldContent(), sTableName) - call fCloseDatabase - - 'use "dbaccess/optional/includes/b_lvl1_Query.inc" - 'call b_lvl1_Query(sFileName,"dbase") - - call tRelation( sFileName, aDatabaseProperties(6), "rel1", "rel2" ) - - else - warnlog "Data Source could not be created - beyond testcases stopped" - endif - + dim aDatabaseProperties(7) as string + aDatabaseProperties() = tools_dbtools_fgetMySQLJDBCDatabaseProperties(sDBConfigFile) + + call fSetJDBCDriverFiles(aDatabaseProperties(7)) + 'after changing the classpath the office has to be restarted. + call ExitRestartTheOffice + + dim dbok as boolean + dbok = false + + ' if and only if no properties are defined in the environment file the test is stopped + if(aDatabaseProperties(1) = "no") then + qaerrorlog "No database properties from Mysql defiened. The Test is stopped here." + goto endsub + endif + + dbok = fCreateMySQL_JDBC_Datasource(sFileName,aDatabaseProperties(3),aDatabaseProperties(2),aDatabaseProperties(4),aDatabaseProperties(5)) + if dbok = true then + call fOpendatabase(sFileName,aDatabaseProperties(6)) + call fCreateTable( aFieldTypeContent(), sTableName) + call fInsertIntoTable( aFieldContent(), sTableName) + call fCloseDatabase + + 'use "dbaccess/optional/includes/b_lvl1_Query.inc" + 'call b_lvl1_Query(sFileName,"dbase") + + 'call tRelation( sFileName, aDatabaseProperties(6), "rel1", "rel2" ) + + else + warnlog "Data Source could not be created - beyond testcases stopped" + endif + endcase diff --git a/testautomation/dbaccess/optional/includes/frm_FormFilter.inc b/testautomation/dbaccess/optional/includes/frm_FormFilter.inc index 243e186c209d..2fd7efa31b8c 100755 --- a/testautomation/dbaccess/optional/includes/frm_FormFilter.inc +++ b/testautomation/dbaccess/optional/includes/frm_FormFilter.inc @@ -72,7 +72,7 @@ testcase tLoadForm printlog "execute the form filter" FM_FF_Execute wait(1000) - qaerrorlog "workarounf issue 102010" + printlog "workaround issue 102010" DocumentWriter.TypeKeys "<MOD1 F6>" , true sleep(1) DocumentWriter.TypeKeys "<MOD1 F5>" , true @@ -105,7 +105,7 @@ testcase tLoadForm FM_FF_Execute wait(1000) - qaerrorlog "workarounf issue 102010" + printlog "workaround issue 102010" DocumentWriter.TypeKeys "<MOD1 F6>" , true sleep(1) DocumentWriter.TypeKeys "<MOD1 F5>" , true diff --git a/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc b/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc index 98771d2340ea..f379f2b35e26 100755 --- a/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc +++ b/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc @@ -40,6 +40,7 @@ sub wiz_DatabaseWizard call tNewDatabase call tOpenDatabase call tOpenNoneDatabaseDocument + call tStartTableWizardFromWizard call tODBC call tEvolution call tMozilla @@ -312,3 +313,73 @@ testcase tOracleJDBC qaerrorlog "not yet implemented" endcase '------------------------------------------------------------------------- +testcase tStartTableWizardFromWizard + + printlog "start database wizard via FILE / NEW / DATABASE" + Kontext "DocumentWriter" + if (DocumentWriter.exists(1)) then + DocumentWriter.UseMenu + else + Kontext "DocumentBackground" + DocumentBackground.UseMenu + endif + hMenuSelectNr(1) + hMenuSelectNr(1) + hMenuSelectNr(5) + + sleep(10) + + Kontext "DatabaseWizard" + printlog "check create new database" + CreateNewDatabase.Check + sleep(1) + printlog "click next button" + NextBtn.Click + sleep(1) + printlog "check the 'Create Table with wizard' option" + StartTableWizard.check() + printlog "click finished button" + FinishBtn.Click + sleep(1) + + Kontext "SpeichernDlg" + printlog "click save in the save as dialog" + if ( Dateiname.getSelText() = "" ) then + warnlog "#i58413# Default filename is missing" + Dim sFileName as String + sFileName = ConvertPath(gOfficePath + "user/work/TTDB1.odb") + if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then + app.kill(ConvertPath(sFileName)) + endif + Dateiname.setText(sFileName) + endif + Speichern.click + sleep(10) + + Kontext "MessageBox" + if MessageBox.exists then + MessageBox.yes + end if + + sleep(5) + + Kontext "TableWizard" + printlog "check if the table wizard appear" + if( TableWizard.exists(10) ) then + printlog "the table wizard appear." + CancelBtn.click() + else + warnlog "the table wizard does not appear." + endif + + Kontext "ContainerView" + + ViewTables + + sleep(1) + + printlog "close the database" + call fCloseDatabase(true) + +endcase +'------------------------------------------------------------------------- diff --git a/testautomation/dbaccess/required/includes/DatabaseTypes.inc b/testautomation/dbaccess/required/includes/DatabaseTypes.inc index 2c2178f1c6ee..22dd347b2bea 100755 --- a/testautomation/dbaccess/required/includes/DatabaseTypes.inc +++ b/testautomation/dbaccess/required/includes/DatabaseTypes.inc @@ -1,747 +1,760 @@ -'encoding UTF-8 Do not remove or change this line! -'************************************************************************** -'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -'* -'* Copyright 2008 by Sun Microsystems, Inc. -'* -'* OpenOffice.org - a multi-platform office productivity suite -'* -'* $RCSfile: DatabaseTypes.inc,v $ -'* -'* $Revision: 1.1 $ -'* -'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $ -'* -'* 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 : marc.neumann@sun.com -'* -'* short description : test the database types -'* -'************************************************************************ -'* -' #1 tMySQLODBCProperties -' #1 tMySQLJDBCProperties -' #1 tAdabasProperties -' #1 tOracleJDBCProperties -' #1 tJDBCProperties -' #1 tODBCProperties -' #1 tdBaseProperties -' #1 tTextProperties -' #1 tSpreadsheetProperties -' #1 tMozillaProperties -' #1 tLDAPProperties -' #1 tEvolutionProperties -' #1 tCheckHSQLDB -'* -'\*********************************************************************************** -sub DatabaseTypes - - printlog "------------------ DatabaseTypes.inc ---------------------" - - call tMySQLODBCProperties - call tMySQLJDBCProperties - call tAdabasProperties - call tOracleJDBCProperties - call tJDBCProperties - call tODBCProperties - call tdBaseProperties - call tTextProperties - call tSpreadsheetProperties - call tMozillaProperties - call tLDAPProperties - call tEvolutionProperties - call tCheckHSQLDB - -end sub -'------------------------------------------------------------------------- -'------------------------------------------------------------------------- -testcase tMySQLODBCProperties - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:mysql:odbc:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("MySQLODBC") - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - - Kontext "TabMySQLODBC" - '/// check the MySQLODBC page - call fCheckTabPage(TabMySQLODBC) - - Kontext "ConnectionType" - ConnectionType.OK - - call fCheckAdvancedDialog("MySQLODBC") - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tMySQLJDBCProperties - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:mysql:jdbc:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("MySQLJDBC") - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - - Kontext "TabMySQLJDBC" - '/// check the MySQLJDBC page - call fCheckTabPage(TabMySQLJDBC) - - Kontext "ConnectionType" - ConnectionType.OK - - call fCheckAdvancedDialog("MySQLJDBC") - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tAdabasProperties - - if gPlatform = "x86" then - printlog "Adabas is not available under x86." - goto endsub - end if - - if gPlatform = "osx" then - printlog "Adabas doesn't exists under mac osx." - goto endsub - end if - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - sleep(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:adabas:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("Adabas") - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - - Kontext "TabAdabas" - '/// check the Adabas page - call fCheckTabPage(TabAdabas) - - Kontext "ConnectionType" - ConnectionType.OK - - call fCheckAdvancedDialog("Adabas") - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tOracleJDBCProperties - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("jdbc:oracle:thin:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("OracleJDBC") - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - - Kontext "TabOracleJDBC" - '/// check the TabOracleJDBC page - call fCheckTabPage(TabOracleJDBC) - - Kontext "ConnectionType" - ConnectionType.Cancel - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tJDBCProperties - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("jdbc:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("JDBC") - - Kontext "ConnectionType" - ConnectionType.Cancel - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tLDAPProperties - - if gPlatform = "osx" then - printlog "LDAP doesn't exists under mac osx." - goto endsub - end if - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:ldap:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("LDAP") - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - - Kontext "TabLDAP" - '/// check the LDAP page - call fChecktabPage(TabLDAP) - - Kontext "ConnectionType" - ConnectionType.Cancel - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tEvolutionProperties - - if gPlatform <> "lin" then - printlog "Evolution does only exists under linux." - goto endsub - end if - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - try - if ( DatabaseType.getItemCount() > 12 ) then - DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:evolution:ldap")) - Kontext "ConnectionType" - ConnectionType.OK - else - qaerrorlog "Evolution does not appear to be available on this system" - Kontext "ConnectionType" - ConnectionType.Cancel - endif - catch - warnlog "failed to select DataBaseType Evolution - maybe not installed or activated in this build" - TabGeneral.Cancel - call fCloseDatabase - goto endsub - endcatch - - 'call fCheckAdvancedDialog("Evolution") - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tMozillaProperties - - if gPlatform = "osx" then - printlog "LDAP doesn't exists under mac osx." - goto endsub - end if - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:mozilla:")) - - 'add sleep to give OOo time to react - sleep(2) - - Kontext "ConnectionType" - ConnectionType.OK - - 'call fCheckAdvancedDialog("Mozilla") - - 'add sleep to give OOo time to react - sleep(2) - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tSpreadsheetProperties - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:calc:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("CALC") - - Kontext "ConnectionType" - ConnectionType.Cancel - - 'call fCheckAdvancedDialog("CALC") - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tTextProperties - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:flat:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("Text") - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - - Kontext "TabTextBase" - '/// check the Text page - call fCheckTabPage(TabTextBase) - - Kontext "ConnectionType" - ConnectionType.ok - - call fCheckAdvancedDialog("Text") - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tdBaseProperties - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:dbase:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("dBase") - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - - Kontext "TabdBase" - '/// check the dBase page - call fCheckTabPage(TabdBase) - - Kontext "ConnectionType" - ConnectionType.OK - - call fCheckAdvancedDialog("dBase") - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tODBCProperties - - call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb")) - - ViewForms - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(2) - - Kontext "TabGeneral" - call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:odbc:*")) - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - call fCheckConnectionTabPage("ODBC") - - Kontext "ConnectionType" - NextBtn.Click - sleep(1) - - Kontext "TabODBC" - '/// check the ODBC page - call fCheckTabPage(TabODBC) - - Kontext "ConnectionType" - ConnectionType.OK - - call fCheckAdvancedDialog("ODBC") - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -testcase tCheckHSQLDB - - Dim sDatasourceFileName as String - sDatasourceFileName = ConvertPath(gOfficePath + "user/work/hsqldb.odb") - call fCreateHSQLDatasource(sDatasourceFileName) - - call fOpenDatabase(sDatasourceFileName) - - Kontext "ContainerView" - ViewTables - - call fCloseDatabase() - -endcase -'------------------------------------------------------------------------- -'------------------------------------------------------------------------- -'------------------------------------------------------------------------- -'------------------------------------------------------------------------- -'------------------------------------------------------------------------- -function fCheckAdvancedDialog(sType as string) - - printlog "+Check the Advanced Settings for the datasource type " + sType - - Kontext "DATABASE" - Database.UseMenu - hMenuSelectNr(2) - hMenuSelectNr(15) - hMenuSelectNr(3) - - Kontext "Advanced" - - if sType = "OracleJDBC" OR sType = "JDBC" OR sType = "ODBC" then - TabControl.setPage AdvancedSettingsSpecial - call fcheckControl(SQL92Check) - call fcheckControl(AppendAlias) - call fcheckControl(Ignoreprivileges) - call fcheckControl(ParameterSubstiti) - call fcheckControl(DisplayVersionColumns) - call fcheckControl(BooleanComparison) - call fcheckControl(EnableOuterJoin) - call fcheckControl(CheckRequiredFields) - - TabControl.setPage TabGeneratedValues - call fcheckControl(RetrieveGeneratedValues) - call fcheckControl(AutoIncrementStatement) - call fcheckControl(QueryGeneratedValues) - - elseif sType = "MySQLODBC" OR sType = "MySQLJDBC" then - - 'call fcheckControl(SQL92Check) - 'call fcheckControl(AppendAlias) - call fcheckControl(Ignoreprivileges) - 'call fcheckControl(ParameterSubstiti) - call fcheckControl(DisplayVersionColumns) - call fcheckControl(BooleanComparison) - 'call fcheckControl(EnableOuterJoin) - call fcheckControl(CheckRequiredFields) - - - elseif sType = "dBase" OR sType = "Text" then - call fcheckControl(SQL92Check) - 'call fcheckControl(BooleanComparison) - 'call fcheckControl(AppendAlias) - - elseif sType = "CALC" OR sType = "Mozilla" OR sType = "Evolution" OR sType = "LDAP" then - ' call fcheckControl(BooleanComparison) - ' call fcheckControl(AppendAlias) - - elseif sType = "Adabas" then - call fcheckControl(AppendAlias) - call fcheckControl(BooleanComparison) - call fcheckControl(SQL92Check) - call fcheckControl(DisplayVersionColumns) - call fcheckControl(CheckRequiredFields) - else - qaerrorlog "unknown database type" - end if - - Kontext "Advanced" - Advanced.Cancel - -end function -'------------------------------------------------------------------------- -function fcheckControl(oControl as object) - - if oControl.exists() then - printlog "|The control " + oControl.Name + " exists." - else - warnlog "|The control " + oControl.Name + " doesn't exists." - end if - -end function -'------------------------------------------------------------------------- -function fCheckConnectionTabPage(sType as string) - - printlog "+check the connection page for the datasource type " + sType - - Kontext "TabConnection" - - call DialogTest(TabConnection) - - if sType = "MySQLODBC" then - call fcheckControl(MySQLODBCDatasource) - call fcheckControl(SelectPath) - call fcheckControl(Username) - call fcheckControl(PasswordRequired) - call fcheckControl(TestConnection) - - elseif sType = "MySQLJDBC" then - call fcheckControl(MySQLJDBCDatasource) - call fcheckControl(Username) - call fcheckControl(PasswordRequired) - call fcheckControl(TestConnection) - - elseif sType = "Adabas" then - call fcheckControl(AdabasDatasource) - call fcheckControl(SelectPath) - call fcheckControl(Username) - call fcheckControl(PasswordRequired) - call fcheckControl(TestConnection) - - elseif sType = "OracleJDBC" then - call fcheckControl(OracleJDBCDatasource) - call fcheckControl(Username) - call fcheckControl(PasswordRequired) - call fcheckControl(TestConnection) - - elseif sType = "JDBC" then - call fcheckControl(ConnectUrl) - call fcheckControl(Username) - call fcheckControl(PasswordRequired) - call fcheckControl(TestConnection) - call fcheckControl(TestDriver) - call fcheckControl(JDBCDriverClass) - - elseif sType = "ODBC" then - call fcheckControl(OdbcDatasourceName) - call fcheckControl(Username) - call fcheckControl(PasswordRequired) - call fcheckControl(TestConnection) - - elseif sType = "dBase" then - call fcheckControl(dBasePath) - call fcheckControl(SelectPath) - call fcheckControl(TestConnection) - - elseif sType = "CALC" then - call fcheckControl(SpreadsheetPath) - call fcheckControl(SelectPath) - call fcheckControl(TestConnection) - - elseif sType = "Text" then - call fcheckControl(TextPath) - call fcheckControl(SelectPath) - call fcheckControl(TestConnection) - - elseif sType = "LDAP" then - call fcheckControl(HostName) - call fcheckControl(TestConnection) - - elseif sType = "Mozilla" OR sType = "Evolution" then - call fcheckControl(TestConnection) - end if - -end function -'------------------------------------------------------------------------- -function fCheckTabPage(oType as object) - - printlog "+check the " + oType.Name + " page." - Kontext oType.Name - - call DialogTest(oType) - - if oType.Name = "TabMySQLJDBC" OR oType.Name = "TabOracleJDBC" then - call fcheckControl(CharSet) - call fcheckControl(HostName) - call fcheckControl(PortNumber) - call fcheckControl(DriverClass) - call fcheckControl(TestClass) - - elseif oType.Name = "TabAdabas" then - call fcheckControl(CharSet) - call fcheckControl(HostName) - call fcheckControl(CacheSize) - call fcheckControl(DataIncrement) - call fcheckControl(CotrolUser) - call fcheckControl(ControlPassword) - call fcheckControl(ShutdownService) - call fcheckControl(Extended) - - elseif oType.Name = "TabODBC" then - call fcheckControl(UseCatalogs) - call fcheckControl(Options) - call fcheckControl(CharSet) - - elseif oType.Name = "TabdBase" then - call fcheckControl(CharSet) - call fcheckControl(DisplayInactiveRecords) - call fcheckControl(Indexes) - - elseif ( oType.Name = "TabLDAP" ) then - call fcheckControl(BaseDN) - call fcheckControl(PortNumber) - call fcheckControl(Records) - - elseif ( oType.Name = "TabTextBase" ) then - call fcheckControl(TextContainsHeaders) - call fcheckControl(FieldSeparator) - call fcheckControl(TextSeparator) - call fcheckControl(DecimalSeparator) - call fcheckControl(ThousandsSeparator) - call fcheckControl(PlainTextFiles) - call fcheckControl(CVSFiles) - call fcheckControl(Custom) - call fcheckControl(CustomTxt) - call fcheckControl(CharSet) - end if - -end function +'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'*
+'* Copyright 2008 by Sun Microsystems, Inc.
+'*
+'* OpenOffice.org - a multi-platform office productivity suite
+'*
+'* $RCSfile: DatabaseTypes.inc,v $
+'*
+'* $Revision: 1.1 $
+'*
+'* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $
+'*
+'* 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 : marc.neumann@sun.com
+'*
+'* short description : test the database types
+'*
+'************************************************************************
+'*
+' #1 tMySQLODBCProperties
+' #1 tMySQLJDBCProperties
+' #1 tAdabasProperties
+' #1 tOracleJDBCProperties
+' #1 tJDBCProperties
+' #1 tODBCProperties
+' #1 tdBaseProperties
+' #1 tTextProperties
+' #1 tSpreadsheetProperties
+' #1 tMozillaProperties
+' #1 tLDAPProperties
+' #1 tEvolutionProperties
+' #1 tCheckHSQLDB
+'*
+'\***********************************************************************************
+sub DatabaseTypes
+
+ printlog "------------------ DatabaseTypes.inc ---------------------"
+
+ ' call tMySQLODBCProperties
+ ' call tMySQLJDBCProperties
+ 'call tAdabasProperties
+ 'call tOracleJDBCProperties
+ 'call tJDBCProperties
+ 'call tODBCProperties
+ 'call tdBaseProperties
+ 'call tTextProperties
+ 'call tSpreadsheetProperties
+ call tMozillaProperties
+ call tLDAPProperties
+ call tEvolutionProperties
+ call tCheckHSQLDB
+
+end sub
+'-------------------------------------------------------------------------
+'-------------------------------------------------------------------------
+testcase tMySQLODBCProperties
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:mysql:odbc:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("MySQLODBC")
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+
+ Kontext "TabMySQLODBC"
+ '/// check the MySQLODBC page
+ call fCheckTabPage(TabMySQLODBC)
+
+ Kontext "ConnectionType"
+ ConnectionType.OK
+
+ call fCheckAdvancedDialog("MySQLODBC")
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tMySQLJDBCProperties
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:mysql:jdbc:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("MySQLJDBC")
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+
+ Kontext "TabMySQLJDBC"
+ '/// check the MySQLJDBC page
+ call fCheckTabPage(TabMySQLJDBC)
+
+ Kontext "ConnectionType"
+ ConnectionType.OK
+
+ call fCheckAdvancedDialog("MySQLJDBC")
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tAdabasProperties
+
+ if gPlatform = "x86" then
+ printlog "Adabas is not available under x86."
+ goto endsub
+ end if
+
+ if gPlatform = "osx" then
+ printlog "Adabas doesn't exists under mac osx."
+ goto endsub
+ end if
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ sleep(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:adabas:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("Adabas")
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+
+ Kontext "TabAdabas"
+ '/// check the Adabas page
+ call fCheckTabPage(TabAdabas)
+
+ Kontext "ConnectionType"
+ ConnectionType.OK
+
+ call fCheckAdvancedDialog("Adabas")
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tOracleJDBCProperties
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("jdbc:oracle:thin:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("OracleJDBC")
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+
+ Kontext "TabOracleJDBC"
+ '/// check the TabOracleJDBC page
+ call fCheckTabPage(TabOracleJDBC)
+
+ Kontext "ConnectionType"
+ ConnectionType.Cancel
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tJDBCProperties
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("jdbc:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("JDBC")
+
+ Kontext "ConnectionType"
+ ConnectionType.Cancel
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tLDAPProperties
+
+ if gPlatform = "osx" then
+ printlog "LDAP doesn't exists under mac osx."
+ goto endsub
+ end if
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:ldap:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("LDAP")
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+
+ Kontext "TabLDAP"
+ '/// check the LDAP page
+ call fChecktabPage(TabLDAP)
+
+ Kontext "ConnectionType"
+ ConnectionType.Cancel
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tEvolutionProperties
+
+ if gPlatform <> "lin" then
+ printlog "Evolution does only exists under linux."
+ goto endsub
+ end if
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ try
+ if ( isDriverInstalled("sdbc:address:evolution:ldap")) then
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:evolution:ldap"))
+ Kontext "ConnectionType"
+ ConnectionType.OK
+ else
+ qaerrorlog "Evolution does not appear to be available on this system"
+ Kontext "ConnectionType"
+ ConnectionType.Cancel
+ endif
+ catch
+ warnlog "failed to select DataBaseType Evolution - maybe not installed or activated in this build"
+ TabGeneral.Cancel
+ call fCloseDatabase
+ goto endsub
+ endcatch
+
+ 'call fCheckAdvancedDialog("Evolution")
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tMozillaProperties
+
+ if gPlatform = "osx" then
+ printlog "LDAP doesn't exists under mac osx."
+ goto endsub
+ end if
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ try
+ if ( isDriverInstalled("sdbc:address:mozilla:")) then
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:mozilla:"))
+ Kontext "ConnectionType"
+ ConnectionType.OK
+ else
+ qaerrorlog "Mozilla does not appear to be available on this system"
+ Kontext "ConnectionType"
+ ConnectionType.Cancel
+ endif
+ catch
+ warnlog "failed to select DataBaseType Mozilla - maybe not installed or activated in this build"
+ TabGeneral.Cancel
+ call fCloseDatabase
+ goto endsub
+ endcatch
+
+
+ 'add sleep to give OOo time to react
+ sleep(2)
+
+ 'call fCheckAdvancedDialog("Mozilla")
+
+ 'add sleep to give OOo time to react
+ sleep(2)
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tSpreadsheetProperties
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:calc:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("CALC")
+
+ Kontext "ConnectionType"
+ ConnectionType.Cancel
+
+ 'call fCheckAdvancedDialog("CALC")
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tTextProperties
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:flat:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("Text")
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+
+ Kontext "TabTextBase"
+ '/// check the Text page
+ call fCheckTabPage(TabTextBase)
+
+ Kontext "ConnectionType"
+ ConnectionType.ok
+
+ call fCheckAdvancedDialog("Text")
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tdBaseProperties
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:dbase:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("dBase")
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+
+ Kontext "TabdBase"
+ '/// check the dBase page
+ call fCheckTabPage(TabdBase)
+
+ Kontext "ConnectionType"
+ ConnectionType.OK
+
+ call fCheckAdvancedDialog("dBase")
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tODBCProperties
+
+ call fOpenDatabase (gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ ViewForms
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(2)
+
+ Kontext "TabGeneral"
+ call DialogTest(TabGeneral)
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:odbc:*"))
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+ call fCheckConnectionTabPage("ODBC")
+
+ Kontext "ConnectionType"
+ NextBtn.Click
+ sleep(1)
+
+ Kontext "TabODBC"
+ '/// check the ODBC page
+ call fCheckTabPage(TabODBC)
+
+ Kontext "ConnectionType"
+ ConnectionType.OK
+
+ call fCheckAdvancedDialog("ODBC")
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+testcase tCheckHSQLDB
+
+ Dim sDatasourceFileName as String
+ sDatasourceFileName = ConvertPath(gOfficePath + "user/work/hsqldb.odb")
+ call fCreateHSQLDatasource(sDatasourceFileName)
+
+ call fOpenDatabase(sDatasourceFileName)
+
+ Kontext "ContainerView"
+ ViewTables
+
+ call fCloseDatabase()
+
+endcase
+'-------------------------------------------------------------------------
+'-------------------------------------------------------------------------
+'-------------------------------------------------------------------------
+'-------------------------------------------------------------------------
+'-------------------------------------------------------------------------
+function fCheckAdvancedDialog(sType as string)
+
+ printlog "+Check the Advanced Settings for the datasource type " + sType
+
+ Kontext "DATABASE"
+ Database.UseMenu
+ hMenuSelectNr(2)
+ hMenuSelectNr(15)
+ hMenuSelectNr(3)
+
+ Kontext "Advanced"
+
+ if sType = "OracleJDBC" OR sType = "JDBC" OR sType = "ODBC" then
+ TabControl.setPage AdvancedSettingsSpecial
+ call fcheckControl(SQL92Check)
+ call fcheckControl(AppendAlias)
+ call fcheckControl(Ignoreprivileges)
+ call fcheckControl(ParameterSubstiti)
+ call fcheckControl(DisplayVersionColumns)
+ call fcheckControl(BooleanComparison)
+ call fcheckControl(EnableOuterJoin)
+ call fcheckControl(CheckRequiredFields)
+
+ TabControl.setPage TabGeneratedValues
+ call fcheckControl(RetrieveGeneratedValues)
+ call fcheckControl(AutoIncrementStatement)
+ call fcheckControl(QueryGeneratedValues)
+
+ elseif sType = "MySQLODBC" OR sType = "MySQLJDBC" then
+
+ 'call fcheckControl(SQL92Check)
+ 'call fcheckControl(AppendAlias)
+ call fcheckControl(Ignoreprivileges)
+ 'call fcheckControl(ParameterSubstiti)
+ call fcheckControl(DisplayVersionColumns)
+ call fcheckControl(BooleanComparison)
+ 'call fcheckControl(EnableOuterJoin)
+ call fcheckControl(CheckRequiredFields)
+
+
+ elseif sType = "dBase" OR sType = "Text" then
+ call fcheckControl(SQL92Check)
+ 'call fcheckControl(BooleanComparison)
+ 'call fcheckControl(AppendAlias)
+
+ elseif sType = "CALC" OR sType = "Mozilla" OR sType = "Evolution" OR sType = "LDAP" then
+ ' call fcheckControl(BooleanComparison)
+ ' call fcheckControl(AppendAlias)
+
+ elseif sType = "Adabas" then
+ call fcheckControl(AppendAlias)
+ call fcheckControl(BooleanComparison)
+ call fcheckControl(SQL92Check)
+ call fcheckControl(DisplayVersionColumns)
+ call fcheckControl(CheckRequiredFields)
+ else
+ qaerrorlog "unknown database type"
+ end if
+
+ Kontext "Advanced"
+ Advanced.Cancel
+
+end function
+'-------------------------------------------------------------------------
+function fcheckControl(oControl as object)
+
+ if oControl.exists() then
+ printlog "|The control " + oControl.Name + " exists."
+ else
+ warnlog "|The control " + oControl.Name + " doesn't exists."
+ end if
+
+end function
+'-------------------------------------------------------------------------
+function fCheckConnectionTabPage(sType as string)
+
+ printlog "+check the connection page for the datasource type " + sType
+
+ Kontext "TabConnection"
+
+ call DialogTest(TabConnection)
+
+ if sType = "MySQLODBC" then
+ call fcheckControl(MySQLODBCDatasource)
+ call fcheckControl(SelectPath)
+ call fcheckControl(Username)
+ call fcheckControl(PasswordRequired)
+ call fcheckControl(TestConnection)
+
+ elseif sType = "MySQLJDBC" then
+ call fcheckControl(MySQLJDBCDatasource)
+ call fcheckControl(Username)
+ call fcheckControl(PasswordRequired)
+ call fcheckControl(TestConnection)
+
+ elseif sType = "Adabas" then
+ call fcheckControl(AdabasDatasource)
+ call fcheckControl(SelectPath)
+ call fcheckControl(Username)
+ call fcheckControl(PasswordRequired)
+ call fcheckControl(TestConnection)
+
+ elseif sType = "OracleJDBC" then
+ call fcheckControl(OracleJDBCDatasource)
+ call fcheckControl(Username)
+ call fcheckControl(PasswordRequired)
+ call fcheckControl(TestConnection)
+
+ elseif sType = "JDBC" then
+ call fcheckControl(ConnectUrl)
+ call fcheckControl(Username)
+ call fcheckControl(PasswordRequired)
+ call fcheckControl(TestConnection)
+ call fcheckControl(TestDriver)
+ call fcheckControl(JDBCDriverClass)
+
+ elseif sType = "ODBC" then
+ call fcheckControl(OdbcDatasourceName)
+ call fcheckControl(Username)
+ call fcheckControl(PasswordRequired)
+ call fcheckControl(TestConnection)
+
+ elseif sType = "dBase" then
+ call fcheckControl(dBasePath)
+ call fcheckControl(SelectPath)
+ call fcheckControl(TestConnection)
+
+ elseif sType = "CALC" then
+ call fcheckControl(SpreadsheetPath)
+ call fcheckControl(SelectPath)
+ call fcheckControl(TestConnection)
+
+ elseif sType = "Text" then
+ call fcheckControl(TextPath)
+ call fcheckControl(SelectPath)
+ call fcheckControl(TestConnection)
+
+ elseif sType = "LDAP" then
+ call fcheckControl(HostName)
+ call fcheckControl(TestConnection)
+
+ elseif sType = "Mozilla" OR sType = "Evolution" then
+ call fcheckControl(TestConnection)
+ end if
+
+end function
+'-------------------------------------------------------------------------
+function fCheckTabPage(oType as object)
+
+ printlog "+check the " + oType.Name + " page."
+ Kontext oType.Name
+
+ call DialogTest(oType)
+
+ if oType.Name = "TabMySQLJDBC" OR oType.Name = "TabOracleJDBC" then
+ call fcheckControl(CharSet)
+ call fcheckControl(HostName)
+ call fcheckControl(PortNumber)
+ call fcheckControl(DriverClass)
+ call fcheckControl(TestClass)
+
+ elseif oType.Name = "TabAdabas" then
+ call fcheckControl(CharSet)
+ call fcheckControl(HostName)
+ call fcheckControl(CacheSize)
+ call fcheckControl(DataIncrement)
+ call fcheckControl(CotrolUser)
+ call fcheckControl(ControlPassword)
+ call fcheckControl(ShutdownService)
+ call fcheckControl(Extended)
+
+ elseif oType.Name = "TabODBC" then
+ call fcheckControl(UseCatalogs)
+ call fcheckControl(Options)
+ call fcheckControl(CharSet)
+
+ elseif oType.Name = "TabdBase" then
+ call fcheckControl(CharSet)
+ call fcheckControl(DisplayInactiveRecords)
+ call fcheckControl(Indexes)
+
+ elseif ( oType.Name = "TabLDAP" ) then
+ call fcheckControl(BaseDN)
+ call fcheckControl(PortNumber)
+ call fcheckControl(Records)
+
+ elseif ( oType.Name = "TabTextBase" ) then
+ call fcheckControl(TextContainsHeaders)
+ call fcheckControl(FieldSeparator)
+ call fcheckControl(TextSeparator)
+ call fcheckControl(DecimalSeparator)
+ call fcheckControl(ThousandsSeparator)
+ call fcheckControl(PlainTextFiles)
+ call fcheckControl(CVSFiles)
+ call fcheckControl(Custom)
+ call fcheckControl(CustomTxt)
+ call fcheckControl(CharSet)
+ end if
+
+end function
diff --git a/testautomation/dbaccess/tools/dbcreatetools.inc b/testautomation/dbaccess/tools/dbcreatetools.inc index f3d5abd6c944..6e4670966927 100755 --- a/testautomation/dbaccess/tools/dbcreatetools.inc +++ b/testautomation/dbaccess/tools/dbcreatetools.inc @@ -58,6 +58,9 @@ ' #1 getIdForDatabaseType '* '\*********************************************************************************** + +private const VERBOSE = true + function fCreateMySQL_ODBC_Datasource(sFileName, sOdbcDSN, sUser,optional sRegister) as boolean '/// create a new MySQL database via ODBC file with the given filename '///+ and the given URL @@ -159,7 +162,9 @@ function fCreateMySQL_JDBC_Datasource(sFileName,sDatabaseName,sHost,sPort,sUser, '/// <b>sUser:</b> the user for the connection '/// <b><i>optional</i> sRegister:</b> the name under which the database is be registered dim bOK as boolean - bOK = FALSE + bOK = FALSE + + dim sEntry as string ' delete the file if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then @@ -181,8 +186,12 @@ function fCreateMySQL_JDBC_Datasource(sFileName,sDatabaseName,sHost,sPort,sUser, Kontext "DatabaseWizard" ConnectToDatabase.Check - sleep(1) - DatabaseType.select( hGetDatabaseDisplayName( "sdbc:mysql:jdbc:*" ) ) + sleep(1) + sEntry = hGetDatabaseDisplayName( "sdbc:mysql:jdbc:*" ) + 'cut off the (JDBC) string + sEntry = Mid( sEntry , 1, len(sEntry) - Instr(sEntry,"(") ) + printlog "entry = " + sEntry + DatabaseType.select( sEntry ) sleep(1) NextBtn.Click sleep(1) @@ -203,8 +212,8 @@ function fCreateMySQL_JDBC_Datasource(sFileName,sDatabaseName,sHost,sPort,sUser, '/// check the password required checkbox printlog "check the password required checkbox" PasswordRequired.Check - - Kontext "DatabaseWizard" + + NextBtn.Click FinishBtn.Click Kontext "SpeichernDlg" @@ -1460,13 +1469,12 @@ function fSetJDBCDriverFiles(sClassPath) as boolean end function '------------------------------------------------------------------------- -private const VERBOSE = false function hGetInstalledDatabaseDrivers( dbDriverList() as string ) as integer ' This function returns the number of currently installed database drivers. ' Additionally it fills a given list (which should be large enough to hold - ' the names of all installed drivers) with the names and makes the list + ' the names of all installed drivers) with the url and makes the list ' compatible to the listfunctions (which places the list size in element 0) ' The list is platform dependent and might be locale dependent ' Note that some drivers (like e.g. HSQL Database Engine) do *not* show up @@ -1480,7 +1488,7 @@ function hGetInstalledDatabaseDrivers( dbDriverList() as string ) as integer dim iCurrentDriver as integer dim iDriverCount as integer - const CFN = "global::tools::includes::optional::t_database.inc::hGetInstalledDatabaseDrivers(): " + const CFN = "dbaccess::tools::dbcreatetools.inc::hGetInstalledDatabaseDrivers(): " ' Path to the node, searches all files below "Drivers" for "Installed" aPropertyValue( 0 ).Name = "nodepath" @@ -1499,11 +1507,11 @@ function hGetInstalledDatabaseDrivers( dbDriverList() as string ) as integer ' Get access xViewRoot = oUnoConfigurationAccess.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aPropertyValue() ) aElements() = xViewRoot.getElementNames() - + iDriverCount = ubound( aElements() ) dbDriverList( 0 ) = iDriverCount for iCurrentDriver = 1 to iDriverCount - dbDriverList( iCurrentDriver ) = xViewRoot.getByName( aElements( iCurrentDriver ) ).getByName( "DriverTypeDisplayName" ) + dbDriverList( iCurrentDriver ) = aElements( iCurrentDriver ) next iCurrentDriver endif @@ -1511,11 +1519,12 @@ function hGetInstalledDatabaseDrivers( dbDriverList() as string ) as integer if ( VERBOSE ) then printlog( CFN & "Returning " & iDriverCount & " drivers" ) endif + hGetInstalledDatabaseDrivers() = iDriverCount end function -'******************************************************************************* +'------------------------------------------------------------------------- function hGetDatabaseDisplayName( dbDriverURL as string ) as string @@ -1557,7 +1566,7 @@ function hGetDatabaseDisplayName( dbDriverURL as string ) as string dim oDriver as object dim sDatabaseName as string - const CFN = "global::tools::includes::optional::t_database.inc::hGetDatabaseDisplayName(): " + const CFN = "dbaccess::tools::dbcreatetools.inc::hGetDatabaseDisplayName(): " ' Path to the node, searches all files below "Drivers" for "Installed" aPropertyValue( 0 ).Name = "nodepath" @@ -1591,4 +1600,37 @@ function hGetDatabaseDisplayName( dbDriverURL as string ) as string hGetDataBaseDisplayName() = sDatabaseName end function +'------------------------------------------------------------------------- +function isDriverInstalled( dbDriverURL as string ) as string + + ' This function return true or false if a driver for a given URL is installed + + Dim myDriverList(20) as string + Dim i as integer + Dim sDriver as string + Dim breturn as boolean + breturn = false + + const CFN = "dbaccess::tools::dbcreatetools.inc::isDriverInstalled(): " + + if VERBOSE then + printlog CFN + printlog "url to search for : " + dbDriverURL + endif + + hGetInstalledDatabaseDrivers( myDriverList() ) + + for i = 1 to ubound(myDriverList) + sDriver = myDriverList(i) + if VERBOSE then + printlog "found url : " + sDriver + endif + if sDriver = dbDriverURL then + breturn = true + endif + next + + isDriverInstalled = breturn + +end function diff --git a/testautomation/dbaccess/tools/dbtools.inc b/testautomation/dbaccess/tools/dbtools.inc index 22e16211360c..0f37061b7ae4 100755 --- a/testautomation/dbaccess/tools/dbtools.inc +++ b/testautomation/dbaccess/tools/dbtools.inc @@ -46,6 +46,9 @@ ' #1 tools_dbtools_fgetMySQLDatabaseProperties '* '\*********************************************************************************** + +private const VERBOSE = true + '-------------------------------------------------------------------- function fSelectDatasourceInBeamer(sDSName1) '/// select a datasource in the beamer with the given name @@ -169,13 +172,20 @@ function fOpenDataBase ( sFileName , optional sPassword) Dim DieDatei as String DieDatei = ConvertPath ( sFileName ) + + if(VERBOSE) then + printlog "Filename : " + sFileName + if(NOT isMissing(sPassword)) then + printlog "Password : " + sPassword + endif + endif + '/// open the File Open dialog printlog "open the File Open dialog" FileOpen sleep (1) Kontext "OeffnenDlg" - '/// open the given file - printlog "open the given file: " + sFileName + '/// open the given file Dateiname.SetText DieDatei sleep (3) Oeffnen.Click @@ -195,7 +205,7 @@ function fOpenDataBase ( sFileName , optional sPassword) printlog "set password : " + sPassword Kontext "LoginDialog" if LoginDialog.Exists then - Password.setText sPassword + LoginPassword.setText sPassword LoginDialog.OK sleep(1) endif @@ -270,7 +280,7 @@ sub sCloseAllToolbars end sub '------------------------------------------------------------------------- -function tools_dbtools_fgetMySQLJDBCDatabaseProperties() +function tools_dbtools_fgetMySQLJDBCDatabaseProperties(sDBConfigFileName as string) '/// return the databaseserver properties from the environment directory '/// <u>parameter:</u> '/// <br> @@ -281,21 +291,10 @@ function tools_dbtools_fgetMySQLJDBCDatabaseProperties() '/// entry 3 database name '/// entry 4 database port '/// entry 5 database user name - '/// entry 6 database user password + '/// entry 6 database user password + '/// entry 7 jdbc driver file path - dim i as integer - dim b(10000) as String - dim c - c = hGetDataFileSection( gTesttoolPath + gPrivateEnvironmentLocation + "input/base.txt", b(), "mysql_jdbc" , "" , "" ) - - ' split the string at = and return the right part - for i = 1 to 6 - 'printlog b(i) - b(i) = Right(b(i),len(b(i))-Instr(b(i),"=")) - 'printlog b(i) - next - - tools_dbtools_fgetMySQLJDBCDatabaseProperties = b() + tools_dbtools_fgetMySQLJDBCDatabaseProperties = fgetGenericDatabaseProperties( sDBConfigFileName, "mysql_jdbc" ) end function '------------------------------------------------------------------------- @@ -353,3 +352,28 @@ function tools_dbtools_fgetAdabasDatabaseProperties() tools_dbtools_fgetAdabasDatabaseProperties = b() end function +'------------------------------------------------------------------------------- +function fgetGenericDatabaseProperties(sDBConfigFileName as string, sType as String) + + dim i as integer + dim b(10000) as String + dim c + c = hGetDataFileSection( sDBConfigFileName, b(), sType , "" , "" ) + + ' split the string at = and return the right part + for i = 1 to 7 + if(VERBOSE) then + printlog "orig. string : " + b(i) + endif + b(i) = Right(b(i),len(b(i))-Instr(b(i),"=")) + if(VERBOSE) then + printlog "string after the '=' : " + b(i) + endif + next + + + + + fgetGenericDatabaseProperties = b() + +end function
\ No newline at end of file |