Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-05-18 23:01:45 +0000
committerStephan Herrmann2010-05-18 23:01:45 +0000
commit32cb6da48f218fc50a22c4ae03c2dd7c21e60818 (patch)
tree1d789f9620af7ac5cf470bfcdaf74cf36cefea53 /testplugins/org.eclipse.jdt.ui.tests.refactoring
parentf5e39214a08f5ef77eb0970a3414ccdf09ed05ac (diff)
downloadorg.eclipse.objectteams-32cb6da48f218fc50a22c4ae03c2dd7c21e60818.tar.gz
org.eclipse.objectteams-32cb6da48f218fc50a22c4ae03c2dd7c21e60818.tar.xz
org.eclipse.objectteams-32cb6da48f218fc50a22c4ae03c2dd7c21e60818.zip
update jdt.ui tests to v20100513-0800 for 3.6RC1.
Diffstat (limited to 'testplugins/org.eclipse.jdt.ui.tests.refactoring')
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/positive/A_testArrayValuedAnnotations_in.java13
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/positive/A_testArrayValuedAnnotations_out.java13
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/AllChangeTests.java4
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeTypeRefactoringTests.java15
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/DocumentChangeTest.java17
5 files changed, 60 insertions, 2 deletions
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/positive/A_testArrayValuedAnnotations_in.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/positive/A_testArrayValuedAnnotations_in.java
new file mode 100644
index 000000000..953cf2890
--- /dev/null
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/positive/A_testArrayValuedAnnotations_in.java
@@ -0,0 +1,13 @@
+public class A_testVarArg_in {
+ @XSet(value = { @X })
+ public String foo() { // generalize String
+ return "";
+ }
+}
+
+@interface XSet {
+ public X[] value();
+}
+
+@interface X {
+}
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/positive/A_testArrayValuedAnnotations_out.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/positive/A_testArrayValuedAnnotations_out.java
new file mode 100644
index 000000000..ddcd39d7e
--- /dev/null
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/positive/A_testArrayValuedAnnotations_out.java
@@ -0,0 +1,13 @@
+public class A_testVarArg_in {
+ @XSet(value = { @X })
+ public Object foo() { // generalize String
+ return "";
+ }
+}
+
+@interface XSet {
+ public X[] value();
+}
+
+@interface X {
+}
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/AllChangeTests.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/AllChangeTests.java
index a003a342c..18305d56e 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/AllChangeTests.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/AllChangeTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 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
@@ -21,6 +21,8 @@ public class AllChangeTests {
suite.addTest(new TestSuite(RenameResourceChangeTests.class));
suite.addTest(new TestSuite(RenameSourceFolderChangeTests.class));
suite.addTest(new TestSuite(CopyPackageChangeTest.class));
+ suite.addTest(new TestSuite(CopyPackageChangeTest.class));
+ suite.addTest(DocumentChangeTest.suiteWithoutRefactoringTestSetup());
return new RefactoringTestSetup(suite);
}
}
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeTypeRefactoringTests.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeTypeRefactoringTests.java
index 2a55a9f03..76d14014b 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeTypeRefactoringTests.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeTypeRefactoringTests.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
@@ -571,6 +571,19 @@ public class ChangeTypeRefactoringTests extends RefactoringTest {
StringAsserts.assertEqualStringsIgnoreOrder(actual, expected);
}
+ public void testArrayValuedAnnotations() throws Exception {
+ // test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=311099
+ Collection types= helper1(3, 12, 3, 12, "java.lang.Object").getValidTypeNames();
+ String[] actual= (String[]) types.toArray(new String[types.size()]);
+ String[] expected= {
+ "java.lang.Object",
+ "java.io.Serializable",
+ "java.lang.Comparable<java.lang.String>",
+ "java.lang.CharSequence"
+ };
+ StringAsserts.assertEqualStringsIgnoreOrder(actual, expected);
+ }
+
// tests that are supposed to fail
public void testInvalidSelection() throws Exception {
diff --git a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/DocumentChangeTest.java b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/DocumentChangeTest.java
index 0a7c82516..7eca5aed3 100644
--- a/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/DocumentChangeTest.java
+++ b/testplugins/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/DocumentChangeTest.java
@@ -12,6 +12,7 @@ package org.eclipse.jdt.ui.tests.refactoring;
import java.lang.reflect.InvocationTargetException;
+import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -41,6 +42,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
@@ -67,6 +69,21 @@ public class DocumentChangeTest extends RefactoringTest {
return setUpTest(new TestSuite(DocumentChangeTest.class));
}
+ public static Test suiteWithoutRefactoringTestSetup() {
+ return new TestSetup(new TestSuite(DocumentChangeTest.class)) {
+ protected void setUp() throws Exception {
+ PlatformUI.getWorkbench().showPerspective(JavaUI.ID_PERSPECTIVE, JavaPlugin.getActiveWorkbenchWindow());
+ }
+
+ protected void tearDown() throws Exception {
+ IWorkbenchPage activePage= JavaPlugin.getActivePage();
+ if (activePage != null) {
+ activePage.closeAllPerspectives(true, true);
+ }
+ }
+ };
+ }
+
public static Test setUpTest(Test test) {
return new RefactoringTestSetup(test) {
protected void setUp() throws Exception {

Back to the top