Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-01-31 13:13:14 +0000
committerMichael Valenta2002-01-31 13:13:14 +0000
commit51898a2c1aa56de888337d78898cc6c60b82bc32 (patch)
treea718cdf7a39ed2564403da03ca474d31fc6182d1
parent80704e552f55c795b84fdd54f982e85cd9e4c265 (diff)
downloadeclipse.platform.team-51898a2c1aa56de888337d78898cc6c60b82bc32.tar.gz
eclipse.platform.team-51898a2c1aa56de888337d78898cc6c60b82bc32.tar.xz
eclipse.platform.team-51898a2c1aa56de888337d78898cc6c60b82bc32.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java6
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java35
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java3
3 files changed, 41 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
index c51a2e3d9..2bc7a9989 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
@@ -14,6 +14,7 @@ import java.util.StringTokenizer;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
@@ -160,7 +161,7 @@ public class RemoteModule extends RemoteFolder {
}
/*
- * Override of inherited method which persists the children
+ * Override of inherited getMembers in order to combine the physical members with any referenced modules
*/
public ICVSRemoteResource[] getMembers(CVSTag tagName, IProgressMonitor monitor) throws TeamException {
ICVSRemoteResource[] physicalChildren;
@@ -185,6 +186,9 @@ public class RemoteModule extends RemoteFolder {
return allChildren;
}
+ /*
+ * Set the children to a static set of children
+ */
protected void setChildren(ICVSRemoteResource[] children) {
super.setChildren(children);
if ( ! folderInfo.getIsStatic())
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index ee3e3c1ab..c52419632 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -12,9 +12,10 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
-import org.eclipse.core.internal.resources.Synchronizer;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -27,6 +28,7 @@ import org.eclipse.core.tests.harness.EclipseWorkspaceTest;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.team.internal.ccvs.core.CVSException;
@@ -43,6 +45,7 @@ import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
+import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
@@ -326,6 +329,36 @@ public class EclipseTest extends EclipseWorkspaceTest {
}
}
+
+ /*
+ * Compare folders by comparing their folder sync info and there children
+ *
+ * XXX What about unmanaged children?
+ */
+ protected void assertEquals(RemoteFolder container1, RemoteFolder container2, boolean includeTags) throws CoreException, TeamException, IOException {
+ assertEquals("Folder information differs", container1.getFolderSyncInfo(), container2.getFolderSyncInfo(), includeTags);
+ ICVSRemoteResource[] members1 = container1.getMembers(DEFAULT_MONITOR);
+ ICVSRemoteResource[] members2 = container2.getMembers(DEFAULT_MONITOR);
+ assertTrue("Number of members differ", members1.length == members2.length);
+ Map memberMap2 = new HashMap();
+ for (int i= 0;i <members2.length;i++) {
+ memberMap2.put(members2[i].getName(), members2[i]);
+ }
+ for (int i= 0;i <members1.length;i++) {
+ ICVSRemoteResource member2 = (ICVSRemoteResource)memberMap2.get(members1[i].getName());
+ assertNotNull(member2);
+ assertEquals(members1[i], member2, includeTags);
+ }
+ }
+ protected void assertEquals(ICVSRemoteResource resource1, ICVSRemoteResource resource2, boolean includeTags) throws CoreException, TeamException, IOException {
+ assertEquals("Resource types do not match", resource1.isContainer(), resource2.isContainer());
+ if (resource1.isContainer())
+ assertEquals((RemoteFolder)resource1, (RemoteFolder)resource2, includeTags);
+ else
+ assertEquals("File comparison failed", (ICVSFile)resource1, (ICVSFile)resource2, true, includeTags);
+ }
+
+
/*
* Compare the local project with the remote state by checking out a copy of the project.
*/
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
index 8feaf3d20..a321f651b 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
@@ -24,6 +24,7 @@ import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
import org.eclipse.team.internal.ccvs.core.resources.RemoteModule;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
@@ -142,7 +143,7 @@ public class ModuleTest extends EclipseTest {
IRemoteSyncElement tree = getProvider(project1).getRemoteSyncTree(project1, CVSTag.DEFAULT, DEFAULT_MONITOR);
assertEquals("Local does not match remote", Session.getManagedResource(project1), (ICVSResource)tree.getRemote(), false, false);
RemoteModule module = getRemoteModule("project1");
- assertEquals("Local does not match module", Session.getManagedResource(project1), module, false, false);
+ assertEquals((RemoteFolder)tree.getRemote(), module, false);
}
/*

Back to the top