summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2011-03-21 17:02:20 +0100
committerVladimir Glazunov <vg@openoffice.org>2011-03-21 17:02:20 +0100
commit94371f0f5d3ddb14b6c29599c34fcab46b59c4e6 (patch)
tree1796e287945d36d195263b43e8d9b1a3ce1b380a
parent5d7f1bb1e74ae49ae7215588d836bd1ca2004b10 (diff)
parent7c765b91c9194aea22b244f6fad6af4cc1531b24 (diff)
CWS-TOOLING: integrate CWS dba34c
Notes
split repo tag: testing_ooo/DEV300_m104
-rw-r--r--testautomation/dbaccess/optional/dba_db_MySQLnative.bas54
-rw-r--r--testautomation/dbaccess/optional/includes/db_MySQLnative.inc206
-rw-r--r--testautomation/dbaccess/optional/includes/db_Query.inc1
-rw-r--r--testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc41
-rw-r--r--testautomation/dbaccess/tools/dbcreatetools.inc98
-rw-r--r--testautomation/dbaccess/tools/dbtools.inc17
-rw-r--r--testautomation/dbaccess/tools/tabletools.inc4
-rwxr-xr-xtestautomation/global/win/edia_d_h.win1
8 files changed, 400 insertions, 22 deletions
diff --git a/testautomation/dbaccess/optional/dba_db_MySQLnative.bas b/testautomation/dbaccess/optional/dba_db_MySQLnative.bas
new file mode 100644
index 000000000000..adb2e7987032
--- /dev/null
+++ b/testautomation/dbaccess/optional/dba_db_MySQLnative.bas
@@ -0,0 +1,54 @@
+'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/************************************************************************
+'*
+'* owner : marc.neumann@oracle.com
+'*
+'* short description : MySQL Native Connector Extension Test
+'*
+'\***********************************************************************
+sub main
+ printlog "--------------------------------------------------------------"
+ printlog "--- D B A C C E S S Mysql Native Connector ---"
+ printlog "--------------------------------------------------------------"
+
+ use "dbaccess/optional/includes/db_MySQLnative.inc"
+ use "dbaccess/optional/includes/db_Relations.inc"
+
+ call hStatusIn ("dbaccess" , "dba_db_MySQLnative.bas")
+
+ call db_MySQLnative
+
+ call hStatusOut
+
+end sub
+
+sub LoadIncludeFiles
+ use "dbaccess/tools/dbinit.inc"
+ Call sDBInit
+ Call GetUseFiles
+ gApplication = "WRITER"
+end sub
diff --git a/testautomation/dbaccess/optional/includes/db_MySQLnative.inc b/testautomation/dbaccess/optional/includes/db_MySQLnative.inc
new file mode 100644
index 000000000000..de80287bec27
--- /dev/null
+++ b/testautomation/dbaccess/optional/includes/db_MySQLnative.inc
@@ -0,0 +1,206 @@
+'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/************************************************************************
+'*
+'* owner : marc.neumann@oracle.com
+'*
+'* short description : Create JDBC MySQL DS & Table & fill in Test
+'*
+'\***********************************************************************
+testcase db_MySQLnative
+
+ ' **************************************************
+ ' databases specific settings for JDBC MySQL
+ ' **************************************************
+
+ 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_MYSQLnative.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 aFieldTypeContent(30,2) as string 'database specific data matrix
+
+ aFieldTypeContent(1,1)="tt_bool"
+ aFieldTypeContent(1,2)="bool"
+
+ aFieldTypeContent(2,1)="tt_tinyint"
+ aFieldTypeContent(2,2)="tinyint"
+
+ aFieldTypeContent(3,1)="tt_bigint"
+ aFieldTypeContent(3,2)="bigint"
+
+ aFieldTypeContent(4,1)="tt_long_varbinary"
+ aFieldTypeContent(4,2)="long varbinary"
+
+ aFieldTypeContent(5,1)="tt_mediumblob"
+ aFieldTypeContent(5,2)="mediumblob"
+
+ aFieldTypeContent(6,1)="tt_longblob"
+ aFieldTypeContent(6,2)="longblob"
+
+ aFieldTypeContent(7,1)="tt_blob"
+ aFieldTypeContent(7,2)="blob"
+
+ aFieldTypeContent(8,1)="tt_tinyblob"
+ aFieldTypeContent(8,2)="tinyblob"
+
+ aFieldTypeContent(9,1)="tt_varbinary"
+ aFieldTypeContent(9,2)="varbinary"
+
+ aFieldTypeContent(10,1)="tt_binary"
+ aFieldTypeContent(10,2)="binary"
+
+ aFieldTypeContent(11,1)="tt_longvarchar"
+ aFieldTypeContent(11,2)="long varchar"
+
+ aFieldTypeContent(12,1)="tt_mediumtext"
+ aFieldTypeContent(12,2)="mediumtext"
+
+ aFieldTypeContent(13,1)="tt_longtext"
+ aFieldTypeContent(13,2)="longtext"
+
+ aFieldTypeContent(14,1)="tt_text"
+ aFieldTypeContent(14,2)="text"
+
+ aFieldTypeContent(15,1)="tt_tinytext"
+ aFieldTypeContent(15,2)="tinytext"
+
+ aFieldTypeContent(16,1)="tt_char"
+ aFieldTypeContent(16,2)="char"
+
+ aFieldTypeContent(17,1)="tt_numeric"
+ aFieldTypeContent(17,2)="numeric"
+
+ aFieldTypeContent(18,1)="tt_decimal"
+ aFieldTypeContent(18,2)="decimal"
+
+ aFieldTypeContent(19,1)="tt_integer"
+ aFieldTypeContent(19,2)="integer"
+
+ aFieldTypeContent(20,1)="tt_int"
+ aFieldTypeContent(20,2)="int"
+
+ aFieldTypeContent(21,1)="tt_mediumint"
+ aFieldTypeContent(21,2)="mediumint"
+
+ aFieldTypeContent(22,1)="tt_smallint"
+ aFieldTypeContent(22,2)="smallint"
+
+ aFieldTypeContent(23,1)="tt_float"
+ aFieldTypeContent(23,2)="float"
+
+ aFieldTypeContent(24,1)="tt_varchar"
+ aFieldTypeContent(24,2)="varchar"
+
+ aFieldTypeContent(25,1)="tt_date"
+ aFieldTypeContent(25,2)="date"
+
+ aFieldTypeContent(26,1)="tt_time"
+ aFieldTypeContent(26,2)="time"
+
+ aFieldTypeContent(27,1)="tt_datetime"
+ aFieldTypeContent(27,2)="datetime"
+
+ aFieldTypeContent(28,1)="tt_timestamp"
+ aFieldTypeContent(28,2)="timestamp"
+
+ aFieldTypeContent(29,1)="tt_bit"
+ aFieldTypeContent(29,2)="bit"
+
+
+
+ Dim aFieldContent(1,6) as string 'database specific data matrix
+
+ aFieldContent(1,1)="1"
+ aFieldContent(1,2)="<space>"
+ aFieldContent(1,3)="1"
+ aFieldContent(1,4)="1"
+ aFieldContent(1,5)="1"
+ aFieldContent(1,6)="1"
+
+ dim aDatabaseProperties(7) as string
+ aDatabaseProperties() = tools_dbtools_fgetMySQLnativeDatabaseProperties(sDBConfigFile)
+
+ 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_native_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/db_Query.inc"
+ call db_Query(sFileName,"MYSQL_JDBC",aDatabaseProperties(6))
+
+ 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/db_Query.inc b/testautomation/dbaccess/optional/includes/db_Query.inc
index b9d88142698f..798bc55b2118 100644
--- a/testautomation/dbaccess/optional/includes/db_Query.inc
+++ b/testautomation/dbaccess/optional/includes/db_Query.inc
@@ -47,6 +47,7 @@ function db_Query( sFileName , optional sType , optional sPassword)
case "HSQLDB"
sType = "2"
case "MYSQL_JDBC"
+ case "MYSQL_NATIVE"
sType = "3"
case else
sType = "1"
diff --git a/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc b/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc
index 67010e64fbfb..8743feae997b 100644
--- a/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc
+++ b/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc
@@ -38,8 +38,8 @@ end sub
'-------------------------------------------------------------------------
testcase tNewReport
- qaerrorlog "#i92543# crash when closing report"
- goto endsub
+ ' qaerrorlog "#i92543# crash when closing report"
+ ' goto endsub
call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
@@ -85,34 +85,33 @@ testcase tNewReport
FinishBtn.Click
sleep(10)
- Kontext "DocumentWriter"
+ Kontext "DocumentWriter"
DocumentWriter.TypeKeys "<MOD1 SHIFT I>" , true ' EDIT / SELECT TEXT
- DocumentWriter.TypeKeys "<DOWN>" ,2, true
- DocumentWriter.TypeKeys "<SHIFT DOWN>" , true
+ DocumentWriter.TypeKeys "<DOWN>" , true
+ DocumentWriter.TypeKeys "<SHIFT END>" , true
DocumentWriter.TypeKeys "<MOD1 C>" , true
- dim s as String
- s = getClipboard
+ dim s as String
+ s = getClipboard
- if left(s,10) = "Identifier" then
- printlog "Report Table Header contains " + left(s,10) + ". -> OK"
+ if s = "Identifier" then
+ printlog "Report Table Header contains " + s + ". -> OK"
else
- warnlog "Report Table Header contains " + left(s,10) + " instead of IDENTIFIER"
+ warnlog "Report Table Header contains " + s + " instead of IDENTIFIER"
endif
- 'for windows a "new Line" are two characters
- 'so I need to start at char 13 and not on 12
- dim iFromCharacter as integer
- if gPlatGroup = "w95" then
- iFromCharacter = 13
- else
- iFromCharacter = 12
- endif
+ ' select next line and check content
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<DOWN>" , true
+ DocumentWriter.TypeKeys "<SHIFT HOME>" , true
+ DocumentWriter.TypeKeys "<MOD1 C>" , true
+
+ s = getClipboard
- if mid(s,iFromCharacter,5) = "GUR00" OR mid(s,iFromCharacter,5) = "BOR04" then
- printlog "1. record is " + mid(s,iFromCharacter,5) + ". -> OK"
+ if s = "GUR00" OR s = "BOR04" then
+ printlog "1. record is " + s + ". -> OK"
else
- warnlog "1. record is " + mid(s,iFromCharacter,5) + " instead of GUR00 OR BOR04"
+ warnlog "1. record is " + s + " instead of GUR00 OR BOR04"
endif
call fCloseForm ' should be changed to a CloseReport
diff --git a/testautomation/dbaccess/tools/dbcreatetools.inc b/testautomation/dbaccess/tools/dbcreatetools.inc
index 034b1d18fef1..222ec470ca89 100644
--- a/testautomation/dbaccess/tools/dbcreatetools.inc
+++ b/testautomation/dbaccess/tools/dbcreatetools.inc
@@ -238,6 +238,104 @@ function fCreateMySQL_JDBC_Datasource(sFileName,sDatabaseName,sHost,sPort,sUser,
end function
'-------------------------------------------------------------------------
+function fCreateMySQL_native_Datasource(sFileName,sDatabaseName,sHost,sPort,sUser,optional sRegister) as boolean
+ '/// create a new MySQL database via JDBC file with the given filename
+ '///+ and the given URL
+ '/// <u>parameter:</u>
+ '/// <b>sFielName:</b> the file name for the database file
+ '/// <b>sDatabaseName:</b> the name of the mysql database
+ '/// <b>sHost:</b> the host where the mysql database is running
+ '/// <b>sPort:</b> the port where the mysql database is running
+ '/// <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
+
+ dim sEntry as string
+
+ ' delete the file
+ if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then
+ app.kill(ConvertPath(sFileName))
+ endif
+
+ Kontext "DocumentWriter"
+ if (DocumentWriter.exists(1)) then
+ DocumentWriter.UseMenu
+ else
+ Kontext "DocumentBackground"
+ DocumentBackground.UseMenu
+ endif
+ hMenuSelectNr(1)
+ hMenuSelectNr(1)
+ hMenuSelectNr(5)
+
+ sleep(4)
+
+ Kontext "DatabaseWizard"
+ ConnectToDatabase.Check
+ sleep(1)
+ sEntry = hGetDatabaseDisplayName( "sdbc:mysqlc:*" )
+ 'cut off the (JDBC) string
+ sEntry = Left( sEntry , Instr(sEntry,"(") - 2 )
+ printlog "entry = " + sEntry
+ DatabaseType.select( sEntry )
+ sleep(1)
+ NextBtn.Click
+ sleep(1)
+ MySQLnative.Check
+ NextBtn.Click
+ sleep(1)
+ DatabaseWizard.typeKeys("<TAB>",true)
+ DatabaseWizard.typeKeys(sDatabaseName,true)
+ DatabaseWizard.typeKeys("<TAB>",true)
+ DatabaseWizard.typeKeys("<TAB>",true)
+ DatabaseWizard.typeKeys(sHost,true)
+ 'MySQLDatabaseName.setText(sDatabaseName)
+ 'MySQLHostName.setText(sHost)
+ 'MySQLPort.setText(sPort)
+
+ NextBtn.Click
+ sleep(1)
+
+ '/// add the user name
+ printlog "add the user name"
+ UserName.setText sUser
+
+ '/// check the password required checkbox
+ printlog "check the password required checkbox"
+ PasswordRequired.Check
+
+ NextBtn.Click
+ FinishBtn.Click
+
+ Kontext "SpeichernDlg"
+ Dateiname.setText ConvertPath(sFileName)
+ Speichern.click
+
+ sleep(5)
+
+ if ( IsMissing(sRegister) ) then
+ printlog "don't register datasource"
+ else
+ printlog "register datasource with name " + sRegister
+ call fRegisterDatabaseFile(ConvertPath(sFilename),sRegister)
+ end if
+
+ bOK = true
+ if bOK = true then
+ printlog "--- End of function - *** Succeed ***"
+ else
+ warnlog "--- End of function - *** Failed *** Data source was not created"
+ endif
+
+ fCreateMySQL_native_Datasource = bOK
+
+ sleep(1)
+
+ call fCloseDatabase(true)
+
+end function
+'-------------------------------------------------------------------------
function fCreateAdabasDatasource(sFileName,sURL,sUser, optional sRegister) as boolean
'/// create a new adabas database file with the given filename
'///+ and the given URL
diff --git a/testautomation/dbaccess/tools/dbtools.inc b/testautomation/dbaccess/tools/dbtools.inc
index 2e40a3f25726..f36438b46318 100644
--- a/testautomation/dbaccess/tools/dbtools.inc
+++ b/testautomation/dbaccess/tools/dbtools.inc
@@ -319,6 +319,23 @@ function tools_dbtools_fgetMySQLODBCDatabaseProperties()
end function
'-------------------------------------------------------------------------
+function tools_dbtools_fgetMySQLnativeDatabaseProperties(sDBConfigFileName as string)
+ '/// return the databaseserver properties from the environment directory
+ '/// <u>parameter:</u>
+ '/// <br>
+ '/// <u>return:</u>
+ '/// the properties as an array
+ '/// entry 1 defined (yes or no)
+ '/// entry 2 server name
+ '/// entry 3 database name
+ '/// entry 4 database port
+ '/// entry 5 database user name
+ '/// entry 6 database user password
+
+ tools_dbtools_fgetMySQLnativeDatabaseProperties = fgetGenericDatabaseProperties( sDBConfigFileName, "mysql_native" )
+
+end function
+'-------------------------------------------------------------------------
function tools_dbtools_fgetAdabasDatabaseProperties()
'/// return the databaseserver properties from the environment directory
'/// <u>parameter:</u>
diff --git a/testautomation/dbaccess/tools/tabletools.inc b/testautomation/dbaccess/tools/tabletools.inc
index 461ef8ff2da3..132671e3bfe9 100644
--- a/testautomation/dbaccess/tools/tabletools.inc
+++ b/testautomation/dbaccess/tools/tabletools.inc
@@ -340,7 +340,9 @@ function fCreateTable(aFieldTypeContent(),sTableName,optional sCatalog,optional
sleep 1
FieldType.TypeKeys "<RETURN>" , TRUE
Description.TypeKeys "<RETURN>" , TRUE
- CellDescription.TypeKeys "<RETURN>" , TRUE
+ if( CellDescription.isVisible() ) then
+ CellDescription.TypeKeys "<RETURN>" , TRUE
+ endif
printlog "-------------------------------"
next
sleep(1)
diff --git a/testautomation/global/win/edia_d_h.win b/testautomation/global/win/edia_d_h.win
index 0448fccc9f02..ab411b541d26 100755
--- a/testautomation/global/win/edia_d_h.win
+++ b/testautomation/global/win/edia_d_h.win
@@ -47,6 +47,7 @@ UserName sym:DBACCESS_HID_PAGE_DBWIZARD_AUTHENTIFICATION_ET_GENERALUS
AdabasBrowse sym:DBACCESS_HID_PAGE_DBWIZARD_ADABAS_PB_ADABASNAME
MySQLODBC sym:DBACCESS_HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAODBC
MySQLJDBC sym:DBACCESS_HID_PAGE_DBWIZARD_MYSQL_RB_CONNECTVIAJDBC
+MySQLnative sym:dbaccess:RadioButton:PAGE_DBWIZARD_MYSQL_INTRO:RB_CONNECTVIANATIVE
MySQLDatabaseName sym:DBACCESS_HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME
MySQLODBCDSName sym:DBACCESS_HID_PAGE_DBWIZARD_ODBC_ET_NAMEOFODBCDATASOURCE
MySQLHostName sym:DBACCESS_HID_PAGE_DBWIZARD_JDBC_ET_MYSQLHOSTSERVER