Community
Participate
Working Groups
Build ID: I20081211-1908 There are a number of methods in CheckboxTreeViewer which have no tests and could easily be tested.
Created attachment 120602 [details] More CheckboxTreeViewer tests Tests now cover almost all methods in CheckboxTreeViewer - the only ones not covered are the selection handlers and CheckStateListeners, which are user-input dependent. CheckboxTreeViewer coverage: from 48.0% -> 81.9% org.eclipse.jface.viewers coverage: from 51.2% -> 52.2% (in JFace-All Tests)
Created attachment 120745 [details] More CheckboxTableViewer tests While I was at it, I added some tests for the CheckboxTableViewer. The CheckboxTableViewer has a number of ways to instantiate it. To support these, I subclassed the CheckboxTableViewerTest and overrode the createViewer method. This may not be the optimal solution as each test class takes about 1.5 seconds to run. The static factory method was not being tested, so now it is. I also test the deprecated constructors, which may not be necessary - they actually required me to change a test, as they have some unexpected behaviour. Coverage improvement: on CheckboxTableViewer, from 47.7% to 84.6%. I only left out the UI selection routines.
Created attachment 120847 [details] More StructuredViewer Tests As I continue to prove this bug is badly named... these tests boost the code coverage on Viewer from 11.4% to 66.7%.
Released to HEAD. Thanks, Matthew!
JUnits run fine in the I20090128-1800 build: testSetAndGetData testSetAllChecked testSetGrayChecked testSetGrayedElements testGetCheckedElements testSetCheckedElements