RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v3]
Alexander Zvegintsev
azvegint at openjdk.org
Tue Dec 3 01:41:55 UTC 2024
On Tue, 3 Dec 2024 00:17:11 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:
>> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability.
>> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed.
>>
>> - java/awt/datatransfer/Independence/IndependenceAWTTest.java
>> - java/awt/datatransfer/Independence/IndependenceSwingTest.java
>>
>> Multiple runs of the test on CI looks good and the tests pass.
>
> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>
> frame title
test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 88:
> 86:
> 87: // TextFields to get the contents of clipboard
> 88: tf2 = new TextField();
Line 82
--- a/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java
+++ b/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java
@@ -80,7 +80,7 @@ private static void createAndShowUI() {
tf1 = new TextField();
tf1.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent fe) {
- tf1.setText("Clipboards_Independance_Testing");
+ tf1.setText("Clipboards_Independence_Testing");
}
});
Same for the `IndependenceSwingTest`
test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 170:
> 168: });
> 169:
> 170: robot.glide(new Point(0, 0), ttf1Center);
Gliding from `0,0` can sometimes be time consuming, e.g. on my `3440x1440` screen this test took 24s, but with the following patch only 7s.
--- a/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java
+++ b/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java
@@ -59,6 +59,7 @@ public class IndependenceAWTTest {
private static Clipboard primaryClip;
private static ExtendedRobot robot;
private static volatile Point ttf1Center;
+ private static volatile Point glideStartLocation;
public static void main (String[] args) throws Exception {
try {
@@ -165,9 +166,11 @@ private static void test() throws Exception {
Point center = tf1.getLocationOnScreen();
center.translate(tf1.getWidth() / 2, tf1.getHeight() / 2);
ttf1Center = center;
+ glideStartLocation = frame.getLocationOnScreen();
+ glideStartLocation.x -= 10;
});
- robot.glide(new Point(0, 0), ttf1Center);
+ robot.glide(glideStartLocation, ttf1Center);
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
robot.waitForIdle(20);
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866841320
PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866859287
More information about the client-libs-dev
mailing list