diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2011-02-01 11:12:15 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2011-02-01 11:12:15 +0100 |
commit | 6e0a09116fea66b9e79e6571c8227331e9206874 (patch) | |
tree | 5d4589e35bafcb1aeed7017bd031ceab038583f4 | |
parent | 48d88baf5a337a67475cb1c5bf7f030829ccb043 (diff) | |
parent | b7f1474f4b2b88f8e447992b94bd9fed6af3b1ef (diff) |
CWS-TOOLING: integrate CWS dba34booo/DEV300_m99
-rw-r--r-- | qadevOOo/runner/complexlib/Assurance.java | 25 | ||||
-rw-r--r-- | testautomation/dbaccess/optional/dba_rpt_Charts.bas | 47 | ||||
-rw-r--r--[-rwxr-xr-x] | testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc | 12 | ||||
-rw-r--r--[-rwxr-xr-x] | testautomation/dbaccess/optional/includes/db_Query.inc | 48 | ||||
-rw-r--r-- | testautomation/dbaccess/optional/includes/rpt_Charts.inc | 94 | ||||
-rw-r--r--[-rwxr-xr-x] | testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc | 7 | ||||
-rw-r--r-- | testautomation/dbaccess/tools/dbcreatetools.inc | 9 | ||||
-rw-r--r--[-rwxr-xr-x] | testautomation/dbaccess/tools/tabletools.inc | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/global/win/edia_d_h.win | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/global/win/edia_t_z.win | 1 |
10 files changed, 222 insertions, 24 deletions
diff --git a/qadevOOo/runner/complexlib/Assurance.java b/qadevOOo/runner/complexlib/Assurance.java index b07c3fb8b..844f70290 100644 --- a/qadevOOo/runner/complexlib/Assurance.java +++ b/qadevOOo/runner/complexlib/Assurance.java @@ -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 diff --git a/testautomation/dbaccess/optional/dba_rpt_Charts.bas b/testautomation/dbaccess/optional/dba_rpt_Charts.bas new file mode 100644 index 000000000..abe7817c7 --- /dev/null +++ b/testautomation/dbaccess/optional/dba_rpt_Charts.bas @@ -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 diff --git a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc index 93f864d7e..cc3be8465 100755..100644 --- a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc +++ b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc @@ -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" ) diff --git a/testautomation/dbaccess/optional/includes/db_Query.inc b/testautomation/dbaccess/optional/includes/db_Query.inc index 46dce6e90..b9d881426 100755..100644 --- a/testautomation/dbaccess/optional/includes/db_Query.inc +++ b/testautomation/dbaccess/optional/includes/db_Query.inc @@ -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 diff --git a/testautomation/dbaccess/optional/includes/rpt_Charts.inc b/testautomation/dbaccess/optional/includes/rpt_Charts.inc new file mode 100644 index 000000000..cb7fc8ab1 --- /dev/null +++ b/testautomation/dbaccess/optional/includes/rpt_Charts.inc @@ -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
\ No newline at end of file diff --git a/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc b/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc index 91270481c..7ba19ac8e 100755..100644 --- a/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc +++ b/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc @@ -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" diff --git a/testautomation/dbaccess/tools/dbcreatetools.inc b/testautomation/dbaccess/tools/dbcreatetools.inc index cc99d8d20..034b1d18f 100644 --- a/testautomation/dbaccess/tools/dbcreatetools.inc +++ b/testautomation/dbaccess/tools/dbcreatetools.inc @@ -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 diff --git a/testautomation/dbaccess/tools/tabletools.inc b/testautomation/dbaccess/tools/tabletools.inc index 99c4abf72..461ef8ff2 100755..100644 --- a/testautomation/dbaccess/tools/tabletools.inc +++ b/testautomation/dbaccess/tools/tabletools.inc @@ -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) diff --git a/testautomation/global/win/edia_d_h.win b/testautomation/global/win/edia_d_h.win index b781c636d..0448fccc9 100644..100755 --- a/testautomation/global/win/edia_d_h.win +++ b/testautomation/global/win/edia_d_h.win @@ -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 diff --git a/testautomation/global/win/edia_t_z.win b/testautomation/global/win/edia_t_z.win index 5acdef310..b235855ce 100644..100755 --- a/testautomation/global/win/edia_t_z.win +++ b/testautomation/global/win/edia_t_z.win @@ -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 |