Skip to content

Commit e31f9cf

Browse files
committed
Move away of direct Hamcrest usages
1 parent e339b19 commit e31f9cf

10 files changed

Lines changed: 29 additions & 101 deletions

File tree

changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/AddChangelogEntrySWTBotTest.java

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package org.eclipse.linuxtools.changelog.ui.tests.swtbot;
1111

1212
import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
13-
import static org.hamcrest.core.AllOf.allOf;
1413
import static org.junit.Assert.assertEquals;
1514
import static org.junit.Assert.assertNotNull;
1615
import static org.junit.Assert.assertNull;
@@ -32,9 +31,6 @@
3231
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
3332
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
3433
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
35-
import org.eclipse.ui.IEditorReference;
36-
import org.hamcrest.Matcher;
37-
import org.hamcrest.core.IsInstanceOf;
3834
import org.junit.After;
3935
import org.junit.Before;
4036
import org.junit.Ignore;
@@ -107,12 +103,8 @@ public void canAddChangeLogEntryUsingShortCutIfSourceIsActive() throws Exception
107103
// Open JavaTest.java in an editor
108104
projectExplorerViewTree.expandNode(PROJECT_NAME).expandNode("src").expandNode("JavaTest.java").doubleClick();
109105

110-
Matcher<IEditorReference> editorMatcher = allOf(
111-
IsInstanceOf.instanceOf(IEditorReference.class),
112-
withPartName("JavaTest.java")
113-
);
114106
// Wait for Java editor to open
115-
bot.waitUntil(Conditions.waitForEditor(editorMatcher));
107+
bot.waitUntil(Conditions.waitForEditor(withPartName("JavaTest.java")));
116108
SWTBotEditor swtBoteditor = bot.editorByTitle("JavaTest.java");
117109
SWTBotEclipseEditor eclipseEditor = swtBoteditor.toTextEditor();
118110

@@ -121,11 +113,7 @@ public void canAddChangeLogEntryUsingShortCutIfSourceIsActive() throws Exception
121113
// Press: CTRL + ALT + c
122114
eclipseEditor.pressShortcut(Keystrokes.CTRL, Keystrokes.ALT, KeyStroke.getInstance("c"));
123115
// Wait for ChangeLog editor to open
124-
editorMatcher = allOf(
125-
IsInstanceOf.instanceOf(IEditorReference.class),
126-
withPartName("ChangeLog")
127-
);
128-
bot.waitUntil(Conditions.waitForEditor(editorMatcher));
116+
bot.waitUntil(Conditions.waitForEditor(withPartName("ChangeLog")));
129117
swtBoteditor = bot.activeEditor();
130118
swtBoteditor.save(); // save to avoid "save changes"-pop-up
131119
assertEquals("ChangeLog", swtBoteditor.getTitle());
@@ -172,24 +160,16 @@ public void canAddChangeLogEntryUsingEditMenuIfSourceIsActive() throws Exception
172160
SWTBotTreeItem projectItem = projectExplorerViewTree.expandNode(PROJECT_NAME);
173161
projectItem.expandNode("src").expandNode("JavaTest.java").doubleClick();
174162

175-
Matcher<IEditorReference> editorMatcher = allOf(
176-
IsInstanceOf.instanceOf(IEditorReference.class),
177-
withPartName("JavaTest.java")
178-
);
179163
// Wait for editor to open
180-
bot.waitUntil(Conditions.waitForEditor(editorMatcher));
164+
bot.waitUntil(Conditions.waitForEditor(withPartName("JavaTest.java")));
181165
SWTBotEditor swtBoteditor = bot.editorByTitle("JavaTest.java");
182166
SWTBotEclipseEditor eclipseEditor = swtBoteditor.toTextEditor();
183167
eclipseEditor.selectLine(getLineOfOffsetMarker(sourceCode));
184168

185169
// Click menu item.
186170
bot.menu("Edit").menu("Insert ChangeLog entry").click();
187171
// Wait for ChangeLog editor to open
188-
editorMatcher = allOf(
189-
IsInstanceOf.instanceOf(IEditorReference.class),
190-
withPartName("ChangeLog")
191-
);
192-
bot.waitUntil(Conditions.waitForEditor(editorMatcher));
172+
bot.waitUntil(Conditions.waitForEditor(withPartName("ChangeLog")));
193173
swtBoteditor = bot.activeEditor();
194174
swtBoteditor.save(); // save to avoid "save changes"-pop-up
195175
assertEquals("ChangeLog", swtBoteditor.getTitle());

changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/CreateChangeLogFromHistorySWTBotTest.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package org.eclipse.linuxtools.changelog.ui.tests.swtbot;
1111

1212
import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
13-
import static org.hamcrest.core.AllOf.allOf;
1413
import static org.junit.Assert.assertEquals;
1514
import static org.junit.Assert.assertFalse;
1615
import static org.junit.Assert.assertNotNull;
@@ -39,9 +38,6 @@
3938
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
4039
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
4140
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
42-
import org.eclipse.ui.IEditorReference;
43-
import org.hamcrest.Matcher;
44-
import org.hamcrest.core.IsInstanceOf;
4541
import org.junit.After;
4642
import org.junit.Before;
4743
import org.junit.Ignore;
@@ -128,11 +124,7 @@ public void canPrepareChangeLogFromSVNHistory() throws Exception {
128124

129125
ProjectExplorer.expandProject(projectExplorerViewTree, PROJECT_NAME,
130126
teamProviderString).expandNode(pasteFile).select().doubleClick();
131-
Matcher<IEditorReference> editorMatcher = allOf(
132-
IsInstanceOf.instanceOf(IEditorReference.class),
133-
withPartName(pasteFile)
134-
);
135-
bot.waitUntil(Conditions.waitForEditor(editorMatcher));
127+
bot.waitUntil(Conditions.waitForEditor(withPartName(pasteFile)));
136128
oldTimeout = SWTBotPreferences.TIMEOUT;
137129
SWTBotPreferences.TIMEOUT = oldTimeout;
138130
SWTBotEditor swtBoteditor = bot.activeEditor();

changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/FormatChangeLogSWTBotTest.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package org.eclipse.linuxtools.changelog.ui.tests.swtbot;
1111

1212
import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
13-
import static org.hamcrest.core.AllOf.allOf;
1413
import static org.junit.Assert.assertEquals;
1514
import static org.junit.Assert.assertNotNull;
1615
import static org.junit.Assert.assertNull;
@@ -28,9 +27,6 @@
2827
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
2928
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
3029
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
31-
import org.eclipse.ui.IEditorReference;
32-
import org.hamcrest.Matcher;
33-
import org.hamcrest.core.IsInstanceOf;
3430
import org.junit.After;
3531
import org.junit.Before;
3632
import org.junit.Test;
@@ -90,11 +86,7 @@ public void canFormatChangeLogFile() throws Exception {
9086
oldTimeout = SWTBotPreferences.TIMEOUT;
9187
SWTBotPreferences.TIMEOUT = 3 * 5000;
9288
// Wait for ChangeLog editor to open
93-
Matcher<IEditorReference> editorMatcher = allOf(
94-
IsInstanceOf.instanceOf(IEditorReference.class),
95-
withPartName("ChangeLog")
96-
);
97-
bot.waitUntil(Conditions.waitForEditor(editorMatcher));
89+
bot.waitUntil(Conditions.waitForEditor(withPartName("ChangeLog")));
9890
SWTBotEditor swtBoteditor = bot.activeEditor();
9991
assertEquals("ChangeLog", swtBoteditor.getTitle());
10092

changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/PrepareChangelogSWTBotTest.java

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package org.eclipse.linuxtools.changelog.ui.tests.swtbot;
1111

1212
import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
13-
import static org.hamcrest.core.AllOf.allOf;
1413
import static org.junit.Assert.assertEquals;
1514
import static org.junit.Assert.assertNotNull;
1615
import static org.junit.Assert.assertTrue;
@@ -33,9 +32,6 @@
3332
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
3433
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
3534
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
36-
import org.eclipse.ui.IEditorReference;
37-
import org.hamcrest.Matcher;
38-
import org.hamcrest.core.IsInstanceOf;
3935
import org.junit.After;
4036
import org.junit.Before;
4137
import org.junit.Ignore;
@@ -101,11 +97,7 @@ public void canPrepareChangeLog() throws Exception {
10197
long oldTimeout = SWTBotPreferences.TIMEOUT;
10298
SWTBotPreferences.TIMEOUT = 3 * 5000;
10399
// Wait for ChangeLog editor to open
104-
Matcher<IEditorReference> editorMatcher = allOf(
105-
IsInstanceOf.instanceOf(IEditorReference.class),
106-
withPartName("ChangeLog")
107-
);
108-
bot.waitUntil(Conditions.waitForEditor(editorMatcher));
100+
bot.waitUntil(Conditions.waitForEditor(withPartName("ChangeLog")));
109101
SWTBotPreferences.TIMEOUT = oldTimeout;
110102

111103
SWTBotEditor swtBoteditor = bot.activeEditor();
@@ -147,11 +139,7 @@ public void canPrepareChangeLogAndSaveChangesInChangeLogFileToClipboard() throws
147139
oldTimeout = SWTBotPreferences.TIMEOUT;
148140
SWTBotPreferences.TIMEOUT = 3 * 5000;
149141
// Wait for ChangeLog editor to open
150-
Matcher<IEditorReference> editorMatcher = allOf(
151-
IsInstanceOf.instanceOf(IEditorReference.class),
152-
withPartName("ChangeLog")
153-
);
154-
bot.waitUntil(Conditions.waitForEditor(editorMatcher));
142+
bot.waitUntil(Conditions.waitForEditor(withPartName("ChangeLog")));
155143
SWTBotEditor swtBoteditor = bot.activeEditor();
156144
swtBoteditor.save(); // save to avoid "save changes"-pop-up
157145
assertEquals("ChangeLog", swtBoteditor.getTitle());
@@ -175,11 +163,7 @@ public void canPrepareChangeLogAndSaveChangesInChangeLogFileToClipboard() throws
175163
ProjectExplorer.expandProject(projectExplorerViewTree, PROJECT_NAME,
176164
teamProviderString).expandNode(pasteFile).select().doubleClick();
177165
//bot.activeShell().pressShortcut(Keystrokes.F3); // open file
178-
editorMatcher = allOf(
179-
IsInstanceOf.instanceOf(IEditorReference.class),
180-
withPartName(pasteFile)
181-
);
182-
bot.waitUntil(Conditions.waitForEditor(editorMatcher));
166+
bot.waitUntil(Conditions.waitForEditor(withPartName(pasteFile)));
183167
SWTBotPreferences.TIMEOUT = oldTimeout;
184168
swtBoteditor = bot.activeEditor();
185169
assertEquals(pasteFile, swtBoteditor.getTitle());

changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/utils/ContextMenuHelper.java

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
package org.eclipse.linuxtools.changelog.ui.tests.utils;
1515

1616
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic;
17-
import static org.hamcrest.core.AllOf.allOf;
18-
import static org.hamcrest.core.IsInstanceOf.instanceOf;
1917

2018
import java.util.Arrays;
19+
import java.util.function.Predicate;
2120

2221
import org.eclipse.swt.SWT;
2322
import org.eclipse.swt.SWTException;
@@ -29,7 +28,6 @@
2928
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
3029
import org.eclipse.swtbot.swt.finder.results.WidgetResult;
3130
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
32-
import org.hamcrest.Matcher;
3331

3432
public class ContextMenuHelper {
3533

@@ -50,18 +48,16 @@ public static void clickContextMenu(final AbstractSWTBot<?> bot,
5048
final String... texts) {
5149

5250
// show
53-
final MenuItem menuItem = UIThreadRunnable
54-
.syncExec((WidgetResult<MenuItem>) () -> {
55-
MenuItem theItem = getMenuItem(bot, texts);
56-
if (theItem != null && !theItem.isEnabled())
57-
throw new IllegalStateException("Menu item is diabled");
51+
final MenuItem menuItem = UIThreadRunnable.syncExec((WidgetResult<MenuItem>) () -> {
52+
MenuItem theItem = getMenuItem(bot, texts);
53+
if (theItem != null && !theItem.isEnabled())
54+
throw new IllegalStateException("Menu item is diabled");
5855

59-
return theItem;
60-
});
61-
if (menuItem == null) {
62-
throw new WidgetNotFoundException("Could not find menu: "
63-
+ Arrays.asList(texts));
64-
}
56+
return theItem;
57+
});
58+
if (menuItem == null) {
59+
throw new WidgetNotFoundException("Could not find menu: " + Arrays.asList(texts));
60+
}
6561

6662
// click
6763
click(menuItem);
@@ -82,9 +78,7 @@ private static MenuItem getMenuItem(final AbstractSWTBot<?> bot,
8278
control.notifyListeners(SWT.MenuDetect, new Event());
8379
Menu menu = control.getMenu();
8480
for (String text : texts) {
85-
Matcher<MenuItem> matcher = allOf(instanceOf(MenuItem.class),
86-
withMnemonic(text));
87-
theItem = show(menu, matcher);
81+
theItem = show(menu, item -> withMnemonic(text).matches(item));
8882
if (theItem != null) {
8983
menu = theItem.getMenu();
9084
} else {
@@ -95,12 +89,12 @@ private static MenuItem getMenuItem(final AbstractSWTBot<?> bot,
9589
return theItem;
9690
}
9791

98-
private static MenuItem show(final Menu menu, final Matcher<MenuItem> matcher) {
92+
private static MenuItem show(final Menu menu, final Predicate<MenuItem> matcher) {
9993
if (menu != null) {
10094
menu.notifyListeners(SWT.Show, new Event());
10195
MenuItem[] items = menu.getItems();
10296
for (final MenuItem menuItem : items) {
103-
if (matcher.matches(menuItem)) {
97+
if (matcher.test(menuItem)) {
10498
return menuItem;
10599
}
106100
}

perf/org.eclipse.linuxtools.perf.swtbot.tests/META-INF/MANIFEST.MF

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Fragment-Host: org.eclipse.linuxtools.perf
1111
Require-Bundle: junit-jupiter-api, junit-platform-suite-api,
1212
org.eclipse.linuxtools.profiling.tests,
1313
org.eclipse.swtbot.eclipse.finder;bundle-version="4.0.0",
14-
org.hamcrest,
1514
org.eclipse.swtbot.junit5_x
1615
Import-Package: org.slf4j
1716
Automatic-Module-Name: org.eclipse.linuxtools.perf.swtbot.tests

perf/org.eclipse.linuxtools.perf.swtbot.tests/src/org/eclipse/linuxtools/internal/perf/swtbot/tests/AbstractStyledTextViewTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@
1212
*******************************************************************************/
1313
package org.eclipse.linuxtools.internal.perf.swtbot.tests;
1414

15-
import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
1615
import static org.junit.jupiter.api.Assertions.assertEquals;
1716
import static org.junit.jupiter.api.Assertions.assertNotNull;
1817

1918
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
2019
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
2120
import org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText;
22-
import org.eclipse.ui.IViewReference;
23-
import org.hamcrest.Matcher;
2421

2522
/**
2623
* Specialized abstract SWTBot test for views containing
@@ -32,8 +29,7 @@ public abstract class AbstractStyledTextViewTest extends AbstractSWTBotTest {
3229
protected void testPerfView() {
3330
SWTWorkbenchBot bot = new SWTWorkbenchBot();
3431

35-
Matcher<IViewReference> withPartName = withPartName(getViewId());
36-
SWTBotView view = bot.view(withPartName);
32+
SWTBotView view = bot.viewByTitle(getViewId());
3733
assertNotNull(view);
3834

3935
view.setFocus();

profiling/org.eclipse.linuxtools.profiling.provider.tests/META-INF/MANIFEST.MF

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Bundle-Version: 1.2.0.qualifier
66
Bundle-RequiredExecutionEnvironment: JavaSE-21
77
Fragment-Host: org.eclipse.linuxtools.profiling.launch
88
Require-Bundle: junit-jupiter-api,
9-
org.hamcrest,
109
org.eclipse.linuxtools.profiling.tests,
1110
org.eclipse.swtbot.eclipse.finder;bundle-version="4.0.0",
1211
org.eclipse.swtbot.junit5_x

profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/PreferencesTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
4646
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
4747
import org.eclipse.ui.PlatformUI;
48-
import org.hamcrest.Matcher;
4948
import org.junit.jupiter.api.BeforeAll;
5049
import org.junit.jupiter.api.Disabled;
5150
import org.junit.jupiter.api.Test;
@@ -273,7 +272,7 @@ protected void setProfileAttributes(ILaunchConfigurationWorkingCopy wc) {
273272
private static void deselectSelectionByName(final String name, final SWTWorkbenchBot bot) {
274273
UIThreadRunnable.syncExec(() -> {
275274
@SuppressWarnings("unchecked")
276-
Matcher<Button> matcher = allOf(widgetOfType(Button.class), withStyle(SWT.RADIO, "SWT.RADIO"), //$NON-NLS-1$
275+
var matcher = allOf(widgetOfType(Button.class), withStyle(SWT.RADIO, "SWT.RADIO"), //$NON-NLS-1$
277276
withRegex(name + ".*")); //$NON-NLS-1$
278277

279278
Button b = bot.widget(matcher); // the current selection

systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf;
1717
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
1818
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withStyle;
19-
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withText;
2019
import static org.junit.Assert.assertEquals;
2120
import static org.junit.Assert.assertFalse;
2221
import static org.junit.Assert.assertTrue;
@@ -50,7 +49,6 @@
5049
import org.eclipse.swt.graphics.Point;
5150
import org.eclipse.swt.widgets.Button;
5251
import org.eclipse.swt.widgets.Event;
53-
import org.eclipse.swt.widgets.Shell;
5452
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
5553
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
5654
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
@@ -79,7 +77,6 @@
7977
import org.eclipse.swtchart.IAxis;
8078
import org.eclipse.swtchart.ISeries;
8179
import org.eclipse.swtchart.Range;
82-
import org.hamcrest.Matcher;
8380
import org.junit.After;
8481
import org.junit.AfterClass;
8582
import org.junit.BeforeClass;
@@ -479,10 +476,7 @@ public void testTapsetContents() {
479476
item = item.getNode(0);
480477
item.doubleClick();
481478

482-
{
483-
Matcher<Shell> withText = withText(dialogTitle);
484-
bot.waitUntil(Conditions.waitForShell(withText));
485-
}
479+
bot.waitUntil(Conditions.shellIsActive(dialogTitle));
486480

487481
shell = bot.shell(dialogTitle);
488482
shell.setFocus();
@@ -856,7 +850,7 @@ public void testGraphContents() {
856850
assertEquals("4", dataTable.cell(2, 2));
857851

858852
graphEditorA.bot().cTabItem(graphTitle1).activate();
859-
Matcher<AbstractChartBuilder> matcher = widgetOfType(AbstractChartBuilder.class);
853+
var matcher = widgetOfType(AbstractChartBuilder.class);
860854
AbstractChartBuilder cb = bot.widget(matcher);
861855
ISeries<?>[] series = cb.getChart().getSeriesSet().getSeries();
862856
assertEquals(2, series.length);
@@ -1012,7 +1006,7 @@ public void testLabelledGraphScript() {
10121006
String titlePie = title + " - Pie Chart";
10131007
String titleLine = title + " - Line Graph";
10141008
graphEditor.bot().cTabItem(titleLine).activate();
1015-
Matcher<AbstractChartBuilder> matcher = widgetOfType(AbstractChartBuilder.class);
1009+
var matcher = widgetOfType(AbstractChartBuilder.class);
10161010
AbstractChartBuilder cb = bot.widget(matcher);
10171011
assertEquals(numNumberItems, cb.getChart().getSeriesSet().getSeries()[0].getXSeries().length);
10181012

@@ -1262,7 +1256,7 @@ public void testGraphTooltips() {
12621256

12631257
// Perform mouse hover tests on graphs.
12641258
bot.activeEditor().bot().cTabItem(title.concat(" - Bar Graph")).activate();
1265-
final Matcher<AbstractChartBuilder> matcher = widgetOfType(AbstractChartBuilder.class);
1259+
var matcher = widgetOfType(AbstractChartBuilder.class);
12661260
AbstractChartBuilder cb = bot.widget(matcher);
12671261
String tooltipFormat = "{0}: {1}";
12681262
checkTooltipAtDataPoint(cb, 0, MessageFormat.format(tooltipFormat, "Column 1", "1"), true);
@@ -1443,8 +1437,7 @@ private static void createAndViewDummyData(String[] titles, Object[] data) {
14431437
private static void deselectDefaultSelection(final int currSelection) {
14441438
UIThreadRunnable.syncExec(() -> {
14451439
@SuppressWarnings("unchecked")
1446-
Matcher<Button> matcher = allOf(widgetOfType(Button.class), withStyle(SWT.RADIO, "SWT.RADIO"));
1447-
Button b = bot.widget(matcher, currSelection);
1440+
Button b = bot.widget(allOf(widgetOfType(Button.class), withStyle(SWT.RADIO, "SWT.RADIO")), currSelection);
14481441
b.setSelection(false);
14491442
});
14501443
}

0 commit comments

Comments
 (0)