Skip to content

Commit 4bf1ec5

Browse files
committed
Migrate Widget Factory Tests to JUnit 5
1 parent 180f122 commit 4bf1ec5

20 files changed

Lines changed: 72 additions & 72 deletions

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/AbstractFactoryTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,32 @@
1616
import org.eclipse.swt.graphics.Image;
1717
import org.eclipse.swt.graphics.ImageGcDrawer;
1818
import org.eclipse.swt.widgets.Shell;
19-
import org.junit.After;
20-
import org.junit.AfterClass;
21-
import org.junit.Before;
22-
import org.junit.BeforeClass;
19+
import org.junit.jupiter.api.AfterAll;
20+
import org.junit.jupiter.api.AfterEach;
21+
import org.junit.jupiter.api.BeforeAll;
22+
import org.junit.jupiter.api.BeforeEach;
2323

2424
public class AbstractFactoryTest {
2525
protected static Shell shell;
2626
protected static Image image;
2727

28-
@BeforeClass
28+
@BeforeAll
2929
public static void classSetup() {
3030
final ImageGcDrawer noOp = (gc, width, height) -> {};
3131
image = new Image(null, noOp, 1, 1);
3232
}
3333

34-
@Before
34+
@BeforeEach
3535
public void setup() {
3636
shell = new Shell();
3737
}
3838

39-
@After
39+
@AfterEach
4040
public void tearDown() {
4141
shell.dispose();
4242
}
4343

44-
@AfterClass
44+
@AfterAll
4545
public static void classTearDown() {
4646
image.dispose();
4747
shell.dispose();

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/TestUnitBrowserFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
******************************************************************************/
1414
package org.eclipse.jface.tests.widgets;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertFalse;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertFalse;
1818

1919
import org.eclipse.jface.widgets.BrowserFactory;
2020
import org.eclipse.swt.SWT;
2121
import org.eclipse.swt.browser.Browser;
22-
import org.junit.Test;
22+
import org.junit.jupiter.api.Test;
2323

2424
public class TestUnitBrowserFactory extends AbstractFactoryTest {
2525

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/TestUnitButtonFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
******************************************************************************/
1414
package org.eclipse.jface.tests.widgets;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertNotNull;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1818

1919
import org.eclipse.jface.widgets.ButtonFactory;
2020
import org.eclipse.swt.SWT;
2121
import org.eclipse.swt.events.SelectionEvent;
2222
import org.eclipse.swt.widgets.Button;
2323
import org.eclipse.swt.widgets.Event;
24-
import org.junit.Test;
24+
import org.junit.jupiter.api.Test;
2525

2626
public class TestUnitButtonFactory extends AbstractFactoryTest {
2727

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/TestUnitCompositeFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
*******************************************************************************/
1414
package org.eclipse.jface.tests.widgets;
1515

16-
import static org.junit.Assert.assertEquals;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
1717

1818
import org.eclipse.jface.layout.GridLayoutFactory;
1919
import org.eclipse.jface.widgets.CompositeFactory;
2020
import org.eclipse.swt.SWT;
2121
import org.eclipse.swt.layout.GridLayout;
2222
import org.eclipse.swt.widgets.Composite;
23-
import org.junit.Test;
23+
import org.junit.jupiter.api.Test;
2424

2525
public class TestUnitCompositeFactory extends AbstractFactoryTest {
2626
@Test

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/TestUnitControlFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
******************************************************************************/
1515
package org.eclipse.jface.tests.widgets;
1616

17-
import static org.junit.Assert.assertEquals;
18-
import static org.junit.Assert.assertFalse;
19-
import static org.junit.Assert.assertNotSame;
20-
import static org.junit.Assert.assertNull;
21-
import static org.junit.Assert.assertTrue;
17+
import static org.junit.jupiter.api.Assertions.assertEquals;
18+
import static org.junit.jupiter.api.Assertions.assertFalse;
19+
import static org.junit.jupiter.api.Assertions.assertNotSame;
20+
import static org.junit.jupiter.api.Assertions.assertNull;
21+
import static org.junit.jupiter.api.Assertions.assertTrue;
2222

2323
import org.eclipse.jface.layout.GridDataFactory;
2424
import org.eclipse.jface.widgets.LabelFactory;
@@ -28,7 +28,7 @@
2828
import org.eclipse.swt.graphics.FontData;
2929
import org.eclipse.swt.layout.GridData;
3030
import org.eclipse.swt.widgets.Label;
31-
import org.junit.Test;
31+
import org.junit.jupiter.api.Test;
3232

3333
/**
3434
* This test uses a LabelFactory to test the methods of AbstractControlFactory.

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/TestUnitDateTimeFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
******************************************************************************/
1414
package org.eclipse.jface.tests.widgets;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertNotNull;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1818

1919
import org.eclipse.jface.widgets.DateTimeFactory;
2020
import org.eclipse.swt.SWT;
2121
import org.eclipse.swt.events.SelectionEvent;
2222
import org.eclipse.swt.widgets.DateTime;
2323
import org.eclipse.swt.widgets.Event;
24-
import org.junit.Test;
24+
import org.junit.jupiter.api.Test;
2525

2626
public class TestUnitDateTimeFactory extends AbstractFactoryTest {
2727

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/TestUnitGroupFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
******************************************************************************/
1414
package org.eclipse.jface.tests.widgets;
1515

16-
import static org.junit.Assert.assertEquals;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
1717

1818
import org.eclipse.jface.widgets.GroupFactory;
1919
import org.eclipse.swt.SWT;
2020
import org.eclipse.swt.widgets.Group;
21-
import org.junit.Test;
21+
import org.junit.jupiter.api.Test;
2222

2323
public class TestUnitGroupFactory extends AbstractFactoryTest {
2424

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/TestUnitItemFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
******************************************************************************/
1414
package org.eclipse.jface.tests.widgets;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertNotSame;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertNotSame;
1818

1919
import org.eclipse.jface.widgets.TableColumnFactory;
2020
import org.eclipse.swt.SWT;
2121
import org.eclipse.swt.widgets.Table;
2222
import org.eclipse.swt.widgets.TableColumn;
2323
import org.junit.Before;
24-
import org.junit.Test;
24+
import org.junit.jupiter.api.Test;
2525

2626
/**
2727
* This test uses a TableColumnFactory to test the methods of

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/TestUnitLabelFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
******************************************************************************/
1414
package org.eclipse.jface.tests.widgets;
1515

16-
import static org.junit.Assert.assertEquals;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
1717

1818
import org.eclipse.jface.widgets.LabelFactory;
1919
import org.eclipse.swt.SWT;
2020
import org.eclipse.swt.widgets.Label;
21-
import org.junit.Test;
21+
import org.junit.jupiter.api.Test;
2222

2323
public class TestUnitLabelFactory extends AbstractFactoryTest {
2424

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/TestUnitLinkFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
******************************************************************************/
1414
package org.eclipse.jface.tests.widgets;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertNotNull;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1818

1919
import org.eclipse.jface.widgets.LinkFactory;
2020
import org.eclipse.swt.SWT;
2121
import org.eclipse.swt.events.SelectionEvent;
2222
import org.eclipse.swt.widgets.Event;
2323
import org.eclipse.swt.widgets.Link;
24-
import org.junit.Test;
24+
import org.junit.jupiter.api.Test;
2525

2626
public class TestUnitLinkFactory extends AbstractFactoryTest {
2727

0 commit comments

Comments
 (0)