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
1 change: 1 addition & 0 deletions tests/org.eclipse.jface.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Require-Bundle: org.junit;bundle-version="4.12.0",
org.eclipse.ui.tests.harness
Import-Package: org.osgi.framework,
org.junit.jupiter.api;version="[5.14.0,6.0.0)",
org.junit.jupiter.api.function;version="[5.14.0,6.0.0)",
org.junit.platform.suite.api;version="[1.14.0,2.0.0)"
Export-Package: org.eclipse.jface.tests.fieldassist;x-internal:=true,
org.eclipse.jface.tests.preferences;x-internal:=true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*******************************************************************************/
package org.eclipse.jface.tests.dialogs;

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.Assert.assertTrue;
import static org.junit.Assert.fail;
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 static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

import java.io.IOException;
import java.io.StringReader;
Expand All @@ -29,7 +29,7 @@

import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class DialogSettingsTest {

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

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

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
Expand All @@ -22,8 +22,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.junit.After;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;

public class DialogTest {

Expand All @@ -32,7 +32,7 @@ public class DialogTest {
*/
private Dialog dialog;

@After
@AfterEach
public void tearDown() throws Exception {
if (dialog != null) {
// close the dialog
Expand Down Expand Up @@ -69,9 +69,9 @@ public void testButtonAlignmentBug272583() {
int cancelX = cancelBtn.getBounds().x;

if (okBtn.getDisplay().getDismissalAlignment() == SWT.LEFT) {
assertTrue("The 'OK' button should be to the left of the 'Cancel' button", okX < cancelX);
assertTrue(okX < cancelX, "The 'OK' button should be to the left of the 'Cancel' button");
} else {
assertTrue("The 'OK' button should be to the right of the 'Cancel' button", cancelX < okX);
assertTrue(cancelX < okX, "The 'OK' button should be to the right of the 'Cancel' button");
}

forceLayoutDialog.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
package org.eclipse.jface.tests.dialogs;

import org.eclipse.jface.dialogs.InputDialog;
import org.junit.After;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;

public class InputDialogTest {

private InputDialog dialog;

@After
@AfterEach
public void tearDown() throws Exception {
if (dialog != null) {
dialog.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*******************************************************************************/
package org.eclipse.jface.tests.dialogs;

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

import java.util.Arrays;

Expand All @@ -24,22 +24,22 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class PlainMessageDialogTest {

private Builder builder;
private PlainMessageDialog dialog;

@Before
@BeforeEach
public void setup() {
Shell shell = new Shell(Display.getDefault());
builder = PlainMessageDialog.getBuilder(shell, "My Dialog");
}

@After
@AfterEach
public void tearDown() {
if (dialog != null) {
dialog.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

package org.eclipse.jface.tests.dialogs;

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

import java.lang.reflect.Field;

import org.eclipse.jface.dialogs.ProgressIndicator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.widgets.Shell;
import org.junit.Test;
import org.junit.jupiter.api.Test;

/**
* Test case to assert proper styles have been set for ProgressIndicator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.swt.widgets.Display;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class ProgressMonitorDialogTest {

@Before
@BeforeEach
public void setUp() throws Exception {
// ensure we've initialized a display for this thread
Display.getDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
******************************************************************************/
package org.eclipse.jface.tests.dialogs;

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.jface.util.SafeRunnable;
import org.junit.Test;
import org.junit.jupiter.api.Test;

/**
* NOTE - these tests are not really very good, in order to really test this you
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
******************************************************************************/
package org.eclipse.jface.tests.dialogs;

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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
Expand All @@ -22,9 +22,9 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class StatusDialogTest {

Expand All @@ -41,12 +41,12 @@ public void testEscapeAmpesandInStatusLabelBug395426() {
assertEquals("&&", statusLabel.getText());
}

@Before
@BeforeEach
public void setUp() throws Exception {
shell = new Shell();
}

@After
@AfterEach
public void tearDown() throws Exception {
shell.dispose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import org.eclipse.jface.resource.ResourceLocator;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.junit.After;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;

public class TitleAreaDialogTest {

Expand All @@ -28,7 +28,7 @@ public class TitleAreaDialogTest {

private TitleAreaDialog dialog;

@After
@AfterEach
public void tearDown() throws Exception {
if (dialog != null) {
dialog.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
*******************************************************************************/
package org.eclipse.jface.tests.images;

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.assertTrue;
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.assertTrue;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.ImageDescriptor;
Expand All @@ -26,8 +26,8 @@
import org.eclipse.jface.viewers.DecorationOverlayIcon;
import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.swt.graphics.Image;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
* @since 3.13
Expand All @@ -41,7 +41,7 @@ public class DecorationOverlayIconTest {
private ImageDescriptor overlayDescriptor1;
private ImageDescriptor overlayDescriptor2;

@Before
@BeforeEach
public void setUp() {
ImageRegistry imageRegistry = JFaceResources.getImageRegistry();
baseImage1 = imageRegistry.get(Dialog.DLG_IMG_HELP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@

package org.eclipse.jface.tests.images;

import static org.junit.Assert.assertEquals;
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.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import java.net.URL;

import org.eclipse.core.runtime.Adapters;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.ImageData;
import org.junit.Test;
import org.junit.jupiter.api.Test;

/**
* Test loading ImageDescriptors from a URL calculated on demand.
Expand Down Expand Up @@ -57,15 +57,15 @@ public void testAdaptToURL() {
() -> DeferredImageDescriptorTest.class.getResource("anything.gif"));

URL url = Adapters.adapt(descriptor, URL.class);
assertNotNull("DeferredImageDescriptor does not adapt to URL", url);
assertNotNull(url, "DeferredImageDescriptor does not adapt to URL");

ImageDescriptor descriptorFromUrl = ImageDescriptor.createFromURL(url);

ImageData imageDataOrig = descriptor.getImageData(100);
assertNotNull("Original URL does not return 100% image data", imageDataOrig);
assertNotNull(imageDataOrig, "Original URL does not return 100% image data");

ImageData imageDataURL = descriptorFromUrl.getImageData(100);
assertNotNull("Adapted URL does not return 100% image data", imageDataURL);
assertNotNull(imageDataURL, "Adapted URL does not return 100% image data");
assertEquals(imageDataOrig.width, imageDataURL.width);
assertEquals(imageDataOrig.height, imageDataURL.height);
}
Expand Down
Loading
Loading