author | erikj |
Tue, 12 Sep 2017 19:03:39 +0200 | |
changeset 47216 | 71c04702a3d5 |
parent 40128 | jdk/test/java/awt/datatransfer/UnicodeTransferTest/UnicodeTransferTest.java@e635645d2a8a |
permissions | -rw-r--r-- |
26009
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
1 |
/* |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
2 |
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
4 |
* |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
8 |
* |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
13 |
* accompanied this code). |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
14 |
* |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
18 |
* |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
21 |
* questions. |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
22 |
*/ |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
23 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
24 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
25 |
/* |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
26 |
@test |
40128
e635645d2a8a
8160974: [TESTBUG] Mark more headful tests with @key headful.
goetz
parents:
26009
diff
changeset
|
27 |
@key headful |
26009
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
28 |
@bug 4718897 |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
29 |
@summary tests that a Unicode string can be transferred between JVMs. |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
30 |
@author das@sparc.spb.su area=datatransfer |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
31 |
@library ../../regtesthelpers/process |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
32 |
@build ProcessResults ProcessCommunicator |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
33 |
@run main UnicodeTransferTest |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
34 |
*/ |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
35 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
36 |
import java.awt.datatransfer.*; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
37 |
import java.awt.*; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
38 |
import java.text.Normalizer; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
39 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
40 |
import test.java.awt.regtesthelpers.process.ProcessResults; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
41 |
import test.java.awt.regtesthelpers.process.ProcessCommunicator; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
42 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
43 |
public class UnicodeTransferTest { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
44 |
private static final Toolkit tk = Toolkit.getDefaultToolkit(); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
45 |
private static final Clipboard clipboard = tk.getSystemClipboard(); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
46 |
private static final Transferable t = new StringSelection(Util.getTestString()); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
47 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
48 |
public static void main(String[] args) throws Exception { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
49 |
Util.setClipboardContents(clipboard, t, null); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
50 |
ProcessResults result = ProcessCommunicator.executeChildProcess( |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
51 |
UnicodeTransferTestChild.class, new String[0]); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
52 |
verifyTestResults(result); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
53 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
54 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
55 |
private static void verifyTestResults(ProcessResults processResults) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
56 |
if (processResults.getExitValue() != 0) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
57 |
processResults.printProcessErrorOutput(System.err); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
58 |
throw new RuntimeException("TEST IS FAILED. See child stderr"); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
59 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
60 |
processResults.verifyStdErr(System.err); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
61 |
processResults.verifyProcessExitValue(System.err); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
62 |
processResults.printProcessStandartOutput(System.out); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
63 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
64 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
65 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
66 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
67 |
class Util { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
68 |
private static String testString = null; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
69 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
70 |
static { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
71 |
StringBuilder buf = new StringBuilder(); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
72 |
for (int i = 1; i < 0x10000; i++) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
73 |
// Skip surrogates. |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
74 |
if (i < 0xD800 || (i > 0xDFFF && i < 0xFFF0)) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
75 |
buf.append((char) i); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
76 |
} else { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
77 |
buf.append(0x20); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
78 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
79 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
80 |
// On OS X the unicode string is normalized but the clipboard, |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
81 |
// so we need to use normalized strings as well to be able to |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
82 |
// check the result |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
83 |
testString = Normalizer.normalize(buf.toString(), Normalizer.Form.NFC); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
84 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
85 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
86 |
public static String getTestString() { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
87 |
return testString; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
88 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
89 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
90 |
public static void setClipboardContents(Clipboard cb, |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
91 |
Transferable contents, |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
92 |
ClipboardOwner owner) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
93 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
94 |
boolean set = false; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
95 |
while (!set) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
96 |
try { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
97 |
cb.setContents(contents, owner); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
98 |
set = true; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
99 |
} catch (IllegalStateException ise) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
100 |
try { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
101 |
Thread.sleep(100); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
102 |
} catch (InterruptedException e) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
103 |
e.printStackTrace(); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
104 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
105 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
106 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
107 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
108 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
109 |
public static Transferable getClipboardContents(Clipboard cb, |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
110 |
Object requestor) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
111 |
while (true) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
112 |
try { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
113 |
return cb.getContents(requestor); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
114 |
} catch (IllegalStateException ise) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
115 |
try { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
116 |
Thread.sleep(100); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
117 |
} catch (InterruptedException e) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
118 |
e.printStackTrace(); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
119 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
120 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
121 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
122 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
123 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
124 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
125 |
class UnicodeTransferTestChild { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
126 |
private static final Toolkit tk = Toolkit.getDefaultToolkit(); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
127 |
private static final Clipboard clipboard = tk.getSystemClipboard(); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
128 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
129 |
public static void main(String[] args) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
130 |
Transferable t = Util.getClipboardContents(clipboard, null); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
131 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
132 |
if (t.isDataFlavorSupported(DataFlavor.stringFlavor)) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
133 |
Object o = null; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
134 |
try { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
135 |
o = t.getTransferData(DataFlavor.stringFlavor); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
136 |
} catch (Exception e) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
137 |
e.printStackTrace(); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
138 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
139 |
String testStr = Util.getTestString(); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
140 |
|
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
141 |
if (!testStr.equals(o)) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
142 |
if (o instanceof String) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
143 |
String s = (String)o; |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
144 |
if (s.length() != testStr.length()) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
145 |
System.err.println("Received length:" + s.length() + |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
146 |
" Expected length: " + |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
147 |
testStr.length()); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
148 |
} else { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
149 |
for (int i = 0; i < s.length(); i++) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
150 |
char ch = s.charAt(i); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
151 |
char expected = testStr.charAt(i); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
152 |
if (ch != expected) { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
153 |
System.err.println("i=" + i + |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
154 |
" char=" + |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
155 |
Integer.toHexString((int)ch) + |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
156 |
" expected=" + |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
157 |
Integer.toHexString(expected)); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
158 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
159 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
160 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
161 |
} else { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
162 |
System.err.println("Received object:" + o); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
163 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
164 |
throw new RuntimeException("String doesn't match."); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
165 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
166 |
} else { |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
167 |
throw new RuntimeException("Clipboard content was not set"); |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
168 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
169 |
} |
682a3a6d43a7
8051449: Incorrect parsing of the default flavor mapping
pchelko
parents:
diff
changeset
|
170 |
} |