1 'encoding UTF-8 Do not remove or change this line!
\r
2 '**************************************************************************
\r
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
\r
5 '* Copyright 2008 by Sun Microsystems, Inc.
\r
7 '* OpenOffice.org - a multi-platform office productivity suite
\r
9 '* $RCSfile: db_Mozilla.inc,v $
\r
13 '* last change: $Author: jsi $ $Date: 2008-06-16 07:43:41 $
\r
15 '* This file is part of OpenOffice.org.
\r
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
\r
18 '* it under the terms of the GNU Lesser General Public License version 3
\r
19 '* only, as published by the Free Software Foundation.
\r
21 '* OpenOffice.org is distributed in the hope that it will be useful,
\r
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
24 '* GNU Lesser General Public License version 3 for more details
\r
25 '* (a copy is included in the LICENSE file that accompanied this code).
\r
27 '* You should have received a copy of the GNU Lesser General Public License
\r
28 '* version 3 along with OpenOffice.org. If not, see
\r
29 '* <http://www.openoffice.org/license.html>
\r
30 '* for a copy of the LGPLv3 License.
\r
32 '/************************************************************************
\r
34 '* owner : marc.neumann@sun.com
\r
36 '* short description : Address book mozilla
\r
38 '\***********************************************************************
\r
41 ' Information for this test under
\r
42 ' http://wiki.services.openoffice.org/wiki/Database_Automatic_Testing#Testing_the_mozilla_Address_book
\r
44 if fCreateMozillaAddressbookDatasource(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb")) then
\r
46 tQueryAddressbook(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb"))
\r
47 tSortAddressbook(gOfficePath + ConvertPath("user/work/TT_Mozilla.odb"))
\r
49 tQueryAddressbook("")
\r
50 tSortAddressbook("")
\r
54 '-------------------------------------------------------------------------
\r
55 testcase tQueryAddressbook( sFileName )
\r
57 if ( not fOpenDatabase(sFileName) ) then
\r
58 warnlog "Database can't be open"
\r
59 printlog "May be you find a solution under http://wiki.services.openoffice.org/wiki/Database_Automatic_Testing#Testing_the_mozilla_Address_book"
\r
65 Kontext "AddTables"
\r
67 '/// Add database table to Query.
\r
70 if AddTables.exists(2) then
\r
71 CloseDlg.Click ' When the AddTables dialog still exists then close him
\r
74 Kontext "QueryDesignCriterion"
\r
78 '/// Executing query
\r
79 printlog "- Executing query"
\r
83 if NOT DataWindow.Exists(3) then
\r
84 warnlog "Execution of a query failed!"
\r
87 call fCloseQueryDesign()
\r
89 call fCloseDatabase()
\r
92 '-------------------------------------------------------------------------
\r
93 testcase tSortAddressbook( sFileName )
\r
95 Dim sRecordCount as String
\r
97 '/// open the database file created in the bas file
\r
98 printlog "open the database file created in the bas file"
\r
100 if ( not fOpenDatabase(sFileName) ) then
\r
101 warnlog "Database can't be open"
\r
105 '/// open the first table
\r
106 printlog "open the first table"
\r
107 Kontext "ContainerView"
\r
109 TableTree.select(1)
\r
110 OpenTable ' uno-Slot .uno:DB/Open
\r
114 '/// count the records in the table
\r
115 printlog "count the records in the table"
\r
116 Kontext "TableView"
\r
118 sRecordCount = AllRecords.caption()
\r
120 '/// sort the table
\r
121 printlog "sort the table"
\r
123 SortAscending.Click
\r
126 '/// count the table again and check if there are the same count of records then before sorting
\r
127 printlog "count the table again and check if there are the same count of records then before sorting"
\r
128 Kontext "TableView"
\r
130 if (sRecordCount <> AllRecords.caption() ) then
\r
131 warnlog "issue i61611 occur. The records are double after sorting."
\r
134 '/// close the table
\r
135 printlog "close the table"
\r
136 call fCloseTableView()
\r
138 '/// close the database
\r
139 printlog "close the database"
\r
140 call fCloseDatabase()
\r