Skip to content

Commit 109fa1b

Browse files
committed
Find/replace tests: assert proper selection of options
In case search options are not properly selected/unselected in tests, test may be effectively executed with different search options than expected and succeed without identifying issues when having the options properly selected/unselected. This adds according assertions to make sure that selection changes succeed. This also enhances the order of test execution in the texteditor test suite.
1 parent b95f727 commit 109fa1b

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

tests/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/internal/findandreplace/overlay/OverlayAccess.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public void select(SearchOptions option) {
122122
ToolItem button= getButtonForSearchOption(option);
123123
if (button != null) {
124124
button.notifyListeners(SWT.Selection, null);
125+
assertSelected(option);
125126
}
126127
}
127128

@@ -133,6 +134,7 @@ public void unselect(SearchOptions option) {
133134
ToolItem button= getButtonForSearchOption(option);
134135
if (button != null) {
135136
button.notifyListeners(SWT.Selection, null);
137+
assertUnselected(option);
136138
}
137139
}
138140

tests/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/DialogAccess.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public void select(SearchOptions option) {
132132
Button button= getButtonForSearchOption(option);
133133
button.setSelection(true);
134134
button.notifyListeners(SWT.Selection, null);
135+
assertSelected(option);
135136
}
136137

137138
@Override
@@ -145,6 +146,7 @@ public void unselect(SearchOptions option) {
145146
button.setSelection(false);
146147
}
147148
button.notifyListeners(SWT.Selection, null);
149+
assertUnselected(option);
148150
}
149151

150152

tests/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/WorkbenchTextEditorTestSuite.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*******************************************************************************/
1414
package org.eclipse.ui.workbench.texteditor.tests;
1515

16-
import org.junit.platform.suite.api.Suite;
1716
import org.junit.platform.suite.api.SelectClasses;
17+
import org.junit.platform.suite.api.Suite;
1818

1919
import org.eclipse.ui.internal.findandreplace.FindReplaceLogicTest;
2020
import org.eclipse.ui.internal.findandreplace.HistoryStoreTest;
@@ -46,9 +46,9 @@
4646
MinimapWidgetTest.class,
4747
TextEditorPluginTest.class,
4848
TextViewerDeleteLineTargetTest.class,
49-
FindReplaceDialogTest.class,
50-
FindReplaceOverlayTest.class,
5149
FindReplaceLogicTest.class,
50+
FindReplaceOverlayTest.class,
51+
FindReplaceDialogTest.class,
5252
HistoryStoreTest.class,
5353
})
5454
public class WorkbenchTextEditorTestSuite {

0 commit comments

Comments
 (0)