< prev index next >
modules/controls/src/test/java/javafx/scene/control/TreeTableViewKeyInputTest.java
Print this page
rev 8906 : RT-46083: TimelineClipCore exceptions handling improvent
*** 36,45 ****
--- 36,46 ----
import java.util.function.Function;
import com.sun.javafx.PlatformUtil;
import com.sun.javafx.util.Utils;
import com.sun.javafx.scene.control.behavior.TreeTableViewAnchorRetriever;
+ import com.sun.javafx.scene.control.infrastructure.ControlTestUtils;
import com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
import com.sun.javafx.scene.control.infrastructure.KeyModifier;
import com.sun.javafx.scene.control.infrastructure.StageLoader;
import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
import com.sun.javafx.tk.Toolkit;
*** 3999,4016 ****
@Test public void test_rt36800_cellSelection() {
test_rt36800(true);
}
private void test_rt36800(boolean cellSelection) {
- // get the current exception handler before replacing with our own,
- // as ListListenerHelp intercepts the exception otherwise
- final Thread.UncaughtExceptionHandler exceptionHandler = Thread.currentThread().getUncaughtExceptionHandler();
- Thread.currentThread().setUncaughtExceptionHandler((t, e) -> {
- e.printStackTrace();
- fail("We don't expect any exceptions in this test!");
- });
-
final int items = 10;
root.getChildren().clear();
root.setExpanded(true);
for (int i = 0; i < items; i++) {
root.getChildren().add(new TreeItem<>("Row " + i));
--- 4000,4009 ----
*** 4039,4049 ****
--- 4032,4048 ----
keyboard.doKeyPress(KeyCode.UP, KeyModifier.SHIFT); // 4
keyboard.doKeyPress(KeyCode.UP, KeyModifier.SHIFT); // 3
keyboard.doKeyPress(KeyCode.UP, KeyModifier.SHIFT); // 2
keyboard.doKeyPress(KeyCode.UP, KeyModifier.SHIFT); // 1
keyboard.doKeyPress(KeyCode.UP, KeyModifier.SHIFT); // 0
+
+ final Thread.UncaughtExceptionHandler exceptionHandler = ControlTestUtils.setHandler();
+ try {
keyboard.doKeyPress(KeyCode.UP, KeyModifier.SHIFT); // bug time?
+ } finally {
+ ControlTestUtils.resetHandler(exceptionHandler);
+ }
if (cellSelection) {
assertEquals(0, getAnchor().getRow());
assertEquals(col, getAnchor().getTableColumn());
assertTrue(fm.isFocused(0, col));
*** 4061,4073 ****
assertFalse(sm.isSelected(2));
assertFalse(sm.isSelected(3));
assertFalse(sm.isSelected(4));
assertFalse(sm.isSelected(5));
}
-
- // reset the exception handler
- Thread.currentThread().setUncaughtExceptionHandler(exceptionHandler);
}
@Test public void test_rt_37130_pageUpAtTop() {
final int items = 100;
root.getChildren().clear();
--- 4060,4069 ----
< prev index next >