CWS-TOOLING: integrate CWS dba34b
This commit is contained in:
commit
06601d33f1
10 changed files with 222 additions and 24 deletions
|
@ -75,7 +75,7 @@ public class Assurance
|
|||
* @param actual specifies the actual boolean value
|
||||
*/
|
||||
protected void assureEquals( boolean expected, boolean actual ) {
|
||||
assureEquals( "Equality test failed", new Boolean( expected ), new Boolean( actual ), false );
|
||||
assureEquals( "Equality test failed", expected, new Boolean( actual ), false );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,7 +85,7 @@ public class Assurance
|
|||
* @param actual specifies the actual boolean value
|
||||
*/
|
||||
protected void assureEquals( String message, boolean expected, boolean actual ) {
|
||||
assureEquals( message, new Boolean( expected ), new Boolean( actual ), false );
|
||||
assureEquals( message, expected, actual, false );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -240,6 +240,27 @@ public class Assurance
|
|||
assureEquals( message, expected, actual, false );
|
||||
}
|
||||
|
||||
/**
|
||||
* assures the two given sequences are of equal length, and have equal content
|
||||
*/
|
||||
public <T> void assureEquals( String i_message, T[] i_expected, T[] i_actual, boolean i_continue )
|
||||
{
|
||||
if ( i_expected.length != i_actual.length )
|
||||
failed( i_message + ": expected element count: " + i_expected.length + ", actual element count: " + i_actual.length );
|
||||
for ( int i=0; i<i_expected.length; ++i )
|
||||
{
|
||||
assureEquals( i_message + ": mismatch at element pos " + i, i_expected[i], i_actual[i], i_continue );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* assures the two given sequences are of equal length, and have equal content
|
||||
*/
|
||||
public <T> void assureEquals( String i_message, T[] i_expected, T[] i_actual )
|
||||
{
|
||||
assureEquals( i_message, i_expected, i_actual, false );
|
||||
}
|
||||
|
||||
/** invokes a given method on a given object, and assures a certain exception is caught
|
||||
* @param _message is the message to print when the check fails
|
||||
* @param _object is the object to invoke the method on
|
||||
|
|
47
testautomation/dbaccess/optional/dba_rpt_Charts.bas
Normal file
47
testautomation/dbaccess/optional/dba_rpt_Charts.bas
Normal file
|
@ -0,0 +1,47 @@
|
|||
'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 : Charts in Reports
|
||||
'*
|
||||
'\***********************************************************************
|
||||
|
||||
sub main
|
||||
|
||||
use "dbaccess/optional/includes/rpt_Charts.inc"
|
||||
|
||||
call rpt_Charts
|
||||
|
||||
end sub
|
||||
|
||||
sub LoadIncludeFiles
|
||||
use "dbaccess/tools/dbinit.inc"
|
||||
Call sDBInit
|
||||
Call GetUseFiles
|
||||
gApplication = "WRITER"
|
||||
end sub
|
12
testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc
Executable file → Normal file
12
testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc
Executable file → Normal file
|
@ -192,13 +192,13 @@ testcase db_JDBCMySQL
|
|||
|
||||
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
|
||||
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")
|
||||
use "dbaccess/optional/includes/db_Query.inc"
|
||||
call db_Query(sFileName,"MYSQL_JDBC",aDatabaseProperties(6))
|
||||
|
||||
call tRelation( sFileName, aDatabaseProperties(6), "rel1", "rel2" )
|
||||
|
||||
|
|
48
testautomation/dbaccess/optional/includes/db_Query.inc
Executable file → Normal file
48
testautomation/dbaccess/optional/includes/db_Query.inc
Executable file → Normal file
|
@ -45,7 +45,9 @@ function db_Query( sFileName , optional sType , optional sPassword)
|
|||
case "ODBC", "JDBC"
|
||||
sType = "2"
|
||||
case "HSQLDB"
|
||||
sType = "2"
|
||||
sType = "2"
|
||||
case "MYSQL_JDBC"
|
||||
sType = "3"
|
||||
case else
|
||||
sType = "1"
|
||||
end select
|
||||
|
@ -57,6 +59,10 @@ function db_Query( sFileName , optional sType , optional sPassword)
|
|||
call tQueryJoin( sFileName , sType, sPassword )
|
||||
call tQueriesInQueries(sFileName)
|
||||
endif
|
||||
|
||||
if sType = "3" then 'run only with database type MYSQL_JDBC
|
||||
call tCastQuery( sFileName , sPassword )
|
||||
endif
|
||||
|
||||
call tSortQueryWithAlias(sFileName , sPassword)
|
||||
|
||||
|
@ -825,6 +831,46 @@ sub tTest8
|
|||
sleep(2)
|
||||
end sub
|
||||
'--------------------------------------------------------------------
|
||||
sub tCastQuery( sFileName , sPassword )
|
||||
|
||||
fOpenDatabase(sFileName,sPassword)
|
||||
|
||||
if ( fOpenNewQueryDesign ) then
|
||||
if ( fChooseTableInQueryAddTableDialog("TT_Query3") ) then
|
||||
Kontext "QueryDesignCriterion"
|
||||
sleep(1)
|
||||
QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true
|
||||
sleep(1)
|
||||
QueryDesignCriterion.TypeKeys "cast(f_date_s as date)" , true
|
||||
sleep(1)
|
||||
QueryDesignCriterion.TypeKeys "<RETURN>" , true
|
||||
sleep(1)
|
||||
Kontext "Toolbar"
|
||||
printlog "- Executing query"
|
||||
ExecuteBtn.Click
|
||||
sleep(5)
|
||||
|
||||
Kontext "TableView"
|
||||
if TableView.Exists(3) then
|
||||
|
||||
DataWindow.TypeKeys "<MOD1 C>"
|
||||
if GetClipboard <> "40219" then
|
||||
warnlog "the result should be 40219 but it is " + GetClipboard
|
||||
else
|
||||
printlog "the result is OK"
|
||||
endif
|
||||
else
|
||||
warnlog "Execution of a query failed!"
|
||||
end if
|
||||
|
||||
call fCloseQueryDesign
|
||||
|
||||
endif
|
||||
endif
|
||||
call fCloseDatabase
|
||||
|
||||
end sub
|
||||
'--------------------------------------------------------------------
|
||||
function tSortQueryWithAlias(sFileName, optional sPassword) ' test for isse 27832
|
||||
|
||||
if IsMissing(sPassword) then
|
||||
|
|
94
testautomation/dbaccess/optional/includes/rpt_Charts.inc
Normal file
94
testautomation/dbaccess/optional/includes/rpt_Charts.inc
Normal file
|
@ -0,0 +1,94 @@
|
|||
'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 :
|
||||
'*
|
||||
'* short description :
|
||||
'*
|
||||
'\***********************************************************************
|
||||
|
||||
sub rpt_Charts
|
||||
|
||||
tInsertChart
|
||||
|
||||
end sub
|
||||
'--------------------------------------------------------------------------------------
|
||||
testcase tInsertChart
|
||||
|
||||
printlog "open Bibliography database"
|
||||
call fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb"))
|
||||
|
||||
printlog "open the report designer"
|
||||
call fOpenNewReportDesign
|
||||
|
||||
sleep(1)
|
||||
|
||||
printlog "select the first table in the content list box"
|
||||
Kontext "ReportDataProperties"
|
||||
Content.select 1
|
||||
Content.typeKeys("<RETURN>",true) ' important to leave the listbox
|
||||
|
||||
'close the Add Field dialog to get the focus back to the design
|
||||
call fCloseAddFieldDialog
|
||||
|
||||
printlog "insert a chart"
|
||||
Kontext "StandardBar"
|
||||
CreateChart.Click
|
||||
sleep(1)
|
||||
|
||||
Kontext "ReportDesign"
|
||||
ReportDesign.MouseDown ( 30, 10 )
|
||||
ReportDesign.MouseMove ( 40, 20 )
|
||||
ReportDesign.MouseUp ( 40, 20 )
|
||||
|
||||
sleep(1)
|
||||
|
||||
'/// execute the report
|
||||
printlog "execute the report"
|
||||
call fExecuteReport
|
||||
|
||||
sleep(10)
|
||||
|
||||
'/// check if the report is created
|
||||
printlog "check if the report is created"
|
||||
Kontext "DocumentWriter"
|
||||
if (DocumentWriter.exists(10)) then
|
||||
hFileSaveAsKill(gOfficePath + ConvertPath("user/work/report01.odt"))
|
||||
call fCloseReportView
|
||||
else
|
||||
warnlog "No report is created."
|
||||
endif
|
||||
|
||||
'/// close the report designer
|
||||
printlog "close the report designer"
|
||||
call fCloseReportDesign
|
||||
|
||||
'/// close the database
|
||||
printlog "close the database"
|
||||
call fCloseDatabase
|
||||
|
||||
endcase
|
7
testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc
Executable file → Normal file
7
testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc
Executable file → Normal file
|
@ -40,12 +40,7 @@ end sub
|
|||
'-------------------------------------------------------------------------
|
||||
'-------------------------------------------------------------------------
|
||||
'-------------------------------------------------------------------------
|
||||
testcase tExecute
|
||||
|
||||
if (iSprache = 7) then
|
||||
qaerrorlog "due to issue i94729 this testcase does not work under russian."
|
||||
goto endsub
|
||||
endif
|
||||
testcase tExecute
|
||||
|
||||
'/// open Bibliography database
|
||||
printlog "open Bibliography database"
|
||||
|
|
|
@ -1377,14 +1377,7 @@ function fRegisterDatabaseFile( sFileName, sName)
|
|||
Kontext "CreateDatabaseLink"
|
||||
|
||||
RegisteredName.setText(sName)
|
||||
|
||||
' this does not work due to issue 115468
|
||||
' DatabaseFile.setText(sFileName)
|
||||
' workaround
|
||||
CreatedatabaseLink.typeKeys("<shift tab>")
|
||||
CreatedatabaseLink.typeKeys("<shift tab>")
|
||||
CreatedatabaseLink.typeKeys(sFileName)
|
||||
' -
|
||||
DatabaseFile.setText(sFileName)
|
||||
|
||||
CreateDatabaseLink.OK
|
||||
|
||||
|
|
1
testautomation/dbaccess/tools/tabletools.inc
Executable file → Normal file
1
testautomation/dbaccess/tools/tabletools.inc
Executable file → Normal file
|
@ -340,6 +340,7 @@ function fCreateTable(aFieldTypeContent(),sTableName,optional sCatalog,optional
|
|||
sleep 1
|
||||
FieldType.TypeKeys "<RETURN>" , TRUE
|
||||
Description.TypeKeys "<RETURN>" , TRUE
|
||||
CellDescription.TypeKeys "<RETURN>" , TRUE
|
||||
printlog "-------------------------------"
|
||||
next
|
||||
sleep(1)
|
||||
|
|
2
testautomation/global/win/edia_d_h.win
Normal file → Executable file
2
testautomation/global/win/edia_d_h.win
Normal file → Executable file
|
@ -55,7 +55,7 @@ AdoURL sym:DBACCESS_HID_PAGE_DBWIZARD_ADO_ET_ADOURL
|
|||
StartTableWizard sym:DBACCESS_HID_PAGE_DBWIZARD_FINAL_CB_STARTTABLEWIZARD
|
||||
|
||||
*CreateDatabaseLink sym:cui:ModalDialog:DLG_DOCUMENTLINK
|
||||
DatabaseFile .uno:OpenUrl
|
||||
DatabaseFile sym:cui:ComboBox:DLG_DOCUMENTLINK:CMB_URL
|
||||
Browse sym:cui:PushButton:DLG_DOCUMENTLINK:PB_BROWSEFILE
|
||||
RegisteredName sym:cui:Edit:DLG_DOCUMENTLINK:ET_NAME
|
||||
|
||||
|
|
1
testautomation/global/win/edia_t_z.win
Normal file → Executable file
1
testautomation/global/win/edia_t_z.win
Normal file → Executable file
|
@ -5,6 +5,7 @@ TableWindow sym:DBACCESS_HID_CTL_TABLEEDIT
|
|||
Fieldname sym:DBACCESS_HID_TABDESIGN_NAMECELL
|
||||
FieldType sym:DBACCESS_HID_TABDESIGN_TYPECELL
|
||||
Description sym:DBACCESS_HID_TABDESIGN_HELPTEXT
|
||||
CellDescription sym:DBACCESS_HID_TABDESIGN_COMMENTCELL
|
||||
|
||||
*TablesFilter sym:DBACCESS_HID_DSADMIN_TABLE_SUBSCRIPTION
|
||||
Tables sym:DBACCESS_HID_DSADMIN_TABLE_SELECTOR
|
||||
|
|
Loading…
Reference in a new issue