|
@@ -52,8 +52,8 @@ public class VetoableListSelectionModelTest {
|
52
|
52
|
@Test
|
53
|
53
|
public void testInitialState() {
|
54
|
54
|
final VetoableListSelectionModel instance = new VetoableListSelectionModel();
|
55
|
|
- assertEquals(instance.getLeadSelectionIndex(), -1);
|
56
|
|
- assertEquals(instance.getSelectionMode(), SINGLE_SELECTION);
|
|
55
|
+ assertEquals(-1, instance.getLeadSelectionIndex());
|
|
56
|
+ assertEquals(SINGLE_SELECTION, instance.getSelectionMode());
|
57
|
57
|
assertFalse(instance.getValueIsAdjusting());
|
58
|
58
|
}
|
59
|
59
|
|
|
@@ -61,7 +61,7 @@ public class VetoableListSelectionModelTest {
|
61
|
61
|
public void testNonVetoed() {
|
62
|
62
|
final VetoableListSelectionModel instance = new VetoableListSelectionModel();
|
63
|
63
|
instance.setLeadSelectionIndex(5);
|
64
|
|
- assertEquals(instance.getLeadSelectionIndex(), 5);
|
|
64
|
+ assertEquals(5, instance.getLeadSelectionIndex());
|
65
|
65
|
}
|
66
|
66
|
|
67
|
67
|
@Test
|
|
@@ -69,7 +69,7 @@ public class VetoableListSelectionModelTest {
|
69
|
69
|
final VetoableListSelectionModel instance = new VetoableListSelectionModel();
|
70
|
70
|
instance.addVetoableSelectionListener(vetoListener);
|
71
|
71
|
instance.setLeadSelectionIndex(5);
|
72
|
|
- assertEquals(instance.getLeadSelectionIndex(), 5);
|
|
72
|
+ assertEquals(5, instance.getLeadSelectionIndex());
|
73
|
73
|
verify(vetoListener).vetoableChange(any(PropertyChangeEvent.class));
|
74
|
74
|
}
|
75
|
75
|
|
|
@@ -80,7 +80,7 @@ public class VetoableListSelectionModelTest {
|
80
|
80
|
final VetoableListSelectionModel instance = new VetoableListSelectionModel();
|
81
|
81
|
instance.addVetoableSelectionListener(vetoListener);
|
82
|
82
|
instance.setLeadSelectionIndex(5);
|
83
|
|
- assertEquals(instance.getLeadSelectionIndex(), -1);
|
|
83
|
+ assertEquals(-1, instance.getLeadSelectionIndex());
|
84
|
84
|
}
|
85
|
85
|
|
86
|
86
|
@Test
|
|
@@ -88,7 +88,7 @@ public class VetoableListSelectionModelTest {
|
88
|
88
|
final VetoableListSelectionModel instance = new VetoableListSelectionModel();
|
89
|
89
|
instance.addListSelectionListener(selectionListener);
|
90
|
90
|
instance.setLeadSelectionIndex(5);
|
91
|
|
- assertEquals(instance.getLeadSelectionIndex(), 5);
|
|
91
|
+ assertEquals(5, instance.getLeadSelectionIndex());
|
92
|
92
|
verify(selectionListener).valueChanged(any(ListSelectionEvent.class));
|
93
|
93
|
}
|
94
|
94
|
|
|
@@ -98,7 +98,7 @@ public class VetoableListSelectionModelTest {
|
98
|
98
|
instance.addListSelectionListener(selectionListener);
|
99
|
99
|
instance.addVetoableSelectionListener(vetoListener);
|
100
|
100
|
instance.setLeadSelectionIndex(5);
|
101
|
|
- assertEquals(instance.getLeadSelectionIndex(), 5);
|
|
101
|
+ assertEquals(5, instance.getLeadSelectionIndex());
|
102
|
102
|
verify(vetoListener).vetoableChange(any(PropertyChangeEvent.class));
|
103
|
103
|
verify(selectionListener).valueChanged(any(ListSelectionEvent.class));
|
104
|
104
|
}
|
|
@@ -111,7 +111,7 @@ public class VetoableListSelectionModelTest {
|
111
|
111
|
instance.addListSelectionListener(selectionListener);
|
112
|
112
|
instance.addVetoableSelectionListener(vetoListener);
|
113
|
113
|
instance.setLeadSelectionIndex(5);
|
114
|
|
- assertEquals(instance.getLeadSelectionIndex(), -1);
|
|
114
|
+ assertEquals(-1, instance.getLeadSelectionIndex());
|
115
|
115
|
verify(vetoListener).vetoableChange(any(PropertyChangeEvent.class));
|
116
|
116
|
verify(selectionListener, never()).valueChanged(any(ListSelectionEvent.class));
|
117
|
117
|
}
|
|
@@ -120,9 +120,9 @@ public class VetoableListSelectionModelTest {
|
120
|
120
|
public void testClearSelection() {
|
121
|
121
|
final VetoableListSelectionModel instance = new VetoableListSelectionModel();
|
122
|
122
|
instance.setLeadSelectionIndex(5);
|
123
|
|
- assertEquals(instance.getLeadSelectionIndex(), 5);
|
|
123
|
+ assertEquals(5, instance.getLeadSelectionIndex());
|
124
|
124
|
instance.clearSelection();
|
125
|
|
- assertEquals(instance.getLeadSelectionIndex(), -1);
|
|
125
|
+ assertEquals(-1, instance.getLeadSelectionIndex());
|
126
|
126
|
}
|
127
|
127
|
|
128
|
128
|
@Test
|