Skip to content

Commit c41777e

Browse files
committed
8245634: [TestBug] Enable and fix tests ignored with message "impl_cssSet API removed"
Reviewed-by: arapte
1 parent 3ceee69 commit c41777e

File tree

4 files changed

+58
-17
lines changed

4 files changed

+58
-17
lines changed

modules/javafx.controls/src/test/java/test/javafx/scene/control/CellTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -224,10 +224,17 @@ public void selectingAnEmptyCellResultsInNoChange() {
224224
assertTrue(cell.isEditable());
225225
}
226226

227-
@Ignore("impl_cssSet API removed")
228227
@Test public void cannotSpecifyEditableViaCSS() {
229-
// cell.impl_cssSet("-fx-editable", false);
228+
cell.setStyle("-fx-editable: false;");
229+
cell.applyCss();
230230
assertTrue(cell.isEditable());
231+
232+
cell.setEditable(false);
233+
assertFalse(cell.isEditable());
234+
235+
cell.setStyle("-fx-editable: true;");
236+
cell.applyCss();
237+
assertFalse(cell.isEditable());
231238
}
232239

233240
/*********************************************************************

modules/javafx.controls/src/test/java/test/javafx/scene/control/CheckBoxTest.java

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,6 @@
3737

3838
import static test.com.sun.javafx.scene.control.infrastructure.ControlTestUtils.*;
3939
import static org.junit.Assert.*;
40-
import org.junit.Ignore;
4140

4241
/**
4342
*/
@@ -185,10 +184,17 @@ public class CheckBoxTest {
185184
assertPseudoClassDoesNotExist(btn, "indeterminate");
186185
}
187186

188-
@Ignore("impl_cssSet API removed")
189187
@Test public void cannotSpecifyIndeterminateViaCSS() {
190-
// btn.impl_cssSet("-fx-indeterminate", true);
188+
btn.setStyle("-fx-indeterminate: true;");
189+
btn.applyCss();
191190
assertFalse(btn.isIndeterminate());
191+
192+
btn.setIndeterminate(true);
193+
assertTrue(btn.isIndeterminate());
194+
195+
btn.setStyle("-fx-indeterminate: false;");
196+
btn.applyCss();
197+
assertTrue(btn.isIndeterminate());
192198
}
193199

194200
/*********************************************************************
@@ -254,10 +260,17 @@ public class CheckBoxTest {
254260
assertPseudoClassDoesNotExist(btn, "selected");
255261
}
256262

257-
@Ignore("impl_cssSet API removed")
258263
@Test public void cannotSpecifySelectedViaCSS() {
259-
// btn.impl_cssSet("-fx-selected", true);
264+
btn.setStyle("-fx-selected: true;");
265+
btn.applyCss();
260266
assertFalse(btn.isSelected());
267+
268+
btn.setSelected(true);
269+
assertTrue(btn.isSelected());
270+
271+
btn.setStyle("-fx-selected: false;");
272+
btn.applyCss();
273+
assertTrue(btn.isSelected());
261274
}
262275

263276
/*********************************************************************
@@ -299,10 +312,17 @@ public class CheckBoxTest {
299312
assertEquals("allowIndeterminate", btn.allowIndeterminateProperty().getName());
300313
}
301314

302-
@Ignore("impl_cssSet API removed")
303315
@Test public void cannotSpecifyAllowIndeterminateViaCSS() {
304-
// btn.impl_cssSet("-fx-allow-indeterminate", true);
316+
btn.setStyle("-fx-allow-indeterminate: true;");
317+
btn.applyCss();
305318
assertFalse(btn.isAllowIndeterminate());
319+
320+
btn.setAllowIndeterminate(true);
321+
assertTrue(btn.isAllowIndeterminate());
322+
323+
btn.setStyle("-fx-allow-indeterminate: false;");
324+
btn.applyCss();
325+
assertTrue(btn.isAllowIndeterminate());
306326
}
307327

308328
/*********************************************************************

modules/javafx.controls/src/test/java/test/javafx/scene/control/ChoiceBoxTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -421,10 +421,17 @@ public void ensureValueIsUpdatedByCorrectSelectionModelWhenSelectionModelIsChang
421421
assertFalse(box.isShowing());
422422
}
423423

424-
@Ignore("impl_cssSet API removed")
425424
@Test public void cannotSpecifyShowingViaCSS() {
426-
// box.impl_cssSet("-fx-showing", true);
425+
box.setStyle("-fx-showing: true;");
426+
box.applyCss();
427427
assertFalse(box.isShowing());
428+
429+
box.show();
430+
assertTrue(box.isShowing());
431+
432+
box.setStyle("-fx-showing: false;");
433+
box.applyCss();
434+
assertTrue(box.isShowing());
428435
}
429436

430437
@Test public void settingShowingSetsPseudoClass() {

modules/javafx.controls/src/test/java/test/javafx/scene/control/DateCellTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -181,10 +181,17 @@ public void selectingAnEmptyCellResultsInNoChange() {
181181
assertTrue(cell.isEditable());
182182
}
183183

184-
@Ignore("impl_cssSet API removed")
185184
@Test public void cannotSpecifyEditableViaCSS() {
186-
// cell.impl_cssSet("-fx-editable", false);
185+
cell.setStyle("-fx-editable: false;");
186+
cell.applyCss();
187187
assertTrue(cell.isEditable());
188+
189+
cell.setEditable(false);
190+
assertFalse(cell.isEditable());
191+
192+
cell.setStyle("-fx-editable: true;");
193+
cell.applyCss();
194+
assertFalse(cell.isEditable());
188195
}
189196

190197
/*********************************************************************

0 commit comments

Comments
 (0)