Skip to content

Commit 1346168

Browse files
committed
Replace UITestCase with test rule in dynamicplugins UI tests
1 parent 65500ca commit 1346168

30 files changed

+100
-251
lines changed

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/AcceleratorConfigurationsExtensionDynamicTest.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,23 @@
1414
package org.eclipse.ui.tests.dynamicplugins;
1515

1616
import static org.junit.Assert.assertThrows;
17+
import static org.junit.Assert.assertTrue;
1718

1819
import org.eclipse.core.commands.common.NamedHandleObject;
1920
import org.eclipse.core.commands.common.NotDefinedException;
2021
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
2122
import org.eclipse.ui.keys.IBindingService;
2223
import org.junit.Test;
23-
import org.junit.runner.RunWith;
24-
import org.junit.runners.JUnit4;
2524

2625
/**
2726
* Tests whether the "org.eclipse.ui.acceleratorConfigurations" extension point
2827
* can be added and removed dynamically.
2928
*
3029
* @since 3.1.1
3130
*/
32-
@RunWith(JUnit4.class)
3331
public final class AcceleratorConfigurationsExtensionDynamicTest extends
3432
DynamicTestCase {
3533

36-
/**
37-
* Constructs a new instance of
38-
* <code>AcceleratorConfigurationsExtensionDynamicTest</code>.
39-
*/
40-
public AcceleratorConfigurationsExtensionDynamicTest() {
41-
super(AcceleratorConfigurationsExtensionDynamicTest.class.getSimpleName());
42-
}
43-
4434
/**
4535
* Returns the full-qualified identifier of the extension to be tested.
4636
*

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/AcceleratorScopesExtensionDynamicTest.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,23 @@
1414
package org.eclipse.ui.tests.dynamicplugins;
1515

1616
import static org.junit.Assert.assertThrows;
17+
import static org.junit.Assert.assertTrue;
1718

1819
import org.eclipse.core.commands.common.NamedHandleObject;
1920
import org.eclipse.core.commands.common.NotDefinedException;
2021
import org.eclipse.ui.contexts.IContextService;
2122
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
2223
import org.junit.Test;
23-
import org.junit.runner.RunWith;
24-
import org.junit.runners.JUnit4;
2524

2625
/**
2726
* Tests whether the "org.eclipse.ui.acceleratorScopes" extension point can be
2827
* added and removed dynamically.
2928
*
3029
* @since 3.1.1
3130
*/
32-
@RunWith(JUnit4.class)
3331
public final class AcceleratorScopesExtensionDynamicTest extends
3432
DynamicTestCase {
3533

36-
/**
37-
* Constructs a new instance of
38-
* <code>AcceleratorScopesExtensionDynamicTest</code>.
39-
*/
40-
public AcceleratorScopesExtensionDynamicTest() {
41-
super(AcceleratorScopesExtensionDynamicTest.class.getSimpleName());
42-
}
43-
4434
/**
4535
* Returns the full-qualified identifier of the extension to be tested.
4636
*

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ActionDefinitionsExtensionDynamicTest.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,23 @@
1414
package org.eclipse.ui.tests.dynamicplugins;
1515

1616
import static org.junit.Assert.assertThrows;
17+
import static org.junit.Assert.assertTrue;
1718

1819
import org.eclipse.core.commands.common.NamedHandleObject;
1920
import org.eclipse.core.commands.common.NotDefinedException;
2021
import org.eclipse.ui.commands.ICommandService;
2122
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
2223
import org.junit.Test;
23-
import org.junit.runner.RunWith;
24-
import org.junit.runners.JUnit4;
2524

2625
/**
2726
* Tests whether the "org.eclipse.ui.actionDefinitions" extension point can be
2827
* added and removed dynamically.
2928
*
3029
* @since 3.1.1
3130
*/
32-
@RunWith(JUnit4.class)
3331
public final class ActionDefinitionsExtensionDynamicTest extends
3432
DynamicTestCase {
3533

36-
/**
37-
* Constructs a new instance of
38-
* <code>ActionDefinitionsExtensionDynamicTest</code>.
39-
*/
40-
public ActionDefinitionsExtensionDynamicTest() {
41-
super(ActionDefinitionsExtensionDynamicTest.class.getSimpleName());
42-
}
43-
4434
/**
4535
* Returns the full-qualified identifier of the extension to be tested.
4636
*

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ActionSetTests.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
package org.eclipse.ui.tests.dynamicplugins;
1515

1616
import static org.eclipse.ui.tests.harness.util.UITestUtil.openTestWindow;
17+
import static org.junit.Assert.assertEquals;
18+
import static org.junit.Assert.assertFalse;
19+
import static org.junit.Assert.assertNotNull;
20+
import static org.junit.Assert.assertNull;
21+
import static org.junit.Assert.assertTrue;
1722

1823
import java.lang.ref.ReferenceQueue;
1924
import java.lang.ref.WeakReference;
@@ -33,23 +38,16 @@
3338
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
3439
import org.eclipse.ui.tests.leaks.LeakTests;
3540
import org.junit.Test;
36-
import org.junit.runner.RunWith;
37-
import org.junit.runners.JUnit4;
3841

3942
/**
4043
* Tests to ensure the addition of new action sets with dynamic plug-ins.
4144
*/
4245

43-
@RunWith(JUnit4.class)
4446
public class ActionSetTests extends DynamicTestCase {
4547

4648
private static final String ACTION_SET_ID = "org.eclipse.newActionSet1.newActionSet1";
4749
private static final String PART_ID = "org.eclipse.ui.tests.part1";
4850

49-
public ActionSetTests() {
50-
super(ActionSetTests.class.getSimpleName());
51-
}
52-
5351
@Test
5452
public void testActionSets() throws Exception {
5553
WorkbenchWindow window = (WorkbenchWindow) openTestWindow();

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ActivitySupportTests.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,20 @@
1313
*******************************************************************************/
1414
package org.eclipse.ui.tests.dynamicplugins;
1515

16+
import static org.junit.Assert.assertFalse;
17+
import static org.junit.Assert.assertNotNull;
18+
import static org.junit.Assert.assertTrue;
19+
1620
import org.eclipse.jface.resource.ImageDescriptor;
1721
import org.eclipse.swt.graphics.Image;
1822
import org.eclipse.ui.activities.IActivity;
1923
import org.eclipse.ui.activities.ICategory;
2024
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
2125
import org.eclipse.ui.tests.harness.util.ImageTests;
2226
import org.junit.Test;
23-
import org.junit.runner.RunWith;
24-
import org.junit.runners.JUnit4;
2527

26-
@RunWith(JUnit4.class)
2728
public class ActivitySupportTests extends DynamicTestCase {
2829

29-
public ActivitySupportTests() {
30-
super(ActivitySupportTests.class.getSimpleName());
31-
}
32-
3330
@Override
3431
protected String getExtensionId() {
3532
return "newActivitySupport1.testNewActivitySupportAddition";

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/BindingsExtensionDynamicTest.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package org.eclipse.ui.tests.dynamicplugins;
1515

1616
import static org.junit.Assert.assertThrows;
17+
import static org.junit.Assert.assertTrue;
1718

1819
import org.eclipse.core.commands.common.NotDefinedException;
1920
import org.eclipse.jface.bindings.Binding;
@@ -26,25 +27,15 @@
2627
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
2728
import org.eclipse.ui.keys.IBindingService;
2829
import org.junit.Test;
29-
import org.junit.runner.RunWith;
30-
import org.junit.runners.JUnit4;
3130

3231
/**
3332
* Tests whether the "org.eclipse.ui.bindings" extension point can be added and
3433
* removed dynamically.
3534
*
3635
* @since 3.1.1
3736
*/
38-
@RunWith(JUnit4.class)
3937
public final class BindingsExtensionDynamicTest extends DynamicTestCase {
4038

41-
/**
42-
* Constructs a new instance of <code>BindingsExtensionDynamicTest</code>.
43-
*/
44-
public BindingsExtensionDynamicTest() {
45-
super(BindingsExtensionDynamicTest.class.getSimpleName());
46-
}
47-
4839
/**
4940
* Returns the full-qualified identifier of the extension to be tested.
5041
*

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/BrowserTests.java

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

16+
import static org.junit.Assert.assertFalse;
17+
import static org.junit.Assert.assertTrue;
18+
1619
import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
1720
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
1821
import org.junit.Test;
@@ -22,10 +25,6 @@
2225
*/
2326
public class BrowserTests extends DynamicTestCase {
2427

25-
public BrowserTests() {
26-
super(BrowserTests.class.getSimpleName());
27-
}
28-
2928
@Test
3029
public void testBrowserSupport() {
3130
WorkbenchBrowserSupport support = (WorkbenchBrowserSupport) WorkbenchBrowserSupport.getInstance();

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/CommandsExtensionDynamicTest.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
*******************************************************************************/
1414
package org.eclipse.ui.tests.dynamicplugins;
1515

16+
import static org.junit.Assert.assertEquals;
1617
import static org.junit.Assert.assertThrows;
18+
import static org.junit.Assert.assertTrue;
1719

1820
import org.eclipse.core.commands.Command;
1921
import org.eclipse.core.commands.ExecutionEvent;
@@ -32,25 +34,15 @@
3234
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
3335
import org.eclipse.ui.keys.IBindingService;
3436
import org.junit.Test;
35-
import org.junit.runner.RunWith;
36-
import org.junit.runners.JUnit4;
3737

3838
/**
3939
* Tests whether the "org.eclipse.ui.commands" extension point can be added and
4040
* removed dynamically.
4141
*
4242
* @since 3.1.1
4343
*/
44-
@RunWith(JUnit4.class)
4544
public final class CommandsExtensionDynamicTest extends DynamicTestCase {
4645

47-
/**
48-
* Constructs a new instance of <code>CommandsExtensionDynamicTest</code>.
49-
*/
50-
public CommandsExtensionDynamicTest() {
51-
super(CommandsExtensionDynamicTest.class.getSimpleName());
52-
}
53-
5446
/**
5547
* Returns the full-qualified identifier of the extension to be tested.
5648
*

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ContextsExtensionDynamicTest.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,22 @@
1414
package org.eclipse.ui.tests.dynamicplugins;
1515

1616
import static org.junit.Assert.assertThrows;
17+
import static org.junit.Assert.assertTrue;
1718

1819
import org.eclipse.core.commands.common.NamedHandleObject;
1920
import org.eclipse.core.commands.common.NotDefinedException;
2021
import org.eclipse.ui.contexts.IContextService;
2122
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
2223
import org.junit.Test;
23-
import org.junit.runner.RunWith;
24-
import org.junit.runners.JUnit4;
2524

2625
/**
2726
* Tests whether the "org.eclipse.ui.contexts" extension point can be added and
2827
* removed dynamically.
2928
*
3029
* @since 3.1.1
3130
*/
32-
@RunWith(JUnit4.class)
3331
public final class ContextsExtensionDynamicTest extends DynamicTestCase {
3432

35-
/**
36-
* Constructs a new instance of <code>ContextsExtensionDynamicTest</code>.
37-
*/
38-
public ContextsExtensionDynamicTest() {
39-
super(ContextsExtensionDynamicTest.class.getSimpleName());
40-
}
41-
4233
/**
4334
* Returns the full-qualified identifier of the extension to be tested.
4435
*

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DecoratorTests.java

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

16+
import static org.junit.Assert.assertFalse;
17+
import static org.junit.Assert.assertTrue;
18+
1619
import org.eclipse.ui.internal.WorkbenchPlugin;
1720
import org.eclipse.ui.internal.decorators.DecoratorDefinition;
1821
import org.eclipse.ui.internal.decorators.DecoratorManager;
1922
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
2023
import org.junit.Test;
21-
import org.junit.runner.RunWith;
22-
import org.junit.runners.JUnit4;
2324

2425
/**
2526
* @since 3.1
2627
*/
27-
@RunWith(JUnit4.class)
2828
public class DecoratorTests extends DynamicTestCase {
2929

3030
public static final String FULL1 = "fullDecorator1";
3131
public static final String LIGHT1 = "lightDecorator1";
3232
public static final String LIGHT2 = "lightDecorator2";
3333

34-
public DecoratorTests() {
35-
super(DecoratorTests.class.getSimpleName());
36-
}
37-
3834
@Test
3935
public void testDecorators() {
4036
assertFalse(hasDecorator(FULL1));

0 commit comments

Comments
 (0)