1 /* |
1 /* |
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /* |
25 test |
25 @test |
|
26 @key headful |
26 @bug 8029565 |
27 @bug 8029565 |
27 @summary Conversion of a URI list to File list fails |
28 @summary Conversion of a URI list to File list fails |
28 @author Petr Pchelko <petr.pchelko@oracle.com> |
|
29 @library ../../regtesthelpers |
29 @library ../../regtesthelpers |
30 @library ../../regtesthelpers/process |
30 @library ../../regtesthelpers/process |
31 @build Util |
31 @build Util |
32 @build ProcessResults ProcessCommunicator |
32 @build ProcessResults ProcessCommunicator |
33 @run applet/othervm URIListToFileListBetweenJVMsTest.html |
33 @run main/othervm URIListToFileListBetweenJVMsTest main |
34 */ |
|
35 |
|
36 /** |
|
37 * URIListToFileListBetweenJVMsTest.java |
|
38 * |
|
39 * summary: DnD of File-List across JVM adds two empty items to the list |
|
40 */ |
34 */ |
41 |
35 |
42 import test.java.awt.regtesthelpers.Util; |
36 import test.java.awt.regtesthelpers.Util; |
43 import test.java.awt.regtesthelpers.process.ProcessCommunicator; |
37 import test.java.awt.regtesthelpers.process.ProcessCommunicator; |
44 import test.java.awt.regtesthelpers.process.ProcessResults; |
38 import test.java.awt.regtesthelpers.process.ProcessResults; |
45 |
39 |
46 import java.applet.Applet; |
|
47 import java.awt.*; |
40 import java.awt.*; |
48 import java.awt.event.InputEvent; |
41 import java.awt.event.InputEvent; |
49 |
42 |
50 import static java.lang.Thread.sleep; |
43 import static java.lang.Thread.sleep; |
51 |
44 |
52 public class URIListToFileListBetweenJVMsTest extends Applet { |
45 public class URIListToFileListBetweenJVMsTest { |
53 |
46 |
54 // information related to the test in common |
47 // information related to the test in common |
55 static int VISIBLE_RAWS_IN_LIST=15; |
48 static int VISIBLE_RAWS_IN_LIST=15; |
56 |
|
57 public void init() { |
|
58 setLayout(new BorderLayout()); |
|
59 } |
|
60 |
49 |
61 public void start() { |
50 public void start() { |
62 |
51 |
63 SourceFileListFrame sourceFrame = new SourceFileListFrame(); |
52 SourceFileListFrame sourceFrame = new SourceFileListFrame(); |
64 |
53 |
125 int extract (String [] args) { |
114 int extract (String [] args) { |
126 return Integer.parseInt(args[this.ordinal()]); |
115 return Integer.parseInt(args[this.ordinal()]); |
127 } |
116 } |
128 } |
117 } |
129 |
118 |
130 public static void main (String [] args) throws Exception { |
119 public static void main(final String [] args) throws Exception { |
|
120 if (args.length > 0 && args[0].equals("main")) { |
|
121 new URIListToFileListBetweenJVMsTest().start(); |
|
122 return; |
|
123 } |
131 Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args), |
124 Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args), |
132 InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args)); |
125 InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args)); |
133 Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args), |
126 Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args), |
134 InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args)); |
127 InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args)); |
135 int transferredFilesNumber = InterprocessArguments.FILES_IN_THE_LIST_NUMBER_ARGUMENT.extract(args); |
128 int transferredFilesNumber = InterprocessArguments.FILES_IN_THE_LIST_NUMBER_ARGUMENT.extract(args); |