Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-04-08 14:07:06 -0400
committerMichael Valenta2002-04-08 14:07:06 -0400
commitc94964535e96bbe9cf7586b7e7706d052fc21909 (patch)
tree095d79850fbd1a235d01716806a7546e08a6eef3
parentb5935bd742b333e41c5c095f4742bdf24f05b639 (diff)
downloadeclipse.platform.team-c94964535e96bbe9cf7586b7e7706d052fc21909.tar.gz
eclipse.platform.team-c94964535e96bbe9cf7586b7e7706d052fc21909.tar.xz
eclipse.platform.team-c94964535e96bbe9cf7586b7e7706d052fc21909.zip
*** empty log message ***
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ImportTest.java51
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java6
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java17
4 files changed, 69 insertions, 7 deletions
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 c5e47a08d..2ea343d64 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
@@ -240,7 +240,7 @@ public class EclipseTest extends EclipseWorkspaceTest {
protected IProject checkoutProject(IProject project, String moduleName, CVSTag tag) throws TeamException {
if (project == null)
- project = getWorkspace().getRoot().getProject(moduleName);
+ project = getWorkspace().getRoot().getProject(new Path(moduleName).lastSegment());
CVSProviderPlugin.getProvider().checkout(getRepository(), project, moduleName, tag, DEFAULT_MONITOR);
return project;
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ImportTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ImportTest.java
index 9ee539e6d..3a7332686 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ImportTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ImportTest.java
@@ -8,13 +8,19 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import junit.framework.Test;
+import junit.framework.TestSuite;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
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.Path;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.core.TeamException;
+import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
/**
@@ -38,6 +44,12 @@ public class ImportTest extends EclipseTest {
super(name);
}
+ public static Test suite() {
+ TestSuite suite = new TestSuite(ImportTest.class);
+ return new CVSTestSetup(suite);
+ //return new CVSTestSetup(new ImportTest("testReadOnly"));
+ }
+
// Assert that the two containers have equal contents
protected void assertEquals(IContainer container1, IContainer container2) throws CoreException {
assertEquals(container1.getName(), container2.getName());
@@ -69,12 +81,12 @@ public class ImportTest extends EclipseTest {
protected void assertEquals(IProject container1, IProject container2) throws CoreException {
List members1 = new ArrayList();
members1.addAll(Arrays.asList(container1.members()));
- members1.remove(container1.findMember(".vcm_meta"));
+ members1.remove(container1.findMember(".project"));
members1.remove(container1.findMember("CVS"));
List members2 = new ArrayList();
members2.addAll(Arrays.asList(container2.members()));
- members2.remove(container2.findMember(".vcm_meta"));
+ members2.remove(container2.findMember(".project"));
members2.remove(container2.findMember("CVS"));
assertTrue("Number of children differs for " + container1.getFullPath(), members1.size() == members2.size());
@@ -105,4 +117,39 @@ public class ImportTest extends EclipseTest {
assertValidCheckout(copy);
assertEquals(project, copy);
}
+
+ public void testCheckout() throws TeamException, CoreException, IOException {
+ // Create a project and checkout a copy
+ IProject project = createProject("testCheckout", new String[] { "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt" });
+ IProject copy = checkoutCopy(project, "-copy");
+
+ // 0. checkout the project again
+ project = checkoutProject(project, null, null);
+ assertEquals(project, copy, true, true);
+
+ // 1. Delete the project but not it's contents and checkout the project again
+ project.delete(false, false, DEFAULT_MONITOR);
+ project = checkoutProject(project, null, null);
+ assertEquals(project, copy, true, true);
+
+ // 2. Delete the project and its contents and use the module name instead of the project
+ project.delete(true, false, DEFAULT_MONITOR);
+ project = checkoutProject(null, project.getName(), null);
+ assertEquals(project, copy, true, true);
+
+ // 3. Create a project in a custom location and check out over it
+ project.delete(true, false, DEFAULT_MONITOR);
+ IProjectDescription desc = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName());
+ //desc.setLocation(new Path("C:\\temp\\project"));
+ project.create(desc, DEFAULT_MONITOR);
+ project = checkoutProject(project, null, null);
+ assertEquals(project, copy, true, true);
+
+ // 4. Checkout something that doesn't contain a .project
+ project.delete(true, false, DEFAULT_MONITOR);
+ project = checkoutProject(null, project.getName() + "/folder1", null);
+ //assertEquals(project, copy.getFolder("folder1"));
+
+
+ }
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
index 7303f8023..149a9b9b8 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
@@ -182,7 +182,7 @@ public class RemoteResourceTest extends EclipseTest {
public void testVersionTag() throws TeamException, CoreException, IOException {
// Create a test project and version it
CVSTag v1Tag = new CVSTag("v1", CVSTag.VERSION);
- IProject project = createProject("testVersionTag", new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder1/b.txt"});
+ IProject project = createProject("testVersionTag", new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder1/b.txt", "folder2/folder3/c.txt"});
tagProject(project, v1Tag);
// Make some changes, additions (including folders) and deletions and commit
@@ -265,11 +265,10 @@ public class RemoteResourceTest extends EclipseTest {
assertEquals("the contents of revision 1.3 are not equal", contents, "bye there");
}
}
-
}
public void testTag() throws TeamException, CoreException, IOException {
- IProject project = createProject("testTag", new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder2/", "folder2/a.txt", "folder2/folder3/", "folder2/folder3/b.txt", "folder2/folder3/c.txt"});
+ IProject project = createProject("testTag", new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder2/folder3/b.txt", "folder2/folder3/c.txt"});
ICVSRemoteFolder remote = (ICVSRemoteFolder)CVSWorkspaceRoot.getRemoteResourceFor(project);
CVSTag tag = new CVSTag("v1", CVSTag.VERSION);
remote.tag(tag, Command.NO_LOCAL_OPTIONS, DEFAULT_MONITOR);
@@ -294,7 +293,6 @@ public class RemoteResourceTest extends EclipseTest {
CVSTestSetup.executeRemoteCommand(getRepository(), "rm -rf " + ((ICVSFolder)resource2).getFolderSyncInfo().getRemoteLocation());
assertTrue( ! resource2.exists(DEFAULT_MONITOR));
}
-
}
}
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 9dad1da2d..721dd870e 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
@@ -830,4 +830,21 @@ public class SyncElementTest extends EclipseTest {
new int[] { IRemoteSyncElement.IN_SYNC,
IRemoteSyncElement.IN_SYNC});
}
+ /**
+ * There is special handling required when building a sync tree for a tag when there are undiscovered folders
+ * that only contain other folders.
+ */
+ public void testTagRetrievalForFolderWithNoFile() throws TeamException, CoreException {
+ IProject project = createProject("testTagRetrievalForFolderWithNoFile", new String[] { "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt"});
+ // Checkout, branch and modify a copy
+ IProject copy = checkoutCopy(project, "-copy");
+ CVSTag version = new CVSTag("v1", CVSTag.BRANCH);
+ CVSTag branch = new CVSTag("branch1", CVSTag.BRANCH);
+ getProvider(copy).makeBranch(new IResource[] {copy}, version, branch, true, true, DEFAULT_MONITOR);
+ addResources(copy, new String[] {"folder2/folder3/a.txt"}, true);
+
+ // Fetch the tree corresponding to the branch using the original as the base.
+ // XXX This will fail for CVSNT with directory pruning on
+ IRemoteSyncElement tree = CVSWorkspaceRoot.getRemoteSyncTree(project, branch, DEFAULT_MONITOR);
+ }
} \ No newline at end of file

Back to the top