Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-11-24 17:15:56 +0000
committerMichael Valenta2003-11-24 17:15:56 +0000
commit0ed6496dfb8965c60f7acf21f00e1f00c29acb40 (patch)
treed7a075134432191e64267dd0b8b2f6762be60b32 /tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team
parentbae585d14485d902351e0edeaff1253d0c36b470 (diff)
downloadeclipse.platform.team-0ed6496dfb8965c60f7acf21f00e1f00c29acb40.tar.gz
eclipse.platform.team-0ed6496dfb8965c60f7acf21f00e1f00c29acb40.tar.xz
eclipse.platform.team-0ed6496dfb8965c60f7acf21f00e1f00c29acb40.zip
46629: Cannot share project in a sub directory of a module
Diffstat (limited to 'tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team')
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java20
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ImportTest.java25
2 files changed, 42 insertions, 3 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 ae1860442..9aee85d69 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
@@ -22,7 +22,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import junit.framework.*;
+import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -32,7 +32,6 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -40,6 +39,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.tests.harness.EclipseWorkspaceTest;
import org.eclipse.swt.widgets.Display;
@@ -71,6 +71,7 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.SyncFileChangeListener;
import org.eclipse.team.internal.ccvs.ui.operations.CVSOperation;
import org.eclipse.team.internal.ccvs.ui.operations.CheckoutSingleProjectOperation;
+import org.eclipse.team.internal.ccvs.ui.operations.ShareProjectOperation;
import org.eclipse.team.internal.ccvs.ui.operations.ITagOperation;
import org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation;
import org.eclipse.team.internal.ccvs.ui.operations.TagInRepositoryOperation;
@@ -718,7 +719,20 @@ public class EclipseTest extends EclipseWorkspaceTest {
}
protected void mapNewProject(IProject project) throws TeamException {
- CVSWorkspaceRoot.createModule(getRepository(), project, null, DEFAULT_MONITOR);
+ shareProject(getRepository(), project, null, DEFAULT_MONITOR);
+ }
+
+ /**
+ * Map the given local project to remote folder, creating the remote folder or any of
+ * its ancestors as necessary.
+ * @param location
+ * @param project
+ * @param moduleName
+ * @param default_monitor
+ */
+ protected void shareProject(CVSRepositoryLocation location, IProject project, String moduleName, IProgressMonitor default_monitor) throws CVSException {
+ ShareProjectOperation op = new ShareProjectOperation(null, location, project, moduleName);
+ executeHeadless(op);
}
protected void commitNewProject(IProject project) throws CoreException, CVSException, TeamException {
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 99d22d990..c74dbd5d2 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
@@ -157,4 +157,29 @@ public class ImportTest extends EclipseTest {
}
+
+ public void testRootShare() throws CoreException {
+ // Create a test project
+ IProject project = getUniqueTestProject(getName());
+ IResource[] result = buildResources(project, new String[] { "file1.txt", "folder1/", "folder1/a.txt" }, true);
+ // Share the project
+ shareProject(getRepository(), project, null, DEFAULT_MONITOR);
+ addResources(project, new String[] { "file1.txt", "folder1/", "folder1/a.txt" }, true);
+ // Checkout a copy ans test
+ IProject copy = checkoutProject(getUniqueTestProject(getName() + "copy"), project.getName(), null);
+ assertEquals(project, copy);
+ }
+
+ public void testNonRootShare() throws CoreException {
+ // Create a test project
+ IProject project = getUniqueTestProject(getName());
+ IResource[] result = buildResources(project, new String[] { "file1.txt", "folder1/", "folder1/a.txt" }, true);
+ // Share it as a non-root folder in the repository
+ String moduleName = "root" + Long.toString(System.currentTimeMillis()) + "/" + project.getName();
+ shareProject(getRepository(), project, moduleName, DEFAULT_MONITOR);
+ addResources(project, new String[] { "file1.txt", "folder1/", "folder1/a.txt" }, true);
+ // Checkout a copy and test
+ IProject copy = checkoutProject(getUniqueTestProject(getName() + "copy"), moduleName, null);
+ assertEquals(project, copy);
+ }
}

Back to the top