author | amurillo |
Wed, 15 Aug 2012 16:49:38 -0700 | |
changeset 13465 | d3fc5d192448 |
parent 5506 | 202f599c92aa |
permissions | -rw-r--r-- |
4362
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
1 |
/* |
5506 | 2 |
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
4362
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
4 |
* |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
8 |
* |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
13 |
* accompanied this code). |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
14 |
* |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
18 |
* |
5506 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
4362
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
22 |
*/ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
23 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
24 |
/* |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
25 |
test |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
26 |
@bug 5098433 |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
27 |
@summary REG: DnD of File-List between JVM is broken for non ASCII file names - Win32 |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
28 |
@author Denis Fokin: area=dnd |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
29 |
@library ../../regtesthelpers |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
30 |
@library ../../regtesthelpers/process |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
31 |
@build Util |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
32 |
@build ProcessResults ProcessCommunicator |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
33 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
34 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
35 |
@run applet/othervm DragUnicodeBetweenJVMTest.html |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
36 |
*/ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
37 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
38 |
/** |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
39 |
* DragUnicodeBetweenJVMTest.java |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
40 |
* |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
41 |
* summary: The test drags a list of files (DataFlavor.javaFileListFlavor) from one jvm to another. |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
42 |
* The files have Unicode names. The list on target side must be equal to |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
43 |
* the list on the source side. |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
44 |
*/ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
45 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
46 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
47 |
import java.awt.*; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
48 |
import java.awt.event.*; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
49 |
import java.applet.Applet; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
50 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
51 |
import test.java.awt.regtesthelpers.process.ProcessCommunicator; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
52 |
import test.java.awt.regtesthelpers.process.ProcessResults; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
53 |
import test.java.awt.regtesthelpers.Util; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
54 |
import static java.lang.Thread.sleep; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
55 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
56 |
public class DragUnicodeBetweenJVMTest extends Applet |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
57 |
{ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
58 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
59 |
public void init() { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
60 |
setLayout(new BorderLayout()); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
61 |
}//End init() |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
62 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
63 |
public void start() { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
64 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
65 |
String toolkit = Toolkit.getDefaultToolkit().getClass().getName(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
66 |
if (!toolkit.equals("sun.awt.windows.WToolkit")){ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
67 |
System.out.println("This test is for Windows only. Passed."); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
68 |
return; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
69 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
70 |
else{ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
71 |
System.out.println("Toolkit = " + toolkit); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
72 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
73 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
74 |
final Frame sourceFrame = new Frame("Source frame"); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
75 |
final SourcePanel sourcePanel = new SourcePanel(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
76 |
sourceFrame.add(sourcePanel); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
77 |
sourceFrame.pack(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
78 |
sourceFrame.addWindowListener( new WindowAdapter() { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
79 |
@Override |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
80 |
public void windowClosing(WindowEvent e) { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
81 |
sourceFrame.dispose(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
82 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
83 |
}); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
84 |
sourceFrame.setVisible(true); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
85 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
86 |
Util.waitForIdle(null); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
87 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
88 |
NextFramePositionCalculator positionCalculator = new NextFramePositionCalculator(sourceFrame); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
89 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
90 |
String [] args = new String [] { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
91 |
String.valueOf(positionCalculator.getNextLocationX()), |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
92 |
String.valueOf(positionCalculator.getNextLocationY()), |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
93 |
String.valueOf(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(sourcePanel)), |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
94 |
String.valueOf(AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(sourcePanel)), |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
95 |
}; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
96 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
97 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
98 |
ProcessResults processResults = |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
99 |
// ProcessCommunicator.executeChildProcess(this.getClass()," -cp \"C:\\Documents and Settings\\df153228\\IdeaProjects\\UnicodeTestDebug\\out\\production\\UnicodeTestDebug\" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 ", args); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
100 |
ProcessCommunicator.executeChildProcess(this.getClass(), args); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
101 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
102 |
verifyTestResults(processResults); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
103 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
104 |
}// start() |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
105 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
106 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
107 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
108 |
private static void verifyTestResults(ProcessResults processResults) { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
109 |
if ( InterprocessMessages.FILES_ON_TARGET_ARE_CORRUPTED == |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
110 |
processResults.getExitValue()) |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
111 |
{ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
112 |
processResults.printProcessErrorOutput(System.err); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
113 |
throw new RuntimeException("TEST IS FAILED: Target has recieved" + |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
114 |
" broken file list."); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
115 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
116 |
processResults.verifyStdErr(System.err); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
117 |
processResults.verifyProcessExitValue(System.err); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
118 |
processResults.printProcessStandartOutput(System.out); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
119 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
120 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
121 |
//We cannot make an instance of the applet without the default constructor |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
122 |
public DragUnicodeBetweenJVMTest () { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
123 |
super(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
124 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
125 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
126 |
//We need in this constructor to pass frame position between JVMs |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
127 |
public DragUnicodeBetweenJVMTest (Point targetFrameLocation, Point dragSourcePoint) |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
128 |
throws InterruptedException |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
129 |
{ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
130 |
final Frame targetFrame = new Frame("Target frame"); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
131 |
final TargetPanel targetPanel = new TargetPanel(targetFrame); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
132 |
targetFrame.add(targetPanel); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
133 |
targetFrame.addWindowListener( new WindowAdapter() { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
134 |
@Override |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
135 |
public void windowClosing(WindowEvent e) { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
136 |
targetFrame.dispose(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
137 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
138 |
}); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
139 |
targetFrame.setLocation(targetFrameLocation); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
140 |
targetFrame.pack(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
141 |
targetFrame.setVisible(true); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
142 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
143 |
doTest(dragSourcePoint, targetPanel); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
144 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
145 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
146 |
private void doTest(Point dragSourcePoint, TargetPanel targetPanel) { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
147 |
Util.waitForIdle(null); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
148 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
149 |
final Robot robot = Util.createRobot(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
150 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
151 |
robot.mouseMove((int)dragSourcePoint.getX(),(int)dragSourcePoint.getY()); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
152 |
try { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
153 |
sleep(100); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
154 |
robot.mousePress(InputEvent.BUTTON1_MASK); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
155 |
sleep(100); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
156 |
robot.mouseRelease(InputEvent.BUTTON1_MASK); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
157 |
sleep(100); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
158 |
} catch (InterruptedException e) { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
159 |
e.printStackTrace(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
160 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
161 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
162 |
Util.drag(robot, dragSourcePoint, new Point (AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(targetPanel), |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
163 |
AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(targetPanel)), |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
164 |
InputEvent.BUTTON1_MASK); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
165 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
166 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
167 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
168 |
enum InterprocessArguments { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
169 |
TARGET_FRAME_X_POSITION_ARGUMENT, |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
170 |
TARGET_FRAME_Y_POSITION_ARGUMENT, |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
171 |
DRAG_SOURCE_POINT_X_ARGUMENT, |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
172 |
DRAG_SOURCE_POINT_Y_ARGUMENT; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
173 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
174 |
int extract (String [] args) { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
175 |
return Integer.parseInt(args[this.ordinal()]); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
176 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
177 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
178 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
179 |
public static void main (String [] args) { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
180 |
Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args), |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
181 |
InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args)); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
182 |
Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args), |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
183 |
InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args)); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
184 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
185 |
try { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
186 |
new DragUnicodeBetweenJVMTest(targetFrameLocation, dragSourcePoint); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
187 |
} catch (InterruptedException e) { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
188 |
e.printStackTrace(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
189 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
190 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
191 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
192 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
193 |
} |