modules/controls/src/test/java/javafx/scene/control/skin/ChoiceBoxSkinTest.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization

*** 21,38 **** * 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. */ ! package com.sun.javafx.scene.control.skin; import static org.junit.Assert.assertEquals; import javafx.geometry.Insets; import javafx.scene.control.ChoiceBox; import org.junit.Before; - import org.junit.Ignore; import org.junit.Test; /** * This fails with IllegalStateException because of the toolkit's check for the FX application thread */ --- 21,40 ---- * 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. */ ! package javafx.scene.control.skin; import static org.junit.Assert.assertEquals; + + import javafx.beans.value.ObservableValue; import javafx.geometry.Insets; import javafx.scene.control.ChoiceBox; + import javafx.scene.control.skin.ChoiceBoxSkin; import org.junit.Before; import org.junit.Test; /** * This fails with IllegalStateException because of the toolkit's check for the FX application thread */
*** 64,75 **** int propertyChangeCount = 0; public ChoiceBoxSkinMock(ChoiceBox choicebox) { super(choicebox); } ! @Override protected void handleControlPropertyChanged(String p) { ! super.handleControlPropertyChanged(p); propertyChanged = true; propertyChangeCount++; } } } --- 66,78 ---- int propertyChangeCount = 0; public ChoiceBoxSkinMock(ChoiceBox choicebox) { super(choicebox); } ! public void addWatchedProperty(ObservableValue<?> p) { ! p.addListener(o -> { propertyChanged = true; propertyChangeCount++; + }); } } }