changeset 10867:7b81aa65d75a

8197488: [testbug] IllegalStateException logged while running unit tests TreeTableViewTest and TableViewTest Reviewed-by: kcr, aghaisas
author rkamath
date Fri, 09 Mar 2018 15:01:47 +0530
parents e494eba6d6a2
children d27327f09524
files modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewTest.java modules/javafx.controls/src/test/java/test/javafx/scene/control/TreeTableViewTest.java
diffstat 2 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewTest.java	Fri Mar 09 14:54:57 2018 +0530
+++ b/modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewTest.java	Fri Mar 09 15:01:47 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -4787,12 +4787,12 @@
         // as ListListenerHelp intercepts the exception otherwise
         final Thread.UncaughtExceptionHandler exceptionHandler = Thread.currentThread().getUncaughtExceptionHandler();
         Thread.currentThread().setUncaughtExceptionHandler((t, e) -> {
-            e.printStackTrace();
 
             if (test_rt_39822_count == 0) {
                 test_rt_39822_count++;
                 if (! (e instanceof IllegalStateException)) {
-                    fail("Incorrect exception type - expecting IllegalStateException");
+                    e.printStackTrace();
+                    fail("Expected IllegalStateException, instead got " + e);
                 }
             } else {
                 // don't care
@@ -5186,9 +5186,9 @@
         sm.setSelectionMode(SelectionMode.MULTIPLE);
 
         TableColumn<Person, String> c1 = new TableColumn<>("First Name");
-        c1.setCellValueFactory(new PropertyValueFactory<>("firstname"));
+        c1.setCellValueFactory(new PropertyValueFactory<>("firstName"));
         TableColumn<Person, String> c2 = new TableColumn<>("Last Name");
-        c2.setCellValueFactory(new PropertyValueFactory<>("lastname"));
+        c2.setCellValueFactory(new PropertyValueFactory<>("lastName"));
         t.getColumns().addAll(c1, c2);
 
         final int startIndex = toRight ? 0 : 2;
@@ -5220,9 +5220,9 @@
         sm.setSelectionMode(SelectionMode.MULTIPLE);
 
         TableColumn<Person, String> c1 = new TableColumn<>("First Name");
-        c1.setCellValueFactory(new PropertyValueFactory<>("firstname"));
+        c1.setCellValueFactory(new PropertyValueFactory<>("firstName"));
         TableColumn<Person, String> c2 = new TableColumn<>("Last Name");
-        c2.setCellValueFactory(new PropertyValueFactory<>("lastname"));
+        c2.setCellValueFactory(new PropertyValueFactory<>("lastName"));
         t.getColumns().addAll(c1, c2);
 
         p.add(new Person("FirstName1", "LastName1", ""));
--- a/modules/javafx.controls/src/test/java/test/javafx/scene/control/TreeTableViewTest.java	Fri Mar 09 14:54:57 2018 +0530
+++ b/modules/javafx.controls/src/test/java/test/javafx/scene/control/TreeTableViewTest.java	Fri Mar 09 15:01:47 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2075,8 +2075,8 @@
         tableView.setMinHeight(100);
         tableView.setPrefHeight(100);
 
-        TreeTableColumn firstNameCol = new TreeTableColumn("First Name");
-        firstNameCol.setCellValueFactory(new TreeItemPropertyValueFactory<Person, String>("firstName"));
+        TreeTableColumn<String, String> firstNameCol = new TreeTableColumn<>("First Name");
+        firstNameCol.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().getValue()));
         firstNameCol.setCellFactory(CheckBoxTreeTableCell.forTreeTableColumn(param -> new ReadOnlyBooleanWrapper(true)));
         tableView.getColumns().add(firstNameCol);
 
@@ -3006,7 +3006,7 @@
         group2.getChildren().addAll(employee1, employee2);
 
         TreeTableColumn<String, String> nameColumn = new TreeTableColumn<>("Name");
-        nameColumn.setCellValueFactory(new TreeItemPropertyValueFactory<String, String>("name"));
+        nameColumn.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().getValue()));
         view.getColumns().add(nameColumn);
 
         view.expandedItemCountProperty().addListener((observableValue, oldCount, newCount) -> {
@@ -5238,12 +5238,12 @@
         // as ListListenerHelp intercepts the exception otherwise
         final Thread.UncaughtExceptionHandler exceptionHandler = Thread.currentThread().getUncaughtExceptionHandler();
         Thread.currentThread().setUncaughtExceptionHandler((t, e) -> {
-            e.printStackTrace();
 
             if (test_rt_39822_count == 0) {
                 test_rt_39822_count++;
                 if (! (e instanceof IllegalStateException)) {
-                    fail("Incorrect exception type - expecting IllegalStateException");
+                    e.printStackTrace();
+                    fail("Expected IllegalStateException, instead got " + e);
                 }
             } else {
                 // don't care