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: w_chinesetranslate2.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:24:17 $
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 : helge.delfs@sun.com
36 '* short description : Chinese Dictionary test
38 '************************************************************************
40 ' #1 tChineseTranslate_6 'Chinese dictionary : S Chinese to T Chinese
41 ' #1 tChineseTranslate_7 'Chinese dictionary : T Chinese to S Chinese
42 ' #1 tChineseTranslate_8 'Chinese dictionary : Reverse mapping
43 ' #1 tChineseTranslate_9 'Chinese dictionary : Add
44 ' #1 tChineseTranslate_10 'Chinese dictionary : Modify
45 ' #1 tChineseTranslate_11 'Chinese dictionary : Delete
46 ' #1 tUndoRedo 'Undo/Redo
48 '\***********************************************************************
50 testcase tChineseTranslate_6
53 Dim sMapping as String
58 printlog "Chinese dictionary , S Chinese to T Chinese"
62 fSetAsian(fGetLanguageName(86))
64 printlog " Input a test term"
67 printlog " Tools/language / Chinese translation ,"
68 printlog " Check 'Simplified Chinese to Traditional Chinese'"
69 ToolsLanguageChineseTranslation
70 Kontext "ChineseTranslation"
71 SChineseToTChinese.Check
73 printlog " Check 'Translate Common Terms'"
74 TranslateCommonTerms.Check
76 printlog " Press 'Edit Terms' button"
78 Kontext "ChineseDictionary"
80 printlog " Click radiobutton 'Simplified Chinese to Tradtional Chinese'"
81 SChineseToTChinese.Check
83 printlog " Add test word in Term and Mapping"
85 Mapping.SetText sMapping
89 Kontext "ChineseTranslation"
92 printlog " Check if the result is correct"
93 Call wTypeKeys "<Home><Shift End>"
95 if GetClipboardText <> sMapping then
96 Warnlog "117803 - Hope to get " & sMapping & " but got " & GetClipboardText
100 ToolsLanguageChineseTranslation
101 Kontext "ChineseTranslation"
102 TranslateCommonTerms.UnCheck
104 Kontext "ChineseDictionary"
105 SChineseToTChinese.Check
106 SToTMappingContent.Select SToTMappingContent.GetItemCount
111 Kontext "ChineseTranslation"
112 ChineseTranslation.Cancel
117 '-----------------------------------------------------------------
119 testcase tChineseTranslate_7
122 Dim sMapping as String
127 printlog "Chinese dictionary , T Chinese to S Chinese"
131 fSetAsian(fGetLanguageName(88))
133 printlog " Input a test term"
136 printlog " Tools/language / Chinese translation ,"
137 printlog " Check Traditional Chinese to Simplified Chinese"
138 ToolsLanguageChineseTranslation
139 Kontext "ChineseTranslation"
140 TChineseToSChinese.Check
142 printlog " Check 'Translate Common Terms'"
143 TranslateCommonTerms.Check
145 printlog " Press 'Edit Terms' button"
147 Kontext "ChineseDictionary"
149 printlog " Click radiobutton 'Tradtional Chinese to Simplified Chinese'"
150 TChineseToSChinese.Check
152 printlog " Add test word in Term and Mapping"
154 Mapping.SetText sMapping
158 Kontext "ChineseTranslation"
159 ChineseTranslation.OK
161 printlog " Check if the result is correct"
162 Call wTypeKeys "<Home><Shift End>"
164 if GetClipboardText <> sMapping then
165 Warnlog "117803 - Hope to get " & sMapping & " but get " & GetClipboardText
169 ToolsLanguageChineseTranslation
170 Kontext "ChineseTranslation"
171 TranslateCommonTerms.UnCheck
173 Kontext "ChineseDictionary"
174 TChineseToSChinese.Check
175 TToSMappingContent.Select TToSMappingContent.GetItemCount
180 Kontext "ChineseTranslation"
181 ChineseTranslation.Cancel
186 '-----------------------------------------------------------------
188 testcase tChineseTranslate_8
191 Dim sMapping as String
196 printlog "Chinese dictionary , Reverse mapping"
200 fSetAsian(fGetLanguageName(88))
202 printlog " Input a test term"
203 Call wTypeKeys sMapping
205 printlog " Tools/language / Chinese translation ,"
206 printlog " Check 'Traditional Chinese to Simplified Chinese'"
207 ToolsLanguageChineseTranslation
208 Kontext "ChineseTranslation"
209 TChineseToSChinese.Check
211 printlog " Check 'Translate Common Terms'"
212 TranslateCommonTerms.Check
214 printlog " Press 'Edit Terms' button"
216 Kontext "ChineseDictionary"
218 printlog " Click radiobutton 'Simplified Chinese to Tradtional Chinese'"
219 SChineseToTChinese.Check
221 printlog " Check 'Reverse Mapping'"
224 printlog " Add test word in Term and Mapping"
226 Mapping.SetText sMapping
230 Kontext "ChineseTranslation"
231 ChineseTranslation.OK
233 printlog " Check if the result is correct"
234 Call wTypeKeys "<Home><Shift End>"
236 if GetClipboardText <> sTerm then
237 Warnlog "117803 - Hope to get " & sTerm & " but get " & GetClipboardText
241 ToolsLanguageChineseTranslation
242 Kontext "ChineseTranslation"
243 TranslateCommonTerms.UnCheck
245 Kontext "ChineseDictionary"
246 TChineseToSChinese.Check
252 Kontext "ChineseTranslation"
253 ChineseTranslation.Cancel
258 '-----------------------------------------------------------------
260 testcase tChineseTranslate_9
263 Dim sMapping1 as String
264 Dim sMapping2 as String
268 sMapping1 = "Mapping1" : sMapping2 = "Mapping2"
270 printlog "Chinese dictionary : Add"
274 printlog " Tools/language / Chinese translation ,"
275 ToolsLanguageChineseTranslation
276 Kontext "ChineseTranslation"
278 printlog " Press 'Edit Terms' button"
280 Kontext "ChineseDictionary"
281 TChineseToSChinese.Check
283 printlog " Check if term is empty , Add button should be inactive"
286 Warnlog "- term is empty , Add button should be inactive !"
290 printlog " Input test word in Term(A) and Mapping(B) , press Add"
292 Mapping.SetText sMapping1
295 printlog " Input test word in Term(A) and Mapping(C) , press Add"
297 Mapping.SetText sMapping2
299 printlog " Check if term text is unaltered , Add button should be inactive"
302 Warnlog "- term text is unaltered , Add button should be inactive !"
306 ChineseDictionary.Cancel
307 Kontext "ChineseTranslation"
308 ChineseTranslation.Cancel
313 '-----------------------------------------------------------------
315 testcase tChineseTranslate_10
318 Dim sMapping1 as String
319 Dim sMapping2 as String
323 sMapping1 = "Mapping1" : sMapping2 = "Mapping2"
325 printlog "Chinese dictionary : Modify"
329 printlog " Tools/language / Chinese translation ,"
330 ToolsLanguageChineseTranslation
331 Kontext "ChineseTranslation"
333 printlog " Press 'Edit Terms' button"
335 Kontext "ChineseDictionary"
336 TChineseToSChinese.Check
338 printlog " Input test word in Term(A) and Mapping(B) , press Add"
340 Mapping.SetText sMapping1
343 printlog " Input test word in Mapping(C) and select another property ,"
344 printlog " + then press Modify"
345 Mapping.SetText sMapping2
350 printlog " Check if modification is correct"
351 TToSMappingContent.Select TToSMappingContent.GetItemCount
352 if Term.GetText <> sTerm1 then
353 Warnlog "Should get " & sTerm1 & " but get " & Term.GetText
355 if Mapping.GetText <> sMapping2 then
356 Warnlog "Should get " & sMapping2 & " but get " & Mapping.GetText
358 if Property.GetSelIndex <> 3 then
359 Warnlog "Property is NOT correct!"
361 ChineseDictionary.Cancel
362 Kontext "ChineseTranslation"
363 ChineseTranslation.Cancel
368 '-----------------------------------------------------------------
370 testcase tChineseTranslate_11
373 Dim sMapping1 as String
377 sTerm1 = "Term1" : sTerm2 = "Term2"
378 sMapping1 = "Mapping1"
380 printlog "Chinese dictionary : Delete"
384 printlog " Tools/language / Chinese translation ,"
385 ToolsLanguageChineseTranslation
386 Kontext "ChineseTranslation"
388 printlog " Press 'Edit Terms' button"
390 Kontext "ChineseDictionary"
391 TChineseToSChinese.Check
393 printlog " Input test word in Term(A) and Mapping(B) , press Add"
395 Mapping.SetText sMapping1
398 printlog " Input test word in Term(C), check if Delete button is active"
402 Warnlog "Delete button should be inactive !"
405 ChineseDictionary.Cancel
407 Kontext "ChineseTranslation"
408 ChineseTranslation.Cancel
413 '-----------------------------------------------------------------
417 Dim sChinese as String
418 Dim sExpect as String
427 fSetAsian(fGetLanguageName(86))
429 printlog " Input some simplified chinese"
430 Call wTypeKeys sChinese
432 printlog " Tools/language / Chinese translation , check"
433 printlog " + 'Simplified Chinese to Traditional Chinese' , press OK"
434 ToolsLanguageChineseTranslation
435 Kontext "ChineseTranslation"
436 SChineseToTChinese.Check
437 ChineseTranslation.OK
439 printlog " Edit/Undo"
441 Call wTypeKeys "<Home>"
442 Call wTypeKeys "<Shift End>"
444 if GetClipboardText <> sChinese then
445 Warnlog "#117810# Hope to get " & sChinese & " but get " & GetClipboardText
448 printlog " Edit/Redo"
450 Call wTypeKeys "<Home>"
451 Call wTypeKeys "<Shift End>"
453 if GetClipboardText <> sExpect then
454 Warnlog "#117810# Hope to get " & sExpect & " but get " & GetClipboardText
460 '-----------------------------------------------------------------