author | jjg |
Thu, 14 Dec 2017 13:16:33 -0800 | |
changeset 48340 | 959f2f7cbaa6 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
38581
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
1 |
/* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
2 |
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
4 |
* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
8 |
* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
13 |
* accompanied this code). |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
14 |
* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
18 |
* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
21 |
* questions. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
22 |
*/ |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
23 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
24 |
/* @test |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
25 |
* @bug 4139771 |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
26 |
* @summary test all aspects of AttributedString class |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
27 |
*/ |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
28 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
29 |
import java.text.Annotation; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
30 |
import java.text.AttributedCharacterIterator; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
31 |
import java.text.AttributedCharacterIterator.Attribute; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
32 |
import java.text.AttributedString; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
33 |
import java.text.CharacterIterator; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
34 |
import java.util.HashSet; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
35 |
import java.util.Iterator; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
36 |
import java.util.Locale; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
37 |
import java.util.Map; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
38 |
import java.util.Map.Entry; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
39 |
import java.util.Set; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
40 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
41 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
42 |
public class AttributedStringTest { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
43 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
44 |
private static final String text = "Hello, world!"; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
45 |
private static final Annotation hi = new Annotation("hi"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
46 |
private static final int[] array5_13 = {5, 13}; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
47 |
private static final int[] array3_9_13 = {3, 9, 13}; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
48 |
private static final int[] array5_9_13 = {5, 9, 13}; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
49 |
private static final int[] array3_5_9_13 = {3, 5, 9, 13}; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
50 |
private static final Attribute[] arrayLanguage = {Attribute.LANGUAGE}; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
51 |
private static final Attribute[] arrayLanguageReading = {Attribute.LANGUAGE, Attribute.READING}; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
52 |
private static final Set setLanguageReading = new HashSet(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
53 |
static { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
54 |
setLanguageReading.add(Attribute.LANGUAGE); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
55 |
setLanguageReading.add(Attribute.READING); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
56 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
57 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
58 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
59 |
public static final void main(String argv[]) throws Exception { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
60 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
61 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
62 |
AttributedString string; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
63 |
AttributedCharacterIterator iterator; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
64 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
65 |
// create a string with text, but no attributes |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
66 |
string = new AttributedString(text); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
67 |
iterator = string.getIterator(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
68 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
69 |
// make sure the text is there and attributes aren't |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
70 |
checkIteratorText(iterator, text); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
71 |
if (!iterator.getAllAttributeKeys().isEmpty()) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
72 |
throwException(iterator, "iterator provides attributes where none are defined"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
73 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
74 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
75 |
// add an attribute to a subrange |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
76 |
string.addAttribute(Attribute.LANGUAGE, Locale.ENGLISH, 3, 9); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
77 |
iterator = string.getIterator(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
78 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
79 |
// make sure the attribute is defined, and it's on the correct subrange |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
80 |
checkIteratorAttributeKeys(iterator, arrayLanguage); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
81 |
checkIteratorSubranges(iterator, array3_9_13); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
82 |
checkIteratorAttribute(iterator, 0, Attribute.LANGUAGE, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
83 |
checkIteratorAttribute(iterator, 3, Attribute.LANGUAGE, Locale.ENGLISH); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
84 |
checkIteratorAttribute(iterator, 9, Attribute.LANGUAGE, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
85 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
86 |
// add an attribute to a subrange |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
87 |
string.addAttribute(Attribute.READING, hi, 0, 5); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
88 |
iterator = string.getIterator(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
89 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
90 |
// make sure the attribute is defined, and it's on the correct subrange |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
91 |
checkIteratorAttributeKeys(iterator, arrayLanguageReading); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
92 |
checkIteratorSubranges(iterator, array3_5_9_13); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
93 |
checkIteratorAttribute(iterator, 0, Attribute.READING, hi); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
94 |
checkIteratorAttribute(iterator, 3, Attribute.READING, hi); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
95 |
checkIteratorAttribute(iterator, 5, Attribute.READING, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
96 |
checkIteratorAttribute(iterator, 9, Attribute.READING, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
97 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
98 |
// make sure the first attribute wasn't adversely affected |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
99 |
// in particular, we shouldn't see separate subranges (3,5) and (5,9). |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
100 |
checkIteratorSubranges(iterator, Attribute.LANGUAGE, array3_9_13); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
101 |
checkIteratorAttribute(iterator, 0, Attribute.LANGUAGE, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
102 |
checkIteratorAttribute(iterator, 3, Attribute.LANGUAGE, Locale.ENGLISH); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
103 |
checkIteratorAttribute(iterator, 5, Attribute.LANGUAGE, Locale.ENGLISH); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
104 |
checkIteratorAttribute(iterator, 9, Attribute.LANGUAGE, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
105 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
106 |
// for the entire set of attributes, we expect four subranges |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
107 |
checkIteratorSubranges(iterator, setLanguageReading, array3_5_9_13); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
108 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
109 |
// redefine the language attribute so that both language and reading are continuous from 0 to 5 |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
110 |
string.addAttribute(Attribute.LANGUAGE, Locale.US, 0, 5); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
111 |
iterator = string.getIterator(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
112 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
113 |
// make sure attributes got changed and merged correctly |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
114 |
checkIteratorAttributeKeys(iterator, arrayLanguageReading); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
115 |
checkIteratorSubranges(iterator, array3_5_9_13); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
116 |
checkIteratorSubranges(iterator, Attribute.LANGUAGE, array5_9_13); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
117 |
checkIteratorSubranges(iterator, Attribute.READING, array5_13); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
118 |
checkIteratorSubranges(iterator, setLanguageReading, array5_9_13); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
119 |
checkIteratorAttribute(iterator, 0, Attribute.LANGUAGE, Locale.US); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
120 |
checkIteratorAttribute(iterator, 3, Attribute.LANGUAGE, Locale.US); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
121 |
checkIteratorAttribute(iterator, 5, Attribute.LANGUAGE, Locale.ENGLISH); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
122 |
checkIteratorAttribute(iterator, 9, Attribute.LANGUAGE, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
123 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
124 |
// make sure an annotation is only returned if its range is contained in the iterator's range |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
125 |
iterator = string.getIterator(null, 3, 5); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
126 |
checkIteratorAttribute(iterator, 3, Attribute.READING, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
127 |
checkIteratorAttribute(iterator, 5, Attribute.READING, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
128 |
iterator = string.getIterator(null, 0, 4); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
129 |
checkIteratorAttribute(iterator, 0, Attribute.READING, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
130 |
checkIteratorAttribute(iterator, 3, Attribute.READING, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
131 |
iterator = string.getIterator(null, 0, 5); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
132 |
checkIteratorAttribute(iterator, 0, Attribute.READING, hi); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
133 |
checkIteratorAttribute(iterator, 4, Attribute.READING, hi); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
134 |
checkIteratorAttribute(iterator, 5, Attribute.READING, null); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
135 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
136 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
137 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
138 |
private static final void checkIteratorText(AttributedCharacterIterator iterator, String expectedText) throws Exception { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
139 |
if (iterator.getEndIndex() - iterator.getBeginIndex() != expectedText.length()) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
140 |
throwException(iterator, "text length doesn't match between original text and iterator"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
141 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
142 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
143 |
char c = iterator.first(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
144 |
for (int i = 0; i < expectedText.length(); i++) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
145 |
if (c != expectedText.charAt(i)) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
146 |
throwException(iterator, "text content doesn't match between original text and iterator"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
147 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
148 |
c = iterator.next(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
149 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
150 |
if (c != CharacterIterator.DONE) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
151 |
throwException(iterator, "iterator text doesn't end with DONE"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
152 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
153 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
154 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
155 |
private static final void checkIteratorAttributeKeys(AttributedCharacterIterator iterator, Attribute[] expectedKeys) throws Exception { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
156 |
Set iteratorKeys = iterator.getAllAttributeKeys(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
157 |
if (iteratorKeys.size() != expectedKeys.length) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
158 |
throwException(iterator, "number of keys returned by iterator doesn't match expectation"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
159 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
160 |
for (int i = 0; i < expectedKeys.length; i++) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
161 |
if (!iteratorKeys.contains(expectedKeys[i])) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
162 |
throwException(iterator, "expected key wasn't found in iterator's key set"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
163 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
164 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
165 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
166 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
167 |
private static final void checkIteratorSubranges(AttributedCharacterIterator iterator, int[] expectedLimits) throws Exception { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
168 |
int previous = 0; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
169 |
char c = iterator.first(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
170 |
for (int i = 0; i < expectedLimits.length; i++) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
171 |
if (iterator.getRunStart() != previous || iterator.getRunLimit() != expectedLimits[i]) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
172 |
throwException(iterator, "run boundaries are not as expected: " + iterator.getRunStart() + ", " + iterator.getRunLimit()); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
173 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
174 |
previous = expectedLimits[i]; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
175 |
c = iterator.setIndex(previous); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
176 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
177 |
if (c != CharacterIterator.DONE) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
178 |
throwException(iterator, "iterator's run sequence doesn't end with DONE"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
179 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
180 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
181 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
182 |
private static final void checkIteratorSubranges(AttributedCharacterIterator iterator, Attribute key, int[] expectedLimits) throws Exception { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
183 |
int previous = 0; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
184 |
char c = iterator.first(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
185 |
for (int i = 0; i < expectedLimits.length; i++) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
186 |
if (iterator.getRunStart(key) != previous || iterator.getRunLimit(key) != expectedLimits[i]) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
187 |
throwException(iterator, "run boundaries are not as expected: " + iterator.getRunStart(key) + ", " + iterator.getRunLimit(key) + " for key " + key); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
188 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
189 |
previous = expectedLimits[i]; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
190 |
c = iterator.setIndex(previous); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
191 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
192 |
if (c != CharacterIterator.DONE) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
193 |
throwException(iterator, "iterator's run sequence doesn't end with DONE"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
194 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
195 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
196 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
197 |
private static final void checkIteratorSubranges(AttributedCharacterIterator iterator, Set keys, int[] expectedLimits) throws Exception { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
198 |
int previous = 0; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
199 |
char c = iterator.first(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
200 |
for (int i = 0; i < expectedLimits.length; i++) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
201 |
if (iterator.getRunStart(keys) != previous || iterator.getRunLimit(keys) != expectedLimits[i]) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
202 |
throwException(iterator, "run boundaries are not as expected: " + iterator.getRunStart(keys) + ", " + iterator.getRunLimit(keys) + " for keys " + keys); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
203 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
204 |
previous = expectedLimits[i]; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
205 |
c = iterator.setIndex(previous); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
206 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
207 |
if (c != CharacterIterator.DONE) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
208 |
throwException(iterator, "iterator's run sequence doesn't end with DONE"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
209 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
210 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
211 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
212 |
private static final void checkIteratorAttribute(AttributedCharacterIterator iterator, int index, Attribute key, Object expectedValue) throws Exception { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
213 |
iterator.setIndex(index); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
214 |
Object value = iterator.getAttribute(key); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
215 |
if (!((expectedValue == null && value == null) || (expectedValue != null && expectedValue.equals(value)))) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
216 |
throwException(iterator, "iterator returns wrong attribute value - " + value + " instead of " + expectedValue); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
217 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
218 |
value = iterator.getAttributes().get(key); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
219 |
if (!((expectedValue == null && value == null) || (expectedValue != null && expectedValue.equals(value)))) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
220 |
throwException(iterator, "iterator's map returns wrong attribute value - " + value + " instead of " + expectedValue); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
221 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
222 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
223 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
224 |
private static final void throwException(AttributedCharacterIterator iterator, String details) throws Exception { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
225 |
dumpIterator(iterator); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
226 |
throw new Exception(details); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
227 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
228 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
229 |
private static final void dumpIterator(AttributedCharacterIterator iterator) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
230 |
Set attributeKeys = iterator.getAllAttributeKeys(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
231 |
System.out.print("All attributes: "); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
232 |
Iterator keyIterator = attributeKeys.iterator(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
233 |
while (keyIterator.hasNext()) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
234 |
Attribute key = (Attribute) keyIterator.next(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
235 |
System.out.print(key); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
236 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
237 |
for(char c = iterator.first(); c != CharacterIterator.DONE; c = iterator.next()) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
238 |
if (iterator.getIndex() == iterator.getBeginIndex() || |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
239 |
iterator.getIndex() == iterator.getRunStart()) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
240 |
System.out.println(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
241 |
Map attributes = iterator.getAttributes(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
242 |
Set entries = attributes.entrySet(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
243 |
Iterator attributeIterator = entries.iterator(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
244 |
while (attributeIterator.hasNext()) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
245 |
Map.Entry entry = (Map.Entry) attributeIterator.next(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
246 |
System.out.print("<" + entry.getKey() + ": " |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
247 |
+ entry.getValue() + ">"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
248 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
249 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
250 |
System.out.print(" "); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
251 |
System.out.print(c); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
252 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
253 |
System.out.println(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
254 |
System.out.println("done"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
255 |
System.out.println(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
256 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
257 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
258 |
} |