< prev index next >

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

Print this page
rev 8906 : RT-46083: TimelineClipCore exceptions handling improvent

*** 76,85 **** --- 76,86 ---- import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import com.sun.javafx.scene.control.TableColumnComparatorBase.TableColumnComparator; + import com.sun.javafx.scene.control.infrastructure.ControlTestUtils; import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils; import com.sun.javafx.scene.control.test.Person; import com.sun.javafx.scene.control.test.RT_22463_Person; import static com.sun.javafx.scene.control.skin.TableColumnHeaderRetriever.*;
*** 3547,3561 **** sl.dispose(); } @Test public void test_rt_37429() { - // 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) -> fail("We don't expect any exceptions in this test!")); - // table columns - 1 column; name TableColumn<String, String> nameColumn = new TableColumn<>("name"); nameColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper(param.getValue())); nameColumn.setPrefWidth(200); --- 3548,3557 ----
*** 3576,3594 **** c.getAddedSubList(); } } }); StageLoader sl = new StageLoader(table); ! table.getSelectionModel().select(0); table.getSortOrder().add(nameColumn); ! sl.dispose(); ! ! // reset the exception handler ! Thread.currentThread().setUncaughtExceptionHandler(exceptionHandler); } private int rt_37429_items_change_count = 0; private int rt_37429_cells_change_count = 0; @Test public void test_rt_37429_sortEventsShouldNotFireExtraChangeEvents() { --- 3572,3590 ---- c.getAddedSubList(); } } }); + final Thread.UncaughtExceptionHandler exceptionHandler = ControlTestUtils.setHandler(); StageLoader sl = new StageLoader(table); ! try { table.getSelectionModel().select(0); table.getSortOrder().add(nameColumn); ! } finally { sl.dispose(); ! ControlTestUtils.resetHandler(exceptionHandler); ! } } private int rt_37429_items_change_count = 0; private int rt_37429_cells_change_count = 0; @Test public void test_rt_37429_sortEventsShouldNotFireExtraChangeEvents() {
< prev index next >