1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: help_compare_topics.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : joerg.skottke@sun.com
36 '* short description :
38 '\******************************************************************************
40 testcase tCompareHelpTopics()
42 if ( gIsoLang <> "en-US" ) then
43 printlog( "No testing for languages other than en_US" )
48 '///<h1>Compare list of help topics against a reference file</h1>
49 '///<h2>help_compare_topics::tCompareHelpTopics</h2>
52 ' NOTE: As some of the entries might exists twice or multiple times it is quite
53 ' possible that the results are inaccurate. The new implementation of
54 ' gCompare2Lists() (hListCompare() as used here) should be able to
55 ' handle this. If problems occur, this shuld be the first place to
58 const MAX_ENTRIES = 30000
60 ' variables related to filenames
61 dim sFileOut as string
63 dim sfileName as string
65 ' The list that will hold all the entries
66 dim aTopicsFromUI( MAX_ENTRIES ) as string
68 ' some increment operators and temporary variables
69 dim iCurrentItem as integer
70 dim sCurrentItem as string
71 dim iCurrentApp as integer
72 dim iAboutItems as integer
73 dim cAboutItem as string
76 dim bNextItem as boolean
78 ' define input and output paths, presetting variables
79 sFileName = gProductName & "_help_topics_" & gIsoLang & ".txt"
80 sFileOut = hGetWorkFile( sFilename )
81 sFileIn = gTesttoolPath & "framework\optional\input\help_browser\"
82 sFileIn = convertpath( sFileIn & sFileName )
84 aTopicsFromUI( 0 ) = "0"
86 '///+<li>Go to the Index-Page of the Help-Viewer</li>
89 warnlog( "Help not open, aborting test" )
93 hSelectHelpTab( "index" )
95 '///+<li>Find out how many About-Items we have - usually this is 7 = Applications</li>
96 ' NOTE: This testcase will not warn about missing About-Items, this is done
97 ' by the update-test. But you will get an enormous list of missing
99 iAboutItems = HelpAbout.getItemCount()
101 '///+<li>cycle through all applications listed in the About-List</li>
102 for iCurrentApp = 1 to iAboutItems
104 '///+<li>select and print the name of the current item</li>
105 HelpAbout.select( icurrentApp )
107 cAboutItem = HelpAbout.getSeltext()
109 '///+<li>copy the strings from the ListBox into an array</li>
116 SearchIndex.select( iCurrentItem )
117 sCurrentItem = cAboutItem & " : " & SearchIndex.getSelText()
118 hListAppend( sCurrentItem, aTopicsFromUI() )
119 iCurrentItem = iCurrentItem + 1
121 printlog( cAboutItem & ": Read " & iCurrentItem & " items" )
131 ' hManageComparisionList takes care of a lot of things like checking
132 ' for reference file and comparing or creating a new ref-file
134 printlog( "Beginning comparision. This will take a while ..." )
136 '///+<li>Compare the items to the reference list</li>
137 irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() )
139 warnlog( "The list has changed, please review" )