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: CJK_CollationDialogue_1.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $
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 : thorsten.bosbach@sun.com
36 '* short description : CJK Collation Dialogue Design Draft
38 '\***********************************************************************
40 testcase tLanguageTest_1
42 Dim sLanguageIDEnglishUSA ,sLanguageIDSChinese, sLanguageIDTChinese , sLanguageIDJapanese , sLanguageIDKoren as String
43 Dim sKeyTypeEnglishUSA ,sKeyTypeSChinese , sKeyTypeTChinese , sKeyTypeJapanese , sKeyTypeKoren as String
46 '/// Check if the default setting for "key type" is right for CJK when alphanumeric is chosen in English
49 case 01 :' English (USA)
50 sKeyTypeEnglishUSA = "Alphanumeric"
51 sKeyTypeSChinese = "Character set"
52 sKeyTypeTChinese = "Numeric"
53 sKeyTypeJapanese = "Character set"
54 sKeyTypeKoren = "Character set"
56 sKeyTypeEnglishUSA = "Alphanumerisch"
57 sKeyTypeSChinese = "Numerisch"
58 sKeyTypeTChinese = "Numerisch"
59 sKeyTypeJapanese = "Numerisch"
60 sKeyTypeKoren = "Numerisch"
62 sKeyTypeEnglishUSA = "Alfanumérico"
63 sKeyTypeSChinese = "Conjunto de caracteres"
64 sKeyTypeTChinese = "numérico"
65 sKeyTypeJapanese = "Conjunto de caracteres"
66 sKeyTypeKoren = "Conjunto de caracteres"
68 sKeyTypeEnglishUSA = "英数字"
69 sKeyTypeSChinese = "ピンイン(中国語のローマ字表記法)"
70 sKeyTypeTChinese = "ピンイン(中国語のローマ字表記法)"
71 sKeyTypeJapanese = "数字"
74 ' sKeyTypeEnglishUSA = 1 'alphanumeric
75 ' sKeyTypeSChinese = 1 'Character set
76 ' sKeyTypeTChinese = 3 'Pin yin
77 ' sKeyTypeJapanese = 2 'Character set
78 ' sKeyTypeKoren = 3 'Character set
79 case 86 :' Chinese (simplified)
80 sKeyTypeEnglishUSA = "字母数字式"
81 sKeyTypeSChinese = "字符集"
82 sKeyTypeTChinese = "拼音"
83 sKeyTypeJapanese = "字符集"
85 case 88 :' Chinese (traditional)
86 sKeyTypeEnglishUSA = "字母數字式"
87 sKeyTypeSChinese = "字型"
88 sKeyTypeTChinese = "拼音"
89 sKeyTypeJapanese = "字型"
92 PrintLog "The test does not support the language " + iSprache
96 sLanguageIDEnglishUSA = fGetCountryName(01)
97 sLanguageIDSChinese = fGetCountryName(86)
98 sLanguageIDTChinese = fGetCountryName(88)
99 sLanguageIDJapanese = fGetCountryName(81)
100 sLanguageIDKoren = fGetCountryName(82)
104 DocumentWriter.TypeKeys "test"
105 DocumentWriter.TypeKeys "<Shift Home>"
112 '/// Choose language: English and key type: alphanumeric
114 Sprache.Select (sLanguageIDEnglishUSA)
116 qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
117 ' try fallback to 'English (USA)'
119 Sprache.Select ("English (USA)")
121 qaErrorLog "Can't select even tha fallback: 'English (USA)'"
125 Schluesseltyp1.Select sKeyTypeEnglishUSA
127 qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
128 ' try fallback to 'English (USA)'
129 for i = 1 to Schluesseltyp1.getItemCount
130 printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'"
134 '/// Check to simplified Chinese
136 Sprache.Select (sLanguageIDSChinese)
138 qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'"
139 ' try fallback to 'Chinese (simplyfied)'
141 Sprache.Select ("Chinese (simplyfied)")
143 qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'"
149 Sprache.Select (sLanguageIDEnglishUSA)
151 qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
152 ' try fallback to 'English (USA)'
154 Sprache.Select ("English (USA)")
156 qaErrorLog "Can't select even tha fallback: 'English (USA)'"
160 Schluesseltyp1.Select sKeyTypeEnglishUSA
162 qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
165 '/// Check to traditional Chinese
167 Sprache.Select (sLanguageIDTChinese)
169 qaErrorLog "Can't select: '" + sLanguageIDTChinese + "'"
170 ' try fallback to 'Chinese (traditional)'
172 Sprache.Select ("Chinese (traditional)")
174 qaErrorLog "Can't select even tha fallback: 'Chinese (traditional)'"
175 for i = 1 to Sprache.getItemCount
176 printlog "("+i+"/"+ Sprache.getItemCount + "): '"+Sprache.getItemText(i)+"'"
183 Sprache.Select (sLanguageIDEnglishUSA)
185 qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
186 ' try fallback to 'English (USA)'
188 Sprache.Select ("English (USA)")
190 qaErrorLog "Can't select even tha fallback: 'English (USA)'"
194 Schluesseltyp1.Select sKeyTypeEnglishUSA
196 qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
199 '/// Check to Japanese
201 Sprache.Select (sLanguageIDJapanese)
203 qaErrorLog "Can't select: '" + sLanguageIDJapanese + "'"
204 ' try fallback to 'Japanese'
206 Sprache.Select ("Japanese")
208 qaErrorLog "Can't select even tha fallback: 'Japanese'"
212 if Schluesseltyp1.GetSelText <> sKeyTypeJapanese then
213 warnlog "The default key type for Japanese should be: '" + sKeyTypeJapanese + "' but is: '" + Schluesseltyp1.GetSelText + "'"
217 Sprache.Select (sLanguageIDEnglishUSA)
219 qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
220 ' try fallback to 'English (USA)'
222 Sprache.Select ("English (USA)")
224 qaErrorLog "Can't select even tha fallback: 'English (USA)'"
228 Schluesseltyp1.Select sKeyTypeEnglishUSA
230 qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
235 Sprache.Select (sLanguageIDKoren)
237 qaErrorLog "Can't select: '" + sLanguageIDKoren + "'"
238 ' try fallback to 'Korean (RoK)'
240 Sprache.Select ("Korean (RoK)")
242 qaErrorLog "Can't select even tha fallback: 'Korean (RoK)'"
243 for i = 1 to Sprache.getItemCount
244 printlog "("+i+"/"+ Sprache.getItemCount + "): '"+Sprache.getItemText(i)+"'"
249 if Schluesseltyp1.GetSelText <> sKeyTypeKoren then
250 warnlog "The default key type for Korean should be " + sKeyTypeKoren + " but get " + Schluesseltyp1.GetSelText
259 '-------------------------------------------------------------------------
261 testcase tLanguageTest_2
263 Dim sLanguageIDEnglishUSA ,sLanguageIDSChinese, sLanguageIDTChinese , sLanguageIDJapanese , sLanguageIDKoren as String
264 Dim sKeyTypeEnglishUSA ,sKeyTypeSChinese , sKeyTypeTChinese , sKeyTypeJapanese , sKeyTypeKoren as String
267 '/// Check if the default setting for "key type" is right for CJK when numeric is chosen in English
270 case 01 :' English (USA)
271 sKeyTypeEnglishUSA = "Numeric"
272 sKeyTypeSChinese = "Numeric"
273 sKeyTypeTChinese = "Numeric"
274 sKeyTypeJapanese = "Numeric"
275 sKeyTypeKoren = "Numeric"
277 sKeyTypeEnglishUSA = "Numerisch"
278 sKeyTypeSChinese = "Numerisch"
279 sKeyTypeTChinese = "Numerisch"
280 sKeyTypeJapanese = "Numerisch"
281 sKeyTypeKoren = "Numerisch"
283 sKeyTypeEnglishUSA = "numérico"
284 sKeyTypeSChinese = "numérico"
285 sKeyTypeTChinese = "numérico"
286 sKeyTypeJapanese = "numérico"
287 sKeyTypeKoren = "numérico"
289 sKeyTypeEnglishUSA = "数字"
290 sKeyTypeSChinese = "数字"
291 sKeyTypeTChinese = "数字"
292 sKeyTypeJapanese = "数字"
295 ' sKeyTypeEnglishUSA = 2 'numeric
296 ' sKeyTypeSChinese = 4 'numeric
297 ' sKeyTypeTChinese = 4 'numeric
298 ' sKeyTypeJapanese = 4 'numeric
299 ' sKeyTypeKoren = 4 'numeric
300 case 86 :' Chinese (simplified)
301 sKeyTypeEnglishUSA = "数字"
302 sKeyTypeSChinese = "数字"
303 sKeyTypeTChinese = "数字"
304 sKeyTypeJapanese = "数字"
306 case 88 :' Chinese (traditional)
307 sKeyTypeEnglishUSA = "數字"
308 sKeyTypeSChinese = "數字"
309 sKeyTypeTChinese = "數字"
310 sKeyTypeJapanese = "數字"
312 case else :' Fallback
313 printLog "The test does not support the language " + iSprache
317 sLanguageIDEnglishUSA = fGetCountryName(01)
318 sLanguageIDSChinese = fGetCountryName(86)
319 sLanguageIDTChinese = fGetCountryName(88)
320 sLanguageIDJapanese = fGetCountryName(81)
321 sLanguageIDKoren = fGetCountryName(82)
325 DocumentWriter.TypeKeys "123"
326 DocumentWriter.TypeKeys "<Shift Home>"
333 '/// Choose language: English and key type: Numeric
335 Sprache.Select (sLanguageIDEnglishUSA)
337 qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
338 ' try fallback to 'English (USA)'
340 Sprache.Select ("English (USA)")
342 qaErrorLog "Can't select even tha fallback: 'English (USA)'"
343 for i = 1 to Sprache.getItemCount
344 printlog "" + i + ": '" + Sprache.getItemText(i) + "'"
349 Schluesseltyp1.Select sKeyTypeEnglishUSA
351 qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
352 ' try fallback to 'English (USA)'
353 for i = 1 to Schluesseltyp1.getItemCount
354 printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'"
358 '/// Check to simplified Chinese
360 Sprache.Select (sLanguageIDSChinese)
362 qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'"
363 ' try fallback to 'Chinese (simplyfied)'
365 Sprache.Select ("Chinese (simplyfied)")
367 qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'"
371 if Schluesseltyp1.GetSelText <> sKeyTypeSChinese then
372 warnlog "The default key type for Simplified Chinese should be: '" + sKeyTypeSChinese + "' but is '" + Schluesseltyp1.GetSelText + "'"
376 Sprache.Select (sLanguageIDEnglishUSA)
378 qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
379 ' try fallback to 'English (USA)'
381 Sprache.Select ("English (USA)")
383 qaErrorLog "Can't select even tha fallback: 'English (USA)'"
387 Schluesseltyp1.Select sKeyTypeEnglishUSA
389 qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
392 '/// Check to traditional Chinese
394 Sprache.Select (sLanguageIDTChinese)
396 qaErrorLog "Can't select: '" + sLanguageIDTChinese + "'"
397 ' try fallback to 'Chinese (traditional)'
399 Sprache.Select ("Chinese (traditional)")
401 qaErrorLog "Can't select even tha fallback: 'Chinese (traditional)'"
405 if Schluesseltyp1.GetSelText <> sKeyTypeTChinese then
406 warnlog "The default key type for traditional Chinese should be " + sKeyTypeTChinese + " but get " + Schluesseltyp1.GetSelText
410 Sprache.Select (sLanguageIDEnglishUSA)
412 qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
413 ' try fallback to 'English (USA)'
415 Sprache.Select ("English (USA)")
417 qaErrorLog "Can't select even tha fallback: 'English (USA)'"
421 Schluesseltyp1.Select sKeyTypeEnglishUSA
423 qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
426 '/// Check to Japanese
428 Sprache.Select (sLanguageIDJapanese)
430 qaErrorLog "Can't select: '" + sLanguageIDJapanese + "'"
431 ' try fallback to 'Japanese'
433 Sprache.Select ("Japanese")
435 qaErrorLog "Can't select even tha fallback: 'Japanese'"
439 if Schluesseltyp1.GetSelText <> sKeyTypeJapanese then
440 warnlog "The default key type for Japanese should be: '" + sKeyTypeJapanese + "' but is: '" + Schluesseltyp1.GetSelText + "'"
444 Sprache.Select (sLanguageIDEnglishUSA)
446 qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
447 ' try fallback to 'English (USA)'
449 Sprache.Select ("English (USA)")
451 qaErrorLog "Can't select even tha fallback: 'English (USA)'"
455 Schluesseltyp1.Select sKeyTypeEnglishUSA
457 qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
462 Sprache.Select (sLanguageIDKoren)
464 qaErrorLog "Can't select: '" + sLanguageIDKoren + "'"
465 ' try fallback to 'Korean (RoK)'
467 Sprache.Select ("Korean (RoK)")
469 qaErrorLog "Can't select even tha fallback: 'Korean (RoK)'"
473 if Schluesseltyp1.GetSelText <> sKeyTypeKoren then
474 warnlog "The default key type for Korean should be " + sKeyTypeKoren + " but get " + Schluesseltyp1.GetSelText
482 '-------------------------------------------------------------------------
486 Dim testFile as String
487 Dim sLanguageIDSChinese as String
488 Dim sKeyTypeSChinese as String
489 Dim aCorrectSequence() as String
493 testFile = "sortTest.sxw"
494 aCorrectSequence = Array( "1" , "2" , "3" , "4" ,"5" )
496 j = UBound(aCorrectSequence)
499 case 01 : ' English (USA)
500 sKeyTypeSChinese = "Stroke"
502 sKeyTypeSChinese = "Stroke"
503 case 55 : ' Brazilian
504 sKeyTypeSChinese = "Traço"
506 sKeyTypeSChinese = "総画数"
507 case 86 : ' Chinese (simplified)
508 sKeyTypeSChinese = "笔画"
509 case 88 : ' Chinese (simplified)
510 sKeyTypeSChinese = "筆畫"
511 case else : ' Fallback
512 printLog "Now, the test does not support for the language " +iSprache
516 sLanguageIDSChinese = fGetCountryName(86)
518 '/// Check Stroke sort for Simplified Chinese
521 '/// Open a test file and check <i>No Grid</i> checkbox
522 Call hFileOpen ( gTesttoolPath + "framework\optional\input\CJK\" + testFile )
523 sMakeReadOnlyDocumentEditable
526 '/// Open <i>Tools/Sort</i>
530 '/// Choose language: Simplified Chinese and key type <i>Stroke</i>
532 Sprache.Select (sLanguageIDSChinese)
534 qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'"
535 ' try fallback to 'Chinese (simplyfied)'
537 Sprache.Select ("Chinese (simplyfied)")
539 qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'"
543 Schluesseltyp1.Select sKeyTypeSChinese
545 qaErrorLog "Can't select: '" + sKeyTypeSChinese + "'"
546 for i = 1 to Schluesseltyp1.getItemCount
547 printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'"
553 Kontext "DocumentWriter"
554 DocumentWriter.TypeKeys "<MOD1 Home>"
557 DocumentWriter.TypeKeys "<End>"
558 DocumentWriter.TypeKeys "<Shift Left>"
561 if GetClipboardText <> aCorrectSequence(i) then Warnlog "The Stroke sort is wrong , should be " + aCorrectSequence(i) + " ,but get " +GetClipboardText
563 DocumentWriter.TypeKeys "<Down>"
570 '-------------------------------------------------------------------------
574 Dim testFile as String
575 Dim sLanguageIDSChinese as String
576 Dim sKeyTypeSChinese as String
577 Dim aCorrectSequence() as String
581 testFile = "sortTest.sxw"
582 aCorrectSequence = Array( "2" , "3" , "4" , "1" , "5" )
584 j = UBound(aCorrectSequence)
587 case 01 : ' English (USA)
588 sKeyTypeSChinese = "Pinyin"
590 sKeyTypeSChinese = "Pinyin"
591 case 55 : ' Brazilian
592 sKeyTypeSChinese = "Pinyin"
594 sKeyTypeSChinese = "ピンイン(中国語のローマ字表記法)"
595 case 86 : ' Chinese (simplified)
596 sKeyTypeSChinese = "拼音"
597 case 88 : ' Chinese (simplified)
598 sKeyTypeSChinese = "拼音"
599 case else : ' Fallback
600 printLog "Now, the test does not support for the language " +iSprache
604 sLanguageIDSChinese = fGetCountryName(86)
606 '/// Check <i>Pinyin</i> sort for Simplified Chinese
609 '/// Open a test file and check <i>No Grid</i> checkbox
610 Call hFileOpen ( gTesttoolPath + "framework\optional\input\CJK\" + testFile )
611 sMakeReadOnlyDocumentEditable
614 '/// Open <i>Tools/Sort</i>
618 '/// Choose language: Simplified Chinese and key type <i>Pin yin</i>
620 Sprache.Select (sLanguageIDSChinese)
622 qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'"
623 ' try fallback to 'Chinese (simplyfied)'
625 Sprache.Select ("Chinese (simplyfied)")
627 qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'"
631 Schluesseltyp1.Select sKeyTypeSChinese
633 qaErrorLog "Can't select: '" + sKeyTypeSChinese + "'"
634 for i = 1 to Schluesseltyp1.getItemCount
635 printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'"
641 Kontext "DocumentWriter"
642 DocumentWriter.TypeKeys "<MOD1 Home>"
645 DocumentWriter.TypeKeys "<End>"
646 DocumentWriter.TypeKeys "<Shift Left>"
649 if GetClipboardText <> aCorrectSequence(i) then
650 Warnlog "The Pin yin sort is wrong, should be: '" + aCorrectSequence(i) + "' ,but is: '" +GetClipboardText + "'"
653 DocumentWriter.TypeKeys "<Down>"
660 '-------------------------------------------------------------------------
662 testcase tSortOptionTest_1
665 Dim asList() as String
669 if iSystemSprache <> 81 then goto NOTest
671 "Sun,Mon,Tue,Wed,Thu,Fri,Sat" , _
672 "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" , _
673 "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec" , _
674 "January,February,March,April,May,June,July,August,September,October,November,December" , _
676 "日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日" , _
679 if iSystemSprache <> 82 then goto NOTest
682 "일요일,월요일,화요일,수요일,목요일,금요일,토요일" ,_
683 "1,2,3,4,5,6,7,8,9,10,11,12" , _
685 "日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日" , _
687 case 86 :' Chinese (simplified)
688 if iSystemSprache <> 86 then goto NOTest
691 "星期日,星期一,星期二,星期三,星期四,星期五,星期六" , _
692 "一,二,三,四,五,六,七,八,九,十,十一,十二" , _
693 "一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月" , _
695 case 88 :' Chinese (traditional)
696 if iSystemSprache <> 88 then goto NOTest
699 "星期日,星期一,星期二,星期三,星期四,星期五,星期六" , _
700 "一,二,三,四,五,六,七,八,九,十,十一,十二" , _
701 "一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月" , _
703 case else :' Fallback
705 printLog "The test does not support for the language " +iSprache + " System language " + iSystemSprache
709 '/// Check if the entries in custom sort order is right in CJK version
713 '/// Open <i>Data/Sort</i> -> tabpage <i>option</i>
718 active.SetPage TabSortierenOptionen
719 Kontext "TabSortierenOptionen"
721 BenutzerdefinierteSortierreihenfolge.Check
723 For i = 1 to SortierreihenfolgeListe.GetItemCount
724 if SortierreihenfolgeListe.GetItemText(i) <> asList(i-1) then
725 warnlog "Should get " +asList(i) + " but get " +SortierreihenfolgeListe.GetItemText(i)
729 TabSortierenOptionen.Cancel
735 '----------------------------------------------------------------