Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/org.eclipse.e4.ui.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ Import-Package: jakarta.annotation,
org.osgi.service.event,
org.junit.jupiter.api;version="[5.14.0,6.0.0)",
org.junit.jupiter.api.extension;version="[5.14.0,6.0.0)",
org.junit.platform.suite.api;version="[1.14.0,2.0.0)"
org.junit.platform.suite.api;version="[1.14.0,2.0.0)",
org.opentest4j
Eclipse-BundleShape: dir
Automatic-Module-Name: org.eclipse.e4.ui.tests
Require-Capability: eclipse.swt;filter:="(image.format=svg)"
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

package org.eclipse.e4.ui.tests.workbench;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import jakarta.inject.Inject;
import org.eclipse.e4.core.contexts.IEclipseContext;
Expand All @@ -27,18 +27,18 @@
import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer;
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.tests.rules.WorkbenchContextRule;
import org.eclipse.e4.ui.tests.rules.WorkbenchContextExtension;
import org.eclipse.e4.ui.workbench.IPresentationEngine;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

public class MPartTest {

@Rule
public WorkbenchContextRule contextRule = new WorkbenchContextRule();
@RegisterExtension
public WorkbenchContextExtension contextRule = new WorkbenchContextExtension();

@Inject
private IEclipseContext appContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

package org.eclipse.e4.ui.tests.workbench;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeFalse;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeFalse;

import jakarta.inject.Inject;
import org.eclipse.core.runtime.Platform;
Expand All @@ -37,7 +37,7 @@
import org.eclipse.e4.ui.model.application.ui.menu.MMenu;
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem;
import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.e4.ui.tests.rules.WorkbenchContextRule;
import org.eclipse.e4.ui.tests.rules.WorkbenchContextExtension;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.swt.SWT;
Expand All @@ -51,14 +51,14 @@
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.tests.harness.util.DisplayHelper;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

public class MWindowTest {

@Rule
public WorkbenchContextRule contextRule = new WorkbenchContextRule();
@RegisterExtension
public WorkbenchContextExtension contextRule = new WorkbenchContextExtension();

@Inject
private IEclipseContext appContext;
Expand All @@ -71,7 +71,7 @@ public class MWindowTest {

@Test
public void testCreateWindow() {
assumeFalse("Test fails on Mac: Bug 537639", Platform.OS_MACOSX.equals(Platform.getOS()));
assumeFalse(Platform.OS_MACOSX.equals(Platform.getOS()), "Test fails on Mac: Bug 537639");

final MWindow window = ems.createModelElement(MWindow.class);
window.setLabel("MyWindow");
Expand Down Expand Up @@ -147,7 +147,7 @@ public void testCreateView() {

@Test
public void testContextChildren() {
assumeFalse("Test fails on Mac: Bug 537639", Platform.OS_MACOSX.equals(Platform.getOS()));
assumeFalse(Platform.OS_MACOSX.equals(Platform.getOS()), "Test fails on Mac: Bug 537639");

final MWindow window = createWindowWithOneView();

Expand Down Expand Up @@ -250,7 +250,7 @@ public void testWindow_Name() {
assertEquals("windowName2", shell.getText());
}

@Ignore
@Disabled
@Test
public void TODOtestWindow_X() {
final MWindow window = ems.createModelElement(MWindow.class);
Expand Down Expand Up @@ -283,7 +283,7 @@ public void TODOtestWindow_X() {
assertEquals(300, bounds.x);
}

@Ignore
@Disabled
@Test
public void TODOtestWindow_Y() {
final MWindow window = ems.createModelElement(MWindow.class);
Expand Down Expand Up @@ -387,22 +387,22 @@ public void testDetachedWindow() {
Shell topShell = (Shell) window.getWidget();
Shell detachedShell = (Shell) detachedWindow.getWidget();
assertEquals(window, ems.getContainer(detachedWindow));
assertNull("Should have no shell image", topShell.getImage());
assertEquals("Detached should have same image", topShell.getImage(), detachedShell.getImage());
assertNull(topShell.getImage(), "Should have no shell image");
assertEquals(topShell.getImage(), detachedShell.getImage(), "Detached should have same image");

// now set icon on top-level window; detached window should inherit it
window.setIconURI("platform:/plugin/org.eclipse.e4.ui.tests/icons/filenav_nav.svg");
while (topShell.getDisplay().readAndDispatch()) {
}
assertNotNull("Should have shell image", topShell.getImage());
assertEquals("Detached should have same image", topShell.getImage(), detachedShell.getImage());
assertNotNull(topShell.getImage(), "Should have shell image");
assertEquals(topShell.getImage(), detachedShell.getImage(), "Detached should have same image");

// change top-level icon; detached window should inherit it
window.setIconURI(null);
while (topShell.getDisplay().readAndDispatch()) {
}
assertNull("Should have no shell image", topShell.getImage());
assertEquals("Detached should have same image", topShell.getImage(), detachedShell.getImage());
assertNull(topShell.getImage(), "Should have no shell image");
assertEquals(topShell.getImage(), detachedShell.getImage(), "Detached should have same image");

// turn detached into top-level window; inherited icon should be removed
window.setIconURI("platform:/plugin/org.eclipse.e4.ui.tests/icons/filenav_nav.svg");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

package org.eclipse.e4.ui.tests.workbench;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import jakarta.inject.Inject;
import org.eclipse.e4.ui.internal.workbench.PartOnTopManager;
Expand All @@ -29,21 +29,21 @@
import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer;
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.tests.rules.WorkbenchContextRule;
import org.eclipse.e4.ui.tests.rules.WorkbenchContextExtension;
import org.eclipse.e4.ui.workbench.IWorkbench;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

/**
* This test class is used to validate the correctness of the
* {@link PartOnTopManager}.
*/
public class PartOnTopManagerTest {

@Rule
public WorkbenchContextRule contextRule = new WorkbenchContextRule();
@RegisterExtension
public WorkbenchContextExtension contextRule = new WorkbenchContextExtension();

@Inject
private EModelService ems;
Expand Down
Loading
Loading