1
1
/*
2
- * Copyright (c) 2017, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2017, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
24
24
*/
25
25
package test .robot .javafx .scene ;
26
26
27
+ import com .sun .javafx .PlatformUtil ;
28
+
27
29
import javafx .application .Application ;
28
30
import javafx .application .Platform ;
29
31
import javafx .collections .ListChangeListener ;
47
49
import org .junit .BeforeClass ;
48
50
import org .junit .Test ;
49
51
import static org .junit .Assert .fail ;
52
+ import static org .junit .Assume .assumeTrue ;
50
53
51
54
import test .util .Util ;
52
55
@@ -138,6 +141,8 @@ public static void main(String[] args) {
138
141
139
142
@ Test
140
143
public void testReorderTop () {
144
+ // Disable on Mac until JDK-8213136 is fixed
145
+ assumeTrue (!PlatformUtil .isMac ());
141
146
expectedTab = tabs [1 ];
142
147
setDragPolicyAndSide (TabPane .TabDragPolicy .REORDER , Side .TOP );
143
148
tabPane .getTabs ().addListener (reorderListener );
@@ -151,6 +156,8 @@ public void testReorderTop() {
151
156
152
157
@ Test
153
158
public void testReorderBottom () {
159
+ // Disable on Mac until JDK-8213136 is fixed
160
+ assumeTrue (!PlatformUtil .isMac ());
154
161
expectedTab = tabs [1 ];
155
162
setDragPolicyAndSide (TabPane .TabDragPolicy .REORDER , Side .BOTTOM );
156
163
tabPane .getTabs ().addListener (reorderListener );
@@ -164,6 +171,8 @@ public void testReorderBottom() {
164
171
165
172
@ Test
166
173
public void testReorderLeft () {
174
+ // Disable on Mac until JDK-8213136 is fixed
175
+ assumeTrue (!PlatformUtil .isMac ());
167
176
expectedTab = tabs [1 ];
168
177
setDragPolicyAndSide (TabPane .TabDragPolicy .REORDER , Side .LEFT );
169
178
tabPane .getTabs ().addListener (reorderListener );
@@ -177,6 +186,8 @@ public void testReorderLeft() {
177
186
178
187
@ Test
179
188
public void testReorderRight () {
189
+ // Disable on Mac until JDK-8213136 is fixed
190
+ assumeTrue (!PlatformUtil .isMac ());
180
191
expectedTab = tabs [1 ];
181
192
setDragPolicyAndSide (TabPane .TabDragPolicy .REORDER , Side .RIGHT );
182
193
tabPane .getTabs ().addListener (reorderListener );
@@ -290,7 +301,7 @@ public void testReorder(int dX, int dY, int xIncr, int yIncr, boolean isFixed) {
290
301
waitForLatch (releaseLatch , 5 , "Timeout waiting for robot.mouseRelease(Robot.MOUSE_LEFT_BTN)." );
291
302
292
303
if (isFixed ) {
293
- tabPane .getSelectionModel ().select (tabs [2 ]);
304
+ Util . runAndWait (() -> tabPane .getSelectionModel ().select (tabs [2 ]) );
294
305
waitForLatch (latches [2 ], 5 , "Timeout waiting tabs[2] to get selected." );
295
306
latches [0 ] = new CountDownLatch (1 );
296
307
}
0 commit comments