Skip to content

Commit

Permalink
Fix several tests on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Krause committed Nov 26, 2024
1 parent 408221a commit fab54a5
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 99 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="Hexatomic Target Platform Definition" sequenceNumber="1732633161">
<target name="Hexatomic Target Platform Definition" sequenceNumber="1732642118">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.justj.openjdk.hotspot.jre.full.stripped.feature.group" version="21.0.5.v20241023-1957"/>
<repository location="https://download.eclipse.org/justj/jres/21/updates/release/21.0.5"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.equinox.p2.core.feature.feature.group" version="1.7.200.v20240515-1919"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.23.1200.v20240524-2033"/>
<unit id="org.eclipse.sdk.feature.group" version="4.32.0.v20240601-0610"/>
<unit id="org.eclipse.zest.sdk.feature.group" version="3.20.0.202405290843"/>
<unit id="slf4j.api" version="2.0.13"/>
<unit id="org.eclipse.equinox.p2.core.feature.feature.group" version="1.7.300.v20240801-1024"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.23.1400.v20240820-0604"/>
<unit id="org.eclipse.sdk.feature.group" version="4.33.0.v20240903-0618"/>
<unit id="org.eclipse.zest.sdk.feature.group" version="3.21.0.202409021815"/>
<unit id="slf4j.api" version="2.0.16"/>
<unit id="org.apache.aries.spifly.dynamic.bundle" version="1.3.7"/>
<unit id="ch.qos.logback.classic" version="1.5.6"/>
<unit id="junit-jupiter-api" version="5.10.2"/>
<unit id="org.hamcrest" version="2.2.0"/>
<unit id="ch.qos.logback.classic" version="1.5.7"/>
<unit id="junit-jupiter-api" version="5.11.0"/>
<unit id="org.hamcrest" version="3.0.0"/>
<unit id="org.antlr.runtime" version="4.7.2.v20221112-0806"/>
<unit id="jakarta.servlet-api" version="6.0.0"/>
<unit id="jakarta.servlet-api" version="6.1.0"/>
<unit id="jakarta.inject.jakarta.inject-api" version="2.0.1"/>
<unit id="jakarta.annotation-api" version="2.1.1"/>
<unit id="com.google.guava" version="33.2.0.jre"/>
<unit id="org.apache.commons.lang3" version="3.14.0"/>
<repository location="https://download.eclipse.org/releases/2024-06/"/>
<unit id="com.google.guava" version="33.3.0.jre"/>
<unit id="org.apache.commons.lang3" version="3.16.0"/>
<repository location="https://download.eclipse.org/releases/2024-09/"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.mockito.mockito-core" version="5.12.0"/>
<repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-06"/>
<repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-09"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.nebula.widgets.nattable.core" version="2.4.0.202405230453"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ location "https://download.eclipse.org/justj/jres/21/updates/release/21.0.5" {
org.eclipse.justj.openjdk.hotspot.jre.full.stripped.feature.group
}

location "https://download.eclipse.org/releases/2024-06/" {
location "https://download.eclipse.org/releases/2024-09/" {
// Eclipse platform
org.eclipse.equinox.p2.core.feature.feature.group
org.eclipse.equinox.sdk.feature.group
Expand All @@ -28,7 +28,7 @@ location "https://download.eclipse.org/releases/2024-06/" {
}


location "https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-06" {
location "https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-09" {
org.mockito.mockito-core
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</listAttribute>
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
<mapEntry key="GDK_BACKEND" value="x11"/>
<mapEntry key="LANG" value="en_US.UTF-8"/>
</mapAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.corpus_tools.hexatomic.it.tests"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class TestGraphEditor {
private ProjectManager projectManager;
private UiStatusReport uiStatus;

private final Keyboard keyboard = KeyboardFactory.getSWTKeyboard();
private final Keyboard keyboard = TestHelper.getAWTKeyboard();

private final class NumberOfShellsIncreased extends DefaultCondition {
private final int oldNumberOfShells;
Expand Down Expand Up @@ -540,11 +540,12 @@ void testShowSaltExample()

// Initially, the zoom is adjusted to match the height, so moving up/down should
// not do anything
keyboard.pressShortcut(Keystrokes.DOWN);
Keyboard swtKeyboard = KeyboardFactory.getSWTKeyboard();
swtKeyboard.pressShortcut(Keystrokes.DOWN);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.UP);
swtKeyboard.pressShortcut(Keystrokes.UP);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
Expand All @@ -560,52 +561,52 @@ void testShowSaltExample()

// Scroll with arrow keys (left, right, up, down) and check that that view has
// been moved
keyboard.pressShortcut(Keystrokes.RIGHT);
swtKeyboard.pressShortcut(Keystrokes.RIGHT);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x + 25, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.LEFT);
swtKeyboard.pressShortcut(Keystrokes.LEFT);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.DOWN);
swtKeyboard.pressShortcut(Keystrokes.DOWN);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y + 25)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.UP);
swtKeyboard.pressShortcut(Keystrokes.UP);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.PAGE_DOWN);
swtKeyboard.pressShortcut(Keystrokes.PAGE_DOWN);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y + 25)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.PAGE_UP);
swtKeyboard.pressShortcut(Keystrokes.PAGE_UP);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);

keyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.RIGHT);
swtKeyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.RIGHT);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x + 250, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.LEFT);
swtKeyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.LEFT);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.DOWN);
swtKeyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.DOWN);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y + 250)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.UP);
swtKeyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.UP);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.PAGE_DOWN);
swtKeyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.PAGE_DOWN);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y + 250)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.PAGE_UP);
swtKeyboard.pressShortcut(Keystrokes.SHIFT, Keystrokes.PAGE_UP);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
Expand All @@ -614,11 +615,11 @@ void testShowSaltExample()
KeyStroke[] strokesZoomOut = {Keystrokes.CTRL, KeyStroke.getInstance(0, SWT.KEYPAD_SUBTRACT)};
mockKeyboadForGraph.pressShortcut(strokesZoomOut);
origLocation = (Point) SWTUtils.invokeMethod(viewPort, GET_VIEW_LOCATION);
keyboard.pressShortcut(Keystrokes.DOWN);
swtKeyboard.pressShortcut(Keystrokes.DOWN);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
keyboard.pressShortcut(Keystrokes.UP);
swtKeyboard.pressShortcut(Keystrokes.UP);
bot.waitUntil(
new ViewLocationReachedCondition(viewPort, new Point(origLocation.x, origLocation.y)),
SWTBotPreferences.TIMEOUT, 100);
Expand Down Expand Up @@ -799,13 +800,12 @@ void testFilterOptions() {
// Tokens and the matching structure nodes
annoFilter.setFocus();
int oldNumberOfShells = bot.shells().length;
keyboard.pressShortcut(KeyStroke.getInstance('c'), KeyStroke.getInstance('o'),
KeyStroke.getInstance('n'), KeyStroke.getInstance('s'), KeyStroke.getInstance('t'));
annoFilter.setFocus();
annoFilter.typeText("const");

// wait for PopupDialog shell
bot.waitUntil(new NumberOfShellsIncreased(oldNumberOfShells));


MockKeyboardStrategy mockKeyboardStrategy = new MockKeyboardStrategy();
mockKeyboardStrategy.init(annoFilter.widget, desc -> desc.appendText("Filter text widget"));
mockKeyboardStrategy.pressKeys(Keystrokes.LF);
Expand All @@ -815,10 +815,7 @@ void testFilterOptions() {

// Tokens and the matching spans
annoFilter.setFocus();
keyboard.pressShortcut(KeyStroke.getInstance('i'), KeyStroke.getInstance('n'),
KeyStroke.getInstance('f'), KeyStroke.getInstance('-'), KeyStroke.getInstance('s'),
KeyStroke.getInstance('t'), KeyStroke.getInstance('r'), KeyStroke.getInstance('u'),
KeyStroke.getInstance('c'), KeyStroke.getInstance('t'));
annoFilter.typeText("inf");

bot.waitUntil(new NumberOfShellsIncreased(oldNumberOfShells));

Expand Down
Loading

0 comments on commit fab54a5

Please sign in to comment.