Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8280951

Testbug: fix commented asserts in XXViewTest.test_rt_29650

    XMLWordPrintable

    Details

      Description

      The tests were added in the fix for JDK-8124615 (early variant of also firing cancel in commit, was rt_29650), XX = List, Tree/Table, Tree.

      They register handlers to count the events of every type and verify the expected number (1 for commit, 0 for cancel/start). They also try to test that the edited value actually is committed. This assert is commented for List, Tree/Table because it would fail due to the test bug. For Tree, it accidentally passes as a side-effect of JDK-8187309, JDK-8187473 (missing default commit handler, cell illegally saving data).

      The testbug is to add the counting commit handler via view.setOn which replaces the default (data saving) commit handler - thus nothing saved.

             listView.setOnEditCommit(t -> {
                  rt_29650_commit_count++;
              });
             
              ... //fire commit key on cell

              // TODO should the following assert be enabled?
             // assertEquals("Testing!", listView.getItems().get(0));


      The fix is to follow instructions of java doc (editing sections of xxView) and register the counting handler via addEventHandler.

      Note: for Tree, this will be fixed along with adding a default commit handler

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fastegal Jeanette Winzenburg
              Reporter:
              fastegal Jeanette Winzenburg
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: