Bug 558313 - update to junit 4
Change-Id: Ifc76a0cf9d4ff0d44d22e34d4c984bdc7441e58c
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Depends-On: Iefbf4bb21f7b481fe0b1b3b70a0260fc8fd98dc0
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringHeapTestCase.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringHeapTestCase.java
index 4072579..8252eaf 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringHeapTestCase.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringHeapTestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -22,15 +22,7 @@
import org.eclipse.ltk.core.refactoring.Refactoring;
import org.eclipse.ltk.core.refactoring.RefactoringCore;
-public abstract class RefactoringHeapTestCase extends RefactoringPerformanceTestCase {
-
- public RefactoringHeapTestCase() {
- super();
- }
-
- public RefactoringHeapTestCase(String name) {
- super(name);
- }
+public abstract class RefactoringHeapTestCase extends RefactoringPerformanceTestCaseCommon {
@Override
protected void executeRefactoring(Refactoring refactoring, boolean measure, int maxSeverity, boolean checkUndo) throws Exception {
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringPerformanceTestCase.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringPerformanceTestCase.java
deleted file mode 100644
index 93c926f..0000000
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringPerformanceTestCase.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jdt.ui.tests.refactoring.infra;
-
-import org.junit.Assert;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-
-import org.eclipse.ltk.core.refactoring.CheckConditionsOperation;
-import org.eclipse.ltk.core.refactoring.PerformRefactoringOperation;
-import org.eclipse.ltk.core.refactoring.Refactoring;
-import org.eclipse.ltk.core.refactoring.RefactoringCore;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-
-import org.eclipse.jdt.ui.tests.performance.JdtPerformanceTestCase;
-
-public abstract class RefactoringPerformanceTestCase extends JdtPerformanceTestCase {
-
- public RefactoringPerformanceTestCase() {
- super();
- }
-
- public RefactoringPerformanceTestCase(String name) {
- super(name);
- }
-
- protected void executeRefactoring(Refactoring refactoring, boolean measure) throws Exception {
- executeRefactoring(refactoring, measure, RefactoringStatus.WARNING);
- }
-
- protected void executeRefactoring(Refactoring refactoring, boolean measure, int maxSeverity) throws Exception {
- executeRefactoring(refactoring, measure, maxSeverity, true);
- }
-
- protected void executeRefactoring(Refactoring refactoring, boolean measure, int maxSeverity, boolean checkUndo) throws Exception {
- PerformRefactoringOperation operation= new PerformRefactoringOperation(refactoring, CheckConditionsOperation.ALL_CONDITIONS);
- joinBackgroudActivities();
- // Flush the undo manager to not count any already existing undo objects
- // into the heap consumption
- RefactoringCore.getUndoManager().flush();
- System.gc();
- if (measure)
- startMeasuring();
- ResourcesPlugin.getWorkspace().run(operation, null);
- if (measure)
- finishMeasurements();
- Assert.assertTrue(operation.getConditionStatus().getSeverity() <= maxSeverity);
- Assert.assertTrue(operation.getValidationStatus().isOK());
- if (checkUndo) {
- Assert.assertNotNull(operation.getUndoChange());
- }
- RefactoringCore.getUndoManager().flush();
- System.gc();
- }
-}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringPerformanceTestSetup.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringPerformanceTestSetup.java
deleted file mode 100644
index 24dba95..0000000
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/RefactoringPerformanceTestSetup.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jdt.ui.tests.refactoring.infra;
-
-import junit.framework.Test;
-
-public class RefactoringPerformanceTestSetup extends AbstractRefactoringTestSetup {
-
- public RefactoringPerformanceTestSetup(Test test) {
- super(test);
- }
-}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/SWTProjectTestSetup.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/SWTProjectTestSetup.java
deleted file mode 100644
index ea15e5f..0000000
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/infra/SWTProjectTestSetup.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jdt.ui.tests.refactoring.infra;
-
-import junit.framework.Test;
-
-import org.eclipse.jdt.ui.tests.performance.SWTTestProject;
-
-public class SWTProjectTestSetup extends RefactoringPerformanceTestSetup {
-
- private SWTTestProject fTestProject;
-
- public SWTProjectTestSetup(Test test) {
- super(test);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- fTestProject= new SWTTestProject();
- }
-
- @Override
- protected void tearDown() throws Exception {
- fTestProject.delete();
- super.tearDown();
- }
-}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/AbstractMoveCompilationUnitPrefTest.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/AbstractMoveCompilationUnitPrefTest.java
index 62d28a9..2ae9c6d 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/AbstractMoveCompilationUnitPrefTest.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/AbstractMoveCompilationUnitPrefTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -22,19 +22,15 @@
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.internal.corext.refactoring.reorg.IReorgPolicy.IMovePolicy;
import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor;
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory;
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory;
-import org.eclipse.jdt.internal.corext.refactoring.reorg.IReorgPolicy.IMovePolicy;
import org.eclipse.jdt.ui.tests.refactoring.ccp.MockReorgQueries;
-public abstract class AbstractMoveCompilationUnitPrefTest extends RepeatingRefactoringPerformanceTestCase {
-
- public AbstractMoveCompilationUnitPrefTest(String name) {
- super(name);
- }
+public abstract class AbstractMoveCompilationUnitPrefTest extends RepeatingRefactoringPerformanceTestCaseCommon {
@Override
protected void doExecuteRefactoring(int numberOfCus, int numberOfRefs, boolean measure) throws Exception {
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/IntroduceIndirectionPerfAcceptanceTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/IntroduceIndirectionPerfAcceptanceTests.java
index 471048c..205691f 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/IntroduceIndirectionPerfAcceptanceTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/IntroduceIndirectionPerfAcceptanceTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,11 +13,9 @@
*******************************************************************************/
package org.eclipse.jdt.ui.tests.refactoring.reorg;
-import junit.framework.Test;
-
import org.junit.Assert;
-
-import org.eclipse.test.OrderedTestSuite;
+import org.junit.Rule;
+import org.junit.Test;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -29,31 +27,19 @@
import org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring;
import org.eclipse.jdt.ui.tests.performance.SWTTestProject;
-import org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringPerformanceTestCase;
-import org.eclipse.jdt.ui.tests.refactoring.infra.SWTProjectTestSetup;
+import org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringPerformanceTestCaseCommon;
+import org.eclipse.jdt.ui.tests.refactoring.rules.SWTProjectTestSetup;
-public class IntroduceIndirectionPerfAcceptanceTests extends RefactoringPerformanceTestCase {
+public class IntroduceIndirectionPerfAcceptanceTests extends RefactoringPerformanceTestCaseCommon {
private IJavaProject fProject;
private IntroduceIndirectionRefactoring fRefactoring;
- public static Test suite() {
- OrderedTestSuite suite= new OrderedTestSuite(IntroduceIndirectionPerfAcceptanceTests.class, new String[] {
- "testIntroduceIndirection",
- });
- return new SWTProjectTestSetup(suite);
- }
-
- public static Test setUpTest(Test someTest) {
- return new SWTProjectTestSetup(someTest);
- }
-
- public IntroduceIndirectionPerfAcceptanceTests(String test) {
- super(test);
- }
+ @Rule
+ public SWTProjectTestSetup spts= new SWTProjectTestSetup();
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
fProject= (IJavaProject)JavaCore.create(
ResourcesPlugin.getWorkspace().getRoot().findMember(SWTTestProject.PROJECT));
@@ -67,6 +53,7 @@
fRefactoring.setIntermediaryMethodName("bar");
}
+ @Test
public void testIntroduceIndirection() throws Exception {
executeRefactoring(fRefactoring, true);
}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/MoveCompilationUnitPerfTests1.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/MoveCompilationUnitPerfTests1.java
index ff66d83..77484ad 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/MoveCompilationUnitPerfTests1.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/MoveCompilationUnitPerfTests1.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,47 +13,38 @@
*******************************************************************************/
package org.eclipse.jdt.ui.tests.refactoring.reorg;
-import junit.framework.Test;
+import org.junit.FixMethodOrder;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
-import org.eclipse.test.OrderedTestSuite;
import org.eclipse.test.performance.Dimension;
-import org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringPerformanceTestSetup;
+import org.eclipse.jdt.ui.tests.refactoring.rules.RefactoringPerformanceTestSetup;
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class MoveCompilationUnitPerfTests1 extends AbstractMoveCompilationUnitPrefTest {
- public static Test suite() {
- // we must make sure that cold is executed before warm
- OrderedTestSuite suite= new OrderedTestSuite(MoveCompilationUnitPerfTests1.class, new String[] {
- "testCold_10_10",
- "test_10_10",
- "test_100_10",
- "test_1000_10",
- });
- return new RefactoringPerformanceTestSetup(suite);
- }
+ @Rule
+ public RefactoringPerformanceTestSetup rpts= new RefactoringPerformanceTestSetup();
- public static Test setUpTest(Test someTest) {
- return new RefactoringPerformanceTestSetup(someTest);
- }
-
- public MoveCompilationUnitPerfTests1(String name) {
- super(name);
- }
-
- public void testCold_10_10() throws Exception {
+ @Test
+ public void testACold_10_10() throws Exception {
executeRefactoring(10, 10, false, 3);
}
- public void test_10_10() throws Exception {
+ @Test
+ public void testB_10_10() throws Exception {
executeRefactoring(10, 10, true, 3);
}
- public void test_100_10() throws Exception {
+ @Test
+ public void testC_100_10() throws Exception {
executeRefactoring(100, 10, true, 1);
}
- public void test_1000_10() throws Exception {
+ @Test
+ public void testD_1000_10() throws Exception {
tagAsSummary("Move compilation units - 1000 CUs, 10 Refs", Dimension.ELAPSED_PROCESS);
executeRefactoring(1000, 10, true, 1);
}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/MoveCompilationUnitPerfTests2.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/MoveCompilationUnitPerfTests2.java
index ca81d3c..48d2354 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/MoveCompilationUnitPerfTests2.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/MoveCompilationUnitPerfTests2.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,47 +13,38 @@
*******************************************************************************/
package org.eclipse.jdt.ui.tests.refactoring.reorg;
-import junit.framework.Test;
+import org.junit.FixMethodOrder;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
-import org.eclipse.test.OrderedTestSuite;
import org.eclipse.test.performance.Dimension;
-import org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringPerformanceTestSetup;
+import org.eclipse.jdt.ui.tests.refactoring.rules.RefactoringPerformanceTestSetup;
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class MoveCompilationUnitPerfTests2 extends AbstractMoveCompilationUnitPrefTest {
- public static Test suite() {
- // we must make sure that cold is executed before warm
- OrderedTestSuite suite= new OrderedTestSuite(MoveCompilationUnitPerfTests2.class, new String[] {
- "testCold_10_10",
- "test_10_10",
- "test_10_100",
- "test_10_1000",
- });
- return new RefactoringPerformanceTestSetup(suite);
- }
+ @Rule
+ public RefactoringPerformanceTestSetup rpts= new RefactoringPerformanceTestSetup();
- public static Test setUpTest(Test someTest) {
- return new RefactoringPerformanceTestSetup(someTest);
- }
-
- public MoveCompilationUnitPerfTests2(String name) {
- super(name);
- }
-
- public void testCold_10_10() throws Exception {
+ @Test
+ public void testACold_10_10() throws Exception {
executeRefactoring(10, 10, false, 3);
}
- public void test_10_10() throws Exception {
+ @Test
+ public void testB_10_10() throws Exception {
executeRefactoring(10, 10, true, 3);
}
- public void test_10_100() throws Exception {
+ @Test
+ public void testC_10_100() throws Exception {
executeRefactoring(10, 100, true, 1);
}
- public void test_10_1000() throws Exception {
+ @Test
+ public void testD_10_1000() throws Exception {
tagAsSummary("Move compilation units - 10 CUs, 1000 Refs", Dimension.ELAPSED_PROCESS);
executeRefactoring(10, 1000, true, 1);
}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/RepeatingRefactoringPerformanceTestCase.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/RepeatingRefactoringPerformanceTestCase.java
deleted file mode 100644
index 9562f41..0000000
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/RepeatingRefactoringPerformanceTestCase.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jdt.ui.tests.refactoring.reorg;
-
-import org.eclipse.test.performance.Dimension;
-
-import org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringPerformanceTestCase;
-
-
-public abstract class RepeatingRefactoringPerformanceTestCase extends RefactoringPerformanceTestCase {
-
- protected TestProject fTestProject;
-
- public RepeatingRefactoringPerformanceTestCase(String name) {
- super(name);
- }
-
- public TestProject getTestProject() {
- return fTestProject;
- }
-
- protected void executeRefactoring(int numberOfCus, int numberOfRefs, boolean measure, int sampleCount) throws Exception {
- for (int i= 0; i < sampleCount; i++) {
- try {
- fTestProject= new TestProject();
- doExecuteRefactoring(numberOfCus, numberOfRefs, measure);
- } finally {
- fTestProject.delete();
- }
- }
- if (measure) {
- commitMeasurements();
- assertMeasurements();
- }
- }
-
- @Override
- protected void finishMeasurements() {
- stopMeasuring();
- }
-
- protected void assertMeasurements() {
- assertPerformanceInRelativeBand(Dimension.ELAPSED_PROCESS, -100, +10);
- }
-
- protected abstract void doExecuteRefactoring(int numberOfCus, int numberOfRefs, boolean measure) throws Exception;
-}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/TestProject.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/TestProject.java
index 7dbff6a..578d895 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/TestProject.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/reorg/TestProject.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -33,8 +33,9 @@
public TestProject(String name) throws Exception {
fTestProject= JavaProjectHelper.createJavaProject(name, "bin");
- // we must make sure that the performance test are compatible to 2.1.3 & 3.0 so use rt13
- Assert.assertTrue("rt not found", JavaProjectHelper.addRTJar13(fTestProject) != null);
+ // was: we must make sure that the performance test are compatible to 2.1.3 & 3.0 so use rt13
+ // rt13 is deprecated, use rt15
+ Assert.assertTrue("rt not found", JavaProjectHelper.addRTJar15(fTestProject) != null);
fSourceFolder= JavaProjectHelper.addSourceContainer(fTestProject, "src");
}
diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/type/ExtractInterfaceHeapAcceptanceTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/type/ExtractInterfaceHeapAcceptanceTests.java
index 2de5c0d..468f2ca 100644
--- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/type/ExtractInterfaceHeapAcceptanceTests.java
+++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/type/ExtractInterfaceHeapAcceptanceTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,9 +16,8 @@
import java.util.ArrayList;
import java.util.List;
-import junit.framework.Test;
-
-import org.eclipse.test.OrderedTestSuite;
+import org.junit.Rule;
+import org.junit.Test;
import org.eclipse.ltk.core.refactoring.Refactoring;
import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
@@ -32,7 +31,7 @@
import org.eclipse.jdt.ui.tests.performance.SWTTestProject;
import org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringHeapTestCase;
-import org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringPerformanceTestSetup;
+import org.eclipse.jdt.ui.tests.refactoring.rules.RefactoringPerformanceTestSetup;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
@@ -41,24 +40,11 @@
private SWTTestProject fProject;
private Refactoring fRefactoring;
- public static Test suite() {
- // we must make sure that cold is executed before warm
- OrderedTestSuite suite= new OrderedTestSuite(ExtractInterfaceHeapAcceptanceTests.class, new String[] {
- "testExtractControl",
- });
- return new RefactoringPerformanceTestSetup(suite);
- }
-
- public static Test setUpTest(Test someTest) {
- return new RefactoringPerformanceTestSetup(someTest);
- }
-
- public ExtractInterfaceHeapAcceptanceTests(String test) {
- super(test);
- }
+ @Rule
+ public RefactoringPerformanceTestSetup rpts= new RefactoringPerformanceTestSetup();
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
fProject= new SWTTestProject();
IType control= fProject.getProject().findType("org.eclipse.swt.widgets.Control");
@@ -79,11 +65,12 @@
}
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
fProject.delete();
super.tearDown();
}
+ @Test
public void testExtractControl() throws Exception {
executeRefactoring(fRefactoring, true);
}
diff --git a/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/SWTTestProject.java b/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/SWTTestProject.java
index 08f8dd3..e475e1e 100644
--- a/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/SWTTestProject.java
+++ b/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/SWTTestProject.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -74,7 +74,8 @@
* - using the System JRE in a performance test is obviously wrong
*/
JavaProjectHelper.removeFromClasspath(fProject, new Path(JavaRuntime.JRE_CONTAINER));
- JavaProjectHelper.addRTJar13(fProject);
+ // rt13 is deprecated - use rt15 recommend to use instead
+ JavaProjectHelper.addRTJar15(fProject);
Assert.assertTrue(fProject.exists());
}