Skip to content
Open
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
11 changes: 11 additions & 0 deletions features/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>features</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
4 changes: 2 additions & 2 deletions tests/org.eclipse.jface.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Bundle-SymbolicName: org.eclipse.jface.tests
Bundle-Version: 1.5.0.qualifier
Automatic-Module-Name: org.eclipse.jface.tests
Bundle-RequiredExecutionEnvironment: JavaSE-21
Require-Bundle: org.junit;bundle-version="4.12.0",
org.eclipse.jface,
Require-Bundle: org.eclipse.jface,
org.eclipse.equinox.registry,
org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.ui.tests.harness
Import-Package: 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.jupiter.api.function;version="[5.14.0,6.0.0)",
org.junit.jupiter.api.io;version="[5.14.0,6.0.0)",
org.junit.platform.commons.function;version="[1.14.0,2.0.0)",
org.junit.platform.suite.api;version="[1.14.0,2.0.0)",
org.opentest4j;version="1.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.jface.tests.action;

import org.junit.runner.JUnitCore;


import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;
Expand All @@ -23,8 +23,6 @@
MenuManagerTest.class })
public class AllActionTests {

public static void main(String[] args) {
JUnitCore.main(AllActionTests.class.getName());
}


}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.jface.tests.dialogs;

import org.junit.runner.JUnitCore;


import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;
Expand All @@ -24,7 +24,5 @@
ProgressMonitorDialogTest.class, PlainMessageDialogTest.class })
public class AllDialogTests {

public static void main(String[] args) {
JUnitCore.main(AllDialogTests.class.getName());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
******************************************************************************/
package org.eclipse.jface.tests.fieldassist;

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

import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.swt.SWT;
Expand All @@ -25,15 +25,12 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.tests.harness.util.TestRunLogUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestWatcher;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestInfo;

public abstract class AbstractFieldAssistTestCase {
@Rule
public TestWatcher LOG_TESTRUN = TestRunLogUtil.LOG_TESTRUN;


/**
* The window that is being tested.
*/
Expand All @@ -49,8 +46,9 @@ public abstract class AbstractFieldAssistTestCase {
*/
private int originalShellCount;

@Before
public final void setUp() throws Exception {
@BeforeEach
public final void setUp(TestInfo testInfo) throws Exception {
System.out.println(TestRunLogUtil.formatTestStartMessage(testInfo.getTestMethod().get().getName()));
Display display = getDisplay();
anotherShell = new Shell(display);
new Text(anotherShell, SWT.SINGLE);
Expand All @@ -61,13 +59,14 @@ public final void setUp() throws Exception {
assertNotNull(window);
}

@After
public final void tearDown() throws Exception {
@AfterEach
public final void tearDown(TestInfo testInfo) throws Exception {
if (window != null) {
spinEventLoop();
}
closeFieldAssistWindow();
anotherShell.close();
System.out.println(TestRunLogUtil.formatTestFinishedMessage(testInfo.getTestMethod().get().getName()));
}

protected Display getDisplay() {
Expand Down Expand Up @@ -171,7 +170,7 @@ protected void sendKeyDownToControl(char character) {
Event event = new Event();
event.type = SWT.KeyDown;
event.character = character;
assertTrue("unable to post event to display queue for test case", window.getDisplay().post(event));
assertTrue(window.getDisplay().post(event), "unable to post event to display queue for test case");
spinEventLoop();
}

Expand All @@ -186,7 +185,7 @@ protected void sendKeyDownToControl(KeyStroke keystroke) {
Event event = new Event();
event.type = SWT.KeyDown;
event.keyCode = keystroke.getNaturalKey();
assertTrue("unable to post event to display queue for test case", window.getDisplay().post(event));
assertTrue(window.getDisplay().post(event), "unable to post event to display queue for test case");
spinEventLoop();
}

Expand All @@ -195,8 +194,8 @@ protected void sendKeyDownToControl(KeyStroke keystroke) {
*/
protected void assertOneShellUp() {
spinEventLoop();
assertEquals("There should only be one shell up, the dialog", originalShellCount + 1,
window.getDisplay().getShells().length);
assertEquals(originalShellCount + 1,
window.getDisplay().getShells().length, "There should only be one shell up, the dialog");
}

/**
Expand All @@ -205,8 +204,8 @@ protected void assertOneShellUp() {
*/
protected void assertTwoShellsUp() {
spinEventLoop();
assertEquals("There should two shells up, the dialog and the proposals dialog", originalShellCount + 2,
window.getDisplay().getShells().length);
assertEquals(originalShellCount + 2,
window.getDisplay().getShells().length, "There should two shells up, the dialog and the proposals dialog");
}

protected void setControlContent(String text) {
Expand All @@ -219,4 +218,4 @@ protected String getControlContent() {

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
*******************************************************************************/
package org.eclipse.jface.tests.fieldassist;

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

import org.eclipse.jface.fieldassist.ContentProposalAdapter;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
Expand All @@ -28,15 +28,12 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.tests.harness.util.TestRunLogUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestWatcher;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;

public class ContentProposalAdapterTest {
@Rule
public TestWatcher LOG_TESTRUN = TestRunLogUtil.LOG_TESTRUN;

/**
* A shell that hosts the decorated text control
Expand Down Expand Up @@ -121,8 +118,9 @@ public void testBug520372AutoActivationDelayESC() throws Exception {

// most of the following code is copied from AbstractFieldAssistTestCase

@Before
public final void setUp() throws Exception {
@BeforeEach
public final void setUp(TestInfo testInfo) throws Exception {
System.out.println(TestRunLogUtil.formatTestStartMessage(testInfo.getTestMethod().get().getName()));
Display display = getDisplay();
originalShellCount = display.getShells().length;
controlShell = new Shell(display);
Expand All @@ -133,8 +131,8 @@ public final void setUp() throws Exception {
assertNotNull(contentProposalAdapter);
}

@After
public final void tearDown() throws Exception {
@AfterEach
public final void tearDown(TestInfo testInfo) throws Exception {
if (controlShell != null) {
spinEventLoop();
controlShell.close();
Expand All @@ -145,6 +143,7 @@ public final void tearDown() throws Exception {
}
this.display = null;
}
System.out.println(TestRunLogUtil.formatTestFinishedMessage(testInfo.getTestMethod().get().getName()));
}

private Display getDisplay() {
Expand Down Expand Up @@ -179,7 +178,7 @@ private void sendKeyDownToControl(char character) {
Event event = new Event();
event.type = SWT.KeyDown;
event.character = character;
assertTrue("unable to post event to display queue for test case", text.getDisplay().post(event));
assertTrue(text.getDisplay().post(event), "unable to post event to display queue for test case");
spinEventLoop();
}

Expand Down Expand Up @@ -233,7 +232,7 @@ private void ensurePopupIsUp() {
*/
private void assertOneShellUp() {
spinEventLoop();
assertEquals("There should only be one shell up, the dialog", originalShellCount + 1,
text.getDisplay().getShells().length);
assertEquals(originalShellCount + 1,
text.getDisplay().getShells().length, "There should only be one shell up, the dialog");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
******************************************************************************/
package org.eclipse.jface.tests.fieldassist;

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 org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class ControlDecorationTests extends AbstractFieldAssistTestCase {

Expand All @@ -37,15 +37,15 @@ public void testDecorationIsVisible() {
.getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage());
decoration.setDescriptionText("foo");
window.open();
assertTrue("1.0", decoration.isVisible());
assertTrue(decoration.isVisible(), "1.0");
decoration.hide();
assertFalse("1.1", decoration.isVisible());
assertFalse(decoration.isVisible(), "1.1");
decoration.show();
assertTrue("1.2", decoration.isVisible());
assertTrue(decoration.isVisible(), "1.2");
window.getFieldAssistControl().setVisible(false);
assertFalse("1.3", decoration.isVisible());
assertFalse(decoration.isVisible(), "1.3");
window.getFieldAssistControl().setVisible(true);
assertTrue("1.4", decoration.isVisible());
assertTrue(decoration.isVisible(), "1.4");

// focus related tests. Comment out for now.
// see bug 275393
Expand All @@ -71,7 +71,7 @@ public void testHoverVisibility() {
decoration.setImage(FieldDecorationRegistry.getDefault()
.getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage());
decoration.setDescriptionText("foo");
assertTrue("1.0", decoration.isVisible());
assertTrue(decoration.isVisible(), "1.0");
assertOneShellUp();
decoration.hide();
decoration.showHoverText("Show me");
Expand All @@ -87,7 +87,7 @@ public void testHoverVisibility() {

// focus related tests
@Test
@Ignore("Disabled see Bug 418420 and bug 275393")
@Disabled("Disabled see Bug 418420 and bug 275393")
public void testBug418420() {
AbstractFieldAssistWindow window = getFieldAssistWindow();
window.open();
Expand Down
Loading
Loading