diff options
author | Stephan Herrmann | 2012-12-04 17:32:21 +0000 |
---|---|---|
committer | Stephan Herrmann | 2012-12-04 17:32:21 +0000 |
commit | bea1ae76d13cfcaf3432e7c808b690afd557859c (patch) | |
tree | a2cdd05159170c8f30a249baa783e53d7fe332da /testplugins | |
parent | 9dc8e8860b9fa7710f42a7c1f6addb11bf2f4922 (diff) | |
download | org.eclipse.objectteams-bea1ae76d13cfcaf3432e7c808b690afd557859c.tar.gz org.eclipse.objectteams-bea1ae76d13cfcaf3432e7c808b690afd557859c.tar.xz org.eclipse.objectteams-bea1ae76d13cfcaf3432e7c808b690afd557859c.zip |
Adopt JDT/UI change for bug 391927 via their commit
a9d28d0d237966d409e0e603033f3ce8cddb5d35
(Method safeDelete has been removed and isn't needed actually).
Diffstat (limited to 'testplugins')
2 files changed, 34 insertions, 46 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveBaseClassTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveBaseClassTests.java index c0d6a7b5b..fb06cc541 100644 --- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveBaseClassTests.java +++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveBaseClassTests.java @@ -62,30 +62,23 @@ public team class MoveBaseClassTests extends TestCase { "import base b.B;\n" + "team class T1{void foo(){}protected class Role playedBy B{}}", false, new NullProgressMonitor()); - try { - IType baseType = cuB.getTypes()[0]; - IJavaElement[] javaElements= {baseType}; - IResource[] resources= {}; - JavaMoveProcessor ref= verifyEnabled(resources, javaElements, createReorgQueries()); + IType baseType = cuB.getTypes()[0]; + IJavaElement[] javaElements= {baseType}; + IResource[] resources= {}; + JavaMoveProcessor ref= verifyEnabled(resources, javaElements, createReorgQueries()); + + Object destination= packBTemp; + verifyValidDestination(ref, destination); - Object destination= packBTemp; - verifyValidDestination(ref, destination); - - RefactoringStatus status= performRefactoring(ref, true); - assertEquals(null, status); - - // expect that base import has been updated in cuT: - String expectedSource2= - "package p;\n" + - "import base b.temp.B;\n" + - "team class T1{void foo(){}protected class Role playedBy B{}}"; - assertEqualLines("source compare failed", expectedSource2, cuT.getSource()); - - } finally { - performDummySearch(); - safeDelete(cuT); - safeDelete(packBTemp.getCompilationUnit("B.java")); - } + RefactoringStatus status= performRefactoring(ref, true); + assertEquals(null, status); + + // expect that base import has been updated in cuT: + String expectedSource2= + "package p;\n" + + "import base b.temp.B;\n" + + "team class T1{void foo(){}protected class Role playedBy B{}}"; + assertEqualLines("source compare failed", expectedSource2, cuT.getSource()); } } diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveRoleTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveRoleTests.java index 3ef9e32fb..502429925 100644 --- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveRoleTests.java +++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveRoleTests.java @@ -57,31 +57,26 @@ public team class MoveRoleTests extends TestCase { packB.createCompilationUnit("B.java", "package b;public class B {}", true, null); ICompilationUnit cu1= getPackageP().createCompilationUnit("T1.java", "package p;import base b.B;team class T1{void foo(){}protected class Role playedBy B{}}", false, new NullProgressMonitor()); ICompilationUnit cu2= getPackageP().createCompilationUnit("T2.java", "package p;team class T2{void bar(){}}", false, new NullProgressMonitor()); - try { - IType teamType = cu1.getTypes()[0]; - IType roleType = teamType.getType("Role"); - IJavaElement[] javaElements= { roleType }; - IResource[] resources= {}; - JavaMoveProcessor ref= verifyEnabled(resources, javaElements, createReorgQueries()); - - Object destination= cu2.getTypes()[0]; - verifyValidDestination(ref, destination); - - RefactoringStatus status= performRefactoring(ref, true); - assertEquals(null, status); - - // expect that base import has been added to cu2: - String expectedSource2= "package p;\nimport base b.B;\nteam class T2{protected class Role playedBy B{}\n\nvoid bar(){}}"; - assertEqualLines("source compare failed", expectedSource2, cu2.getSource()); - // expect that base import has been removed from cu1: - String expectedSource1= "package p;team class T1{void foo(){}}"; - assertEqualLines("source compare failed", expectedSource1, cu1.getSource()); + IType teamType = cu1.getTypes()[0]; + IType roleType = teamType.getType("Role"); + IJavaElement[] javaElements= { roleType }; + IResource[] resources= {}; + JavaMoveProcessor ref= verifyEnabled(resources, javaElements, createReorgQueries()); + + Object destination= cu2.getTypes()[0]; + verifyValidDestination(ref, destination); - } finally { - performDummySearch(); - safeDelete(cu2); - } + RefactoringStatus status= performRefactoring(ref, true); + assertEquals(null, status); + + // expect that base import has been added to cu2: + String expectedSource2= "package p;\nimport base b.B;\nteam class T2{protected class Role playedBy B{}\n\nvoid bar(){}}"; + assertEqualLines("source compare failed", expectedSource2, cu2.getSource()); + + // expect that base import has been removed from cu1: + String expectedSource1= "package p;team class T1{void foo(){}}"; + assertEqualLines("source compare failed", expectedSource1, cu1.getSource()); } } |