test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 19,39 ****
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
- /*
- @bug 8005932
- @summary Java 7 on mac os x only provides text clipboard formats
- @author mikhail.cherkasov@oracle.com
- @library ../../regtesthelpers
- @library ../../regtesthelpers/process
- @build Util
- @build ProcessResults ProcessCommunicator
- @run applet/othervm MissedHtmlAndRtfBug.html
- */
-
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.event.*;
import java.applet.Applet;
import java.io.File;
--- 19,28 ----
*** 45,54 ****
--- 34,44 ----
import sun.awt.OSInfo;
import static java.lang.Thread.sleep;
public class MissedHtmlAndRtfBug extends Applet {
+
public void init() {
setLayout(new BorderLayout());
}//End init()
public void start() {
*** 80,92 ****
args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(sourcePanel)));
args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(sourcePanel)));
args.add(concatStrings(DataFlavorSearcher.RICH_TEXT_NAMES));
ProcessResults processResults =
- // ProcessCommunicator.executeChildProcess(this.getClass(), "/Users/mcherkasov/ws/clipboard/DataFlover/out/production/DataFlover" +
- // " -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 ",
- // args.toArray(new String[0]));
ProcessCommunicator.executeChildProcess(this.getClass(),
"." + File.separator + System.getProperty("java.class.path"), args.toArray(new String[]{}));
verifyTestResults(processResults);
--- 70,79 ----
*** 115,124 ****
--- 102,118 ----
processResults.getExitValue()) {
processResults.printProcessErrorOutput(System.err);
throw new RuntimeException("TEST IS FAILED: Target has received" +
" corrupted data.");
}
+ if (InterprocessMessages.NO_DROP_HAPPENED ==
+ processResults.getExitValue()) {
+ processResults.printProcessErrorOutput(System.err);
+ throw new RuntimeException("Error. Drop did not happen." +
+ " Target frame is possibly covered by a window of other application." +
+ " Please, rerun the test with all windows minimized.");
+ }
processResults.verifyStdErr(System.err);
processResults.verifyProcessExitValue(System.err);
processResults.printProcessStandartOutput(System.out);
}
*** 182,192 ****
String[] extractStringArray(String[] args) {
return args[this.ordinal()].replaceAll("\"", "").split(",");
}
}
! public static void main(String[] args) {
Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extractInt(args),
InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extractInt(args));
Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extractInt(args),
InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extractInt(args));
String[] names = InterprocessArguments.DATA_FLAVOR_NAMES.extractStringArray(args);
--- 176,186 ----
String[] extractStringArray(String[] args) {
return args[this.ordinal()].replaceAll("\"", "").split(",");
}
}
! public static void main(String[] args) throws InterruptedException {
Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extractInt(args),
InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extractInt(args));
Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extractInt(args),
InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extractInt(args));
String[] names = InterprocessArguments.DATA_FLAVOR_NAMES.extractStringArray(args);
*** 195,203 ****
--- 189,199 ----
try {
new MissedHtmlAndRtfBug(targetFrameLocation, dragSourcePoint, df);
} catch (InterruptedException e) {
e.printStackTrace();
}
+ sleep(5000);
+ System.exit(InterprocessMessages.NO_DROP_HAPPENED);
}
}