1 /* |
1 /* |
2 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2007, 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 5079469 |
27 @bug 5079469 |
27 @summary DnD of File-List across JVM adds two empty items to the list |
28 @summary DnD of File-List across JVM adds two empty items to the list |
28 @author : area=dnd |
29 @library ../../regtesthelpers |
29 @run applet FileListBetweenJVMsTest.html |
30 @library ../../regtesthelpers/process |
|
31 @build Util |
|
32 @build ProcessResults ProcessCommunicator |
|
33 @run main/othervm FileListBetweenJVMsTest main |
30 */ |
34 */ |
31 |
|
32 /** |
|
33 * FileListBetweenJVMsTest.java |
|
34 * |
|
35 * summary: DnD of File-List across JVM adds two empty items to the list |
|
36 */ |
|
37 |
35 |
38 import static java.lang.Thread.sleep; |
36 import static java.lang.Thread.sleep; |
39 |
37 |
40 import test.java.awt.regtesthelpers.process.ProcessCommunicator; |
38 import test.java.awt.regtesthelpers.process.ProcessCommunicator; |
41 import test.java.awt.regtesthelpers.process.ProcessResults; |
39 import test.java.awt.regtesthelpers.process.ProcessResults; |
42 import test.java.awt.regtesthelpers.Util; |
40 import test.java.awt.regtesthelpers.Util; |
43 import java.applet.Applet; |
|
44 import java.awt.*; |
41 import java.awt.*; |
45 import java.awt.event.InputEvent; |
42 import java.awt.event.InputEvent; |
46 import java.io.*; |
|
47 |
43 |
48 public class FileListBetweenJVMsTest extends Applet { |
44 public class FileListBetweenJVMsTest { |
49 |
45 |
50 // information related to the test in common |
46 // information related to the test in common |
51 static int VISIBLE_RAWS_IN_LIST=15; |
47 static int VISIBLE_RAWS_IN_LIST=15; |
52 |
|
53 public void init() { |
|
54 setLayout(new BorderLayout()); |
|
55 |
|
56 }//End init() |
|
57 |
48 |
58 public void start() { |
49 public void start() { |
59 |
50 |
60 SourceFileListFrame sourceFrame = new SourceFileListFrame(); |
51 SourceFileListFrame sourceFrame = new SourceFileListFrame(); |
61 |
52 |
128 int extract (String [] args) { |
119 int extract (String [] args) { |
129 return Integer.parseInt(args[this.ordinal()]); |
120 return Integer.parseInt(args[this.ordinal()]); |
130 } |
121 } |
131 } |
122 } |
132 |
123 |
133 public static void main (String [] args) { |
124 public static void main(final String [] args) { |
|
125 if (args.length > 0 && args[0].equals("main")) { |
|
126 new FileListBetweenJVMsTest().start(); |
|
127 return; |
|
128 } |
134 Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args), |
129 Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args), |
135 InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args)); |
130 InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args)); |
136 Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args), |
131 Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args), |
137 InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args)); |
132 InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args)); |
138 int transferredFilesNumber = InterprocessArguments.FILES_IN_THE_LIST_NUMBER_ARGUMENT.extract(args); |
133 int transferredFilesNumber = InterprocessArguments.FILES_IN_THE_LIST_NUMBER_ARGUMENT.extract(args); |