diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-03-23 11:58:14 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-03-23 11:58:14 +0100 |
commit | 8859d9f6d81f276b97f5c3c5b7f59d7bb8af859a (patch) | |
tree | bd0704d65ad9c5d9fc6ade5b565e6c187c0ba9e8 /testautomation/dbaccess | |
parent | 773a40f8495978fb07e20c4e657b41131819229c (diff) | |
parent | 6cfc5620c18a2cef95368d6d1437281abdb67b69 (diff) |
CWS-TOOLING: integrate CWS autorecovery
Diffstat (limited to 'testautomation/dbaccess')
-rwxr-xr-x[-rw-r--r--] | testautomation/dbaccess/optional/includes/ctrl_General.inc | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/dbaccess/optional/includes/ctrl_Wizards.inc | 23 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc | 122 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/dbaccess/optional/includes/frm_FormFilter.inc | 18 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/dbaccess/optional/includes/misc_Macros.inc | 12 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc | 71 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/dbaccess/required/includes/DatabaseTypes.inc | 23 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/dbaccess/tools/dbcreatetools.inc | 66 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/dbaccess/tools/dbtools.inc | 68 |
9 files changed, 287 insertions, 118 deletions
diff --git a/testautomation/dbaccess/optional/includes/ctrl_General.inc b/testautomation/dbaccess/optional/includes/ctrl_General.inc index 647390c5845c..00c1b17e4c4b 100644..100755 --- a/testautomation/dbaccess/optional/includes/ctrl_General.inc +++ b/testautomation/dbaccess/optional/includes/ctrl_General.inc @@ -1025,7 +1025,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/ctrl_Wizards.inc b/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc index 80fc0ff8d08b..7c48e78e149d 100644..100755 --- a/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc +++ b/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc @@ -96,7 +96,7 @@ testcase tGroupBoxWithDatasource printlog "insert password 'testtool' into login dialog" Kontext "LoginDialog" if LoginDialog.Exists then - Password.setText "testtool" + LoginPassword.setText "testtool" LoginDialog.OK sleep(1) else @@ -104,7 +104,7 @@ testcase tGroupBoxWithDatasource endif Kontext "LoginDialog" if LoginDialog.Exists then - Password.setText "testtool" + LoginPassword.setText "testtool" LoginDialog.OK sleep(1) else @@ -112,9 +112,10 @@ testcase tGroupBoxWithDatasource endif Kontext "TabDataForm" '/// set the table TT_Control - printlog "set the table TT_Control" - Content.setText("TT_Control") - Content.TypeKeys "<RETURN>" , true + printlog "set the table TT_Control" + Content.setText("TT_Control") + Content.TypeKeys "<RETURN>" , true + sleep(1) Kontext "ControlPropertiesDialog" ControlPropertiesDialog.Close sleep(3) @@ -587,12 +588,12 @@ testcase tListBox Kontext "TabListBoxData" '/// choose database TT & click next DataSource.Select(sDSName) - Kontext "LoginDialog" + Kontext "LoginDialog" if LoginDialog.Exists(3) then - printlog "login dialog" - Password.SetText "testtool" - LoginDialog.OK - sleep 1 + printlog "login dialog" + LoginPassword.SetText "testtool" + LoginDialog.OK + sleep 1 end if '/// choose table TPCoA-1 & click next Kontext "TabListBoxData" @@ -814,7 +815,7 @@ testcase tTableControl Kontext "LoginDialog" if LoginDialog.Exists(3) then printlog "login dialog" - Password.SetText "testtool" + LoginPassword.SetText "testtool" LoginDialog.OK sleep (1) end if diff --git a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc index 1c3766b4e200..bf2b9892d118 100644..100755 --- a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc +++ b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc @@ -36,27 +36,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" @@ -156,39 +173,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 43a52dba3ed2..7a73842c62eb 100644..100755 --- a/testautomation/dbaccess/optional/includes/frm_FormFilter.inc +++ b/testautomation/dbaccess/optional/includes/frm_FormFilter.inc @@ -66,7 +66,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 @@ -99,7 +99,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 @@ -141,11 +141,7 @@ testcase tFF_Navigator printlog "activate the form based filter" FM_FormFilter_Start wait(1000) - '/// open the FormFilterNavigator - printlog "open the FormFilterNavigator" - FM_FF_Navigator - wait(1000) - Kontext "DocumentWriter" + Kontext "DocumentWriter" '/// press CTRL + F5 to get into the first textbox printlog "press CTRL + F5 to get into the first textbox" DocumentWriter.TypeKeys "<MOD1 F5>" , true @@ -161,7 +157,13 @@ testcase tFF_Navigator DocumentWriter.TypeKeys "like '%value%'" , true DocumentWriter.TypeKeys "<RETURN>" , true wait(1000) - Kontext "FilterNavigator" + Kontext "FilterNavigator" + '/// open the FormFilterNavigator + printlog "open the FormFilterNavigator" + if( NOT FilterNavigator.exists(3)) then + FM_FF_Navigator + endif + wait(1000) '/// check if the filter criterion is insert in the form filter navigator printlog "check if the filter criterion is insert in the form filter navigator" FilterNavigator.TypeKeys "<END>" diff --git a/testautomation/dbaccess/optional/includes/misc_Macros.inc b/testautomation/dbaccess/optional/includes/misc_Macros.inc index bfe849d00ba9..dc14c715c305 100644..100755 --- a/testautomation/dbaccess/optional/includes/misc_Macros.inc +++ b/testautomation/dbaccess/optional/includes/misc_Macros.inc @@ -33,7 +33,7 @@ sub misc_Macros - printlog "------------------- misc_Macros.inc ------------------------" + printlog "------------------- misc_Macros.inc ------------------------" call tMacros @@ -80,11 +80,11 @@ testcase tMacros endif NextButton.click + + BackupLocation.settext sFileName + "backup.odb" - DatabaseFile.settext sFileName + "backup.odb" - - NextButton.click - sleep(20) + NextButton.click + sleep(20) MacroMigration.OK call fCloseDatabase @@ -105,7 +105,7 @@ testcase tMacros if (MessageBox.exists(1)) then warnlog "MessageBox about macros appear. Should not after migration." else - 'nothing + 'nothing endif call fCloseDatabase diff --git a/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc b/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc index 09063abbff28..eb8dd4a15c35 100644..100755 --- a/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc +++ b/testautomation/dbaccess/optional/includes/wiz_DatabaseWizard.inc @@ -34,6 +34,7 @@ sub wiz_DatabaseWizard call tNewDatabase call tOpenDatabase call tOpenNoneDatabaseDocument + call tStartTableWizardFromWizard call tODBC call tEvolution call tMozilla @@ -306,3 +307,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 f16e0794d36b..02c8d29b63c7 100644..100755 --- a/testautomation/dbaccess/required/includes/DatabaseTypes.inc +++ b/testautomation/dbaccess/required/includes/DatabaseTypes.inc @@ -318,7 +318,7 @@ testcase tEvolutionProperties Kontext "TabGeneral" call DialogTest(TabGeneral) try - if ( DatabaseType.getItemCount() > 12 ) then + if ( isDriverInstalled("sdbc:address:evolution:ldap")) then DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:evolution:ldap")) Kontext "ConnectionType" ConnectionType.OK @@ -359,13 +359,26 @@ testcase tMozillaProperties Kontext "TabGeneral" call DialogTest(TabGeneral) - DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:mozilla:")) + 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) - - Kontext "ConnectionType" - ConnectionType.OK 'call fCheckAdvancedDialog("Mozilla") diff --git a/testautomation/dbaccess/tools/dbcreatetools.inc b/testautomation/dbaccess/tools/dbcreatetools.inc index ff45ad2ead8b..159f27cc249f 100644..100755 --- a/testautomation/dbaccess/tools/dbcreatetools.inc +++ b/testautomation/dbaccess/tools/dbcreatetools.inc @@ -52,6 +52,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 @@ -153,7 +156,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 @@ -175,8 +180,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) @@ -197,8 +206,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" @@ -1454,13 +1463,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 @@ -1474,7 +1482,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" @@ -1493,11 +1501,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 @@ -1505,11 +1513,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 @@ -1551,7 +1560,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" @@ -1585,4 +1594,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 2b3ee4355721..dd884d2cab1c 100644..100755 --- a/testautomation/dbaccess/tools/dbtools.inc +++ b/testautomation/dbaccess/tools/dbtools.inc @@ -40,6 +40,9 @@ ' #1 tools_dbtools_fgetMySQLDatabaseProperties '* '\*********************************************************************************** + +private const VERBOSE = true + '-------------------------------------------------------------------- function fSelectDatasourceInBeamer(sDSName1) '/// select a datasource in the beamer with the given name @@ -90,10 +93,10 @@ function fConnectToDatasourceInBeamer(sDSName , sPWD, optional bNewDoc) DatabaseSelection.TypeKeys "<DOWN>" DatabaseSelection.TypeKeys "<ADD>" Kontext "LoginDialog" - if LoginDialog.Exists(3) then - Password.SetText sPWD - LoginDialog.OK - end if + if LoginDialog.Exists(3) then + LoginPassword.SetText sPWD + LoginDialog.OK + end if bConnect = true else warnlog "Could not found the datasource " + sDSName @@ -163,13 +166,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 @@ -189,7 +199,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 @@ -264,7 +274,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> @@ -275,21 +285,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 '------------------------------------------------------------------------- @@ -347,3 +346,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 |