Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-03-15 17:46:52 +0000
committerJean Michel-Lemieux2002-03-15 17:46:52 +0000
commit65ff54707ee6409ba7e0d3ebba384d02f8893283 (patch)
treed183f3b627adac424ce5073aca579ff73aac0beb
parent3d390fff6489beda97cf85019844130f88b70a52 (diff)
downloadeclipse.platform.team-65ff54707ee6409ba7e0d3ebba384d02f8893283.tar.gz
eclipse.platform.team-65ff54707ee6409ba7e0d3ebba384d02f8893283.tar.xz
eclipse.platform.team-65ff54707ee6409ba7e0d3ebba384d02f8893283.zip
Bug 11192: Internal error moving project
- added testRenameProject
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java21
2 files changed, 21 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
index 86f100d22..33089cc3a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
@@ -334,7 +334,7 @@ public class EclipseSynchronizer {
HashMap children = (HashMap)parent.getSessionProperty(RESOURCE_SYNC_KEY);
if(children!=null) {
if(info==null) {
- children.remove(resource);
+ children.remove(resource.getName());
} else {
// replace or add new resource sync
children.put(resource.getName(), info);
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java
index fb52d9f59..d13746c42 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java
@@ -12,7 +12,9 @@ import junit.framework.TestSuite;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -52,7 +54,7 @@ public class SyncElementTest extends EclipseTest {
public static Test suite() {
TestSuite suite = new TestSuite(SyncElementTest.class);
return new CVSTestSetup(suite);
- //return new CVSTestSetup(new SyncElementTest("testFileConflict"));
+ //return new CVSTestSetup(new SyncElementTest("testRenameProject"));
}
/*
@@ -784,4 +786,21 @@ public class SyncElementTest extends EclipseTest {
IRemoteSyncElement tree = CVSWorkspaceRoot.getRemoteSyncTree(project, null, DEFAULT_MONITOR);
assertEquals(Path.EMPTY, (ICVSResource)tree.getRemote(), CVSWorkspaceRoot.getCVSResourceFor(copy), false, false);
}
+
+ public void testRenameProject() throws TeamException, CoreException, IOException {
+ String[] resourceNames = new String[] { "changed.txt", "folder1/", "folder1/a.txt" };
+ int[] inSync = new int[] {IRemoteSyncElement.IN_SYNC, IRemoteSyncElement.IN_SYNC, IRemoteSyncElement.IN_SYNC};
+ IProject project = createProject("testRenameProject", new String[] { "changed.txt", "folder1/", "folder1/a.txt" });
+
+ IRemoteSyncElement tree = CVSWorkspaceRoot.getRemoteSyncTree(project, CVSTag.DEFAULT, DEFAULT_MONITOR);
+ assertSyncEquals("sync should be in sync", tree, resourceNames, inSync);
+ IProjectDescription desc = project.getDescription();
+ String newName = project.getName() + "_renamed";
+ desc.setName(newName);
+ project.move(desc, false, null);
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(newName);
+ assertTrue(project.exists());
+ tree = CVSWorkspaceRoot.getRemoteSyncTree(project, CVSTag.DEFAULT, DEFAULT_MONITOR);
+ assertSyncEquals("sync should be in sync", tree, resourceNames, inSync);
+ }
} \ No newline at end of file

Back to the top