'encoding UTF-8 Do not remove or change this line! '************************************************************************* '* '* OpenOffice.org - a multi-platform office productivity suite '* '* $RCSfile: b_upd_DatabaseTypes.inc,v $ '* '* $Revision: 1.29 $ '* '* last change: $Author: msc $ $Date: 2006/09/25 12:48:02 $ '* '* The Contents of this file are made available subject to '* the terms of GNU Lesser General Public License Version 2.1. '* '* '* GNU Lesser General Public License Version 2.1 '* ============================================= '* Copyright 2005 by Sun Microsystems, Inc. '* 901 San Antonio Road, Palo Alto, CA 94303, USA '* '* This library is free software; you can redistribute it and/or '* modify it under the terms of the GNU Lesser General Public '* License version 2.1, as published by the Free Software Foundation. '* '* This library 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 for more details. '* '* You should have received a copy of the GNU Lesser General Public '* License along with this library; if not, write to the Free Software '* Foundation, Inc., 59 Temple Place, Suite 330, Boston, '* MA 02111-1307 USA '* '/************************************************************************ '* '* 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 '* '\*********************************************************************************** sub b_upd_DatabaseTypes printlog "------------------ b_upd_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 'Database types Adabas, Mozilla, LDAP, and Evolution do not exist for Mac OS X version end sub '------------------------------------------------------------------------- '------------------------------------------------------------------------- testcase tMySQLODBCProperties call fOpenDatabase (gOfficePath + ConvertPath("user\database\biblio.odb")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("MySQLODBC")) 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")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("MySQLJDBC")) 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") ' Advanced Context Menu does not exist for 2.1 call fCloseDatabase() endcase '------------------------------------------------------------------------- testcase tAdabasProperties if gPlatform = "x86" then printlog "Adabas is not available under x86." goto endsub end if call fOpenDatabase (gOfficePath + ConvertPath("user\database\biblio.odb")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) sleep(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("AdabasD")) 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")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("OracleJDBC") 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")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("JDBC") Kontext "ConnectionType" NextBtn.Click sleep(1) call fCheckConnectionTabPage("JDBC") Kontext "ConnectionType" ConnectionType.Cancel call fCloseDatabase() endcase '------------------------------------------------------------------------- testcase tLDAPProperties call fOpenDatabase (gOfficePath + ConvertPath("user\database\biblio.odb")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("LDAP") + 1 ) ' +1 because for mysql there are 2 entries 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")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("Evolution")) Kontext "ConnectionType" ConnectionType.OK 'call fCheckAdvancedDialog("Evolution") call fCloseDatabase() endcase '------------------------------------------------------------------------- testcase tMozillaProperties call fOpenDatabase (gOfficePath + ConvertPath("user\database\biblio.odb")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("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")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("Spreadsheet")) Kontext "ConnectionType" NextBtn.Click sleep(1) call fCheckConnectionTabPage("Spreadsheet") Kontext "ConnectionType" ConnectionType.OK 'call fCheckAdvancedDialog("Spreadsheet") call fCloseDatabase() endcase '------------------------------------------------------------------------- testcase tTextProperties call fOpenDatabase (gOfficePath + ConvertPath("user\database\biblio.odb")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("Text")) 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")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("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")) Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(2) Kontext "TabGeneral" call DialogTest(TabGeneral) DataBaseType.select(getIdForDatabaseType("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 '------------------------------------------------------------------------- '------------------------------------------------------------------------- '------------------------------------------------------------------------- '------------------------------------------------------------------------- '------------------------------------------------------------------------- function fCheckAdvancedDialog(sType as string) printlog "+Check the Advanced Settings for the datasource type " + sType Kontext "Insight" Insight.UseMenu hMenuSelectNr(2) hMenuSelectNr(15) hMenuSelectNr(3) Kontext "Advanced" if sType = "OracleJDBC" OR sType = "JDBC" OR sType = "ODBC" then TabControl.setPage TabPage4 call fcheckControl(SQL92Check) call fcheckControl(AppendAlias) call fcheckControl(Ignoreprivileges) call fcheckControl(ParameterSubstiti) call fcheckControl(DisplayVersionColumns) call fcheckControl(BooleanComparison) call fcheckControl(EnableOuterJoin) 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) elseif sType = "dBase" OR sType = "Text" then call fcheckControl(SQL92Check) 'call fcheckControl(BooleanComparison) 'call fcheckControl(AppendAlias) elseif sType = "Spreadsheet" 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) 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 = "Spreadsheet" 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