Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-04-23 13:00:58 +0000
committerStephan Herrmann2010-04-23 13:00:58 +0000
commit141f8a22878afe5badb5b0ef7cbe7bfc0fba864c (patch)
tree0212ee68777ae199ac2179f339b21378eb96ee87 /testplugins/org.eclipse.jdt.ui.tests.refactoring
parentf9f700f8645a8ec244b84751a0ed18493aff99f1 (diff)
downloadorg.eclipse.objectteams-141f8a22878afe5badb5b0ef7cbe7bfc0fba864c.tar.gz
org.eclipse.objectteams-141f8a22878afe5badb5b0ef7cbe7bfc0fba864c.tar.xz
org.eclipse.objectteams-141f8a22878afe5badb5b0ef7cbe7bfc0fba864c.zip
update these tests to v20100420-0800
Diffstat (limited to 'testplugins/org.eclipse.jdt.ui.tests.refactoring')
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/in/A.java12
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/out/A.java12
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_in/TestTwoFragmentsWithSetter.java2
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_out/TestTwoFragmentsWithSetter.java5
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java7
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/all/AllAllRefactoringTests.java2
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/DeleteTest.java48
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NLSTestSuite.java (renamed from testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/AllTests.java)2
8 files changed, 79 insertions, 11 deletions
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/in/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/in/A.java
index 39f95617f..1af03d3ca 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/in/A.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/in/A.java
@@ -1,4 +1,12 @@
package p;
-class A<T extends A<T>> {}
-class B<T> extends A<B<T>> {}
+class A<T> {
+ class E implements I<T> {
+ public void foo() {
+ E m = (E) this;
+ }
+ }
+}
+
+interface I<K> {
+}
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/out/A.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/out/A.java
index 39f95617f..1af03d3ca 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/out/A.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/out/A.java
@@ -1,4 +1,12 @@
package p;
-class A<T extends A<T>> {}
-class B<T> extends A<B<T>> {}
+class A<T> {
+ class E implements I<T> {
+ public void foo() {
+ E m = (E) this;
+ }
+ }
+}
+
+interface I<K> {
+}
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_in/TestTwoFragmentsWithSetter.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_in/TestTwoFragmentsWithSetter.java
index c11b7803d..769fc9c42 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_in/TestTwoFragmentsWithSetter.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_in/TestTwoFragmentsWithSetter.java
@@ -1,7 +1,7 @@
package base_in;
public class TestTwoFragments {
- int anotherField, field;
+ @Deprecated volatile int anotherField, field;
public int getField(){
return field;
}
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_out/TestTwoFragmentsWithSetter.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_out/TestTwoFragmentsWithSetter.java
index f66e1f3b3..1ed96f20a 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_out/TestTwoFragmentsWithSetter.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_out/TestTwoFragmentsWithSetter.java
@@ -1,8 +1,9 @@
package base_out;
public class TestTwoFragments {
- int anotherField;
- private int field;
+ @Deprecated volatile int anotherField;
+ @Deprecated
+ private volatile int field;
public int getField(){
return field;
}
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java
index 8ff6749a1..66c0c1762 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -460,4 +460,9 @@ public class InferTypeArgumentsTests extends RefactoringTest {
performCuOK();
}
+ public void testCuParameterizedTypes2() throws Exception {
+ // regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=216627
+ performCuOK();
+ }
+
}
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/all/AllAllRefactoringTests.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/all/AllAllRefactoringTests.java
index 9531fadf8..45a8d9a8e 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/all/AllAllRefactoringTests.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/all/AllAllRefactoringTests.java
@@ -19,7 +19,7 @@ public class AllAllRefactoringTests {
public static Test suite ( ) {
TestSuite suite= new TestSuite("All All Refactoring Tests");
suite.addTest(org.eclipse.jdt.ui.tests.refactoring.actions.AllTests.suite());
- suite.addTest(org.eclipse.jdt.ui.tests.refactoring.nls.AllTests.suite());
+ suite.addTest(org.eclipse.jdt.ui.tests.refactoring.nls.NLSTestSuite.suite());
suite.addTest(org.eclipse.jdt.ui.tests.refactoring.AllTests.suite());
suite.addTest(org.eclipse.jdt.ui.tests.refactoring.extensions.AllTests.suite());
suite.addTest(org.eclipse.jdt.ui.tests.refactoring.changes.AllTests.suite());
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/DeleteTest.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/DeleteTest.java
index cdc9c0113..11d78d8d9 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/DeleteTest.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/DeleteTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,6 +35,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.ui.PlatformUI;
@@ -1150,6 +1151,8 @@ public class DeleteTest extends RefactoringTest{
Object[] deleted= new Object[]{a};
Object[] exist= new Object[]{defaultP, file};
doTestUndoRedo(deleted, exist);
+
+ JavaProjectHelper.delete(newJavaProject);
}
public void testDeletePackage12() throws Exception {
@@ -1164,6 +1167,49 @@ public class DeleteTest extends RefactoringTest{
doTestUndoRedo(deleted, exist);
}
+ public void testDeletePackageAndFolder() throws Exception {
+ // folder <- delete
+ // and
+ // newPackage <- delete
+ // newPackage.A
+ // newPackage.file
+ // Both the package and the folder must be deleted.
+ ParticipantTesting.reset();
+ IProject project= RefactoringTestSetup.getProject().getProject();
+ IFolder folder= project.getFolder("folder");
+ folder.create(true, true, null);
+ IPackageFragment newPackage= getRoot().createPackageFragment("newPackage", true, new NullProgressMonitor());
+ assertTrue("folder does not exist", folder.exists());
+ assertTrue("package not created", newPackage.exists());
+ String cuContents= "public class A {}";
+ ICompilationUnit cu= newPackage.createCompilationUnit("A.java", cuContents, false, null);
+ IFile file= ((IContainer)newPackage.getResource()).getFile(new Path("Z.txt"));
+ file.create(getStream("123"), true, null);
+
+ Object[] elements= { folder, newPackage };
+ verifyEnabled(elements);
+ performDummySearch();
+ String[] deleteHandles= ParticipantTesting.createHandles(folder, newPackage, newPackage.getResource());
+
+ DeleteRefactoring ref= createRefactoring(elements);
+ RefactoringStatus status= performRefactoring(ref, true);
+ assertEquals("expected to pass", null, status);
+ assertTrue("folder not deleted", !folder.exists());
+ assertTrue("package not deleted", !newPackage.exists());
+
+ ParticipantTesting.testDelete(deleteHandles);
+
+ IUndoManager undoManager= RefactoringCore.getUndoManager();
+ undoManager.performUndo(null, new NullProgressMonitor());
+ assertTrue(folder.exists());
+ assertTrue(newPackage.exists());
+ assertTrue(file.exists());
+ assertEquals(cuContents, cu.getSource());
+ undoManager.performRedo(null, new NullProgressMonitor());
+ assertTrue(!folder.exists());
+ assertTrue(!newPackage.exists());
+ }
+
/* Don't rename! See #suite() */
public void test_END_DeletePackageSub1() throws Exception {
// a0.a1.a2 <-delete with subs
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/AllTests.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NLSTestSuite.java
index 8f9699312..a23bd0a02 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/AllTests.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NLSTestSuite.java
@@ -15,7 +15,7 @@ import junit.framework.Test;
import junit.framework.TestSuite;
-public class AllTests {
+public class NLSTestSuite {
public static Test suite ( ) {
TestSuite suite = new TestSuite();

Back to the top