Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-02-15 15:22:51 -0500
committerJean Michel-Lemieux2002-02-15 15:22:51 -0500
commit675459ae33db3003d9362850579b756437ef676f (patch)
tree79e84d7f9d0f89b4742aed3e06b935dca5ae3f86
parent7792843a2cf06b8e38f5f8ca817662f75bbd8a50 (diff)
downloadeclipse.platform.team-675459ae33db3003d9362850579b756437ef676f.tar.gz
eclipse.platform.team-675459ae33db3003d9362850579b756437ef676f.tar.xz
eclipse.platform.team-675459ae33db3003d9362850579b756437ef676f.zip
1. Updating for change to how conflicting deletions are handled.
2. Added waits when setting content so that tests pass on fast machines.
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java27
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java1
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java17
3 files changed, 11 insertions, 34 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java
index 8c73c9749..57913e7fb 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java
@@ -436,33 +436,6 @@ public class LocalFolderTest extends JUnitTestCase {
assertEquals(true,folder2.isManaged());
}
- public void testNotExistingFail() throws Exception {
-
- ICVSFolder folder3 = folder2.getFolder("nextFolder");
- ICVSFile file3 = folder2.getFile("file1.txt");
-
- try {
- folder3.setSyncInfo(new ResourceSyncInfo(folder3.getName()));
- fail();
- } catch (Exception e) {}
-
- // I do not know whether to check for null or for the
- // file with an extended path
- folder2.getFile("this");
- folder2.getFolder("that");
-
- try {
- folder2.getChild("this");
- fail();
- } catch (CVSException e) {}
-
- try {
- folder2.setSyncInfo(new ResourceSyncInfo(folder2.getName()+"X"));
- fail();
- } catch (Exception e) {
- }
- }
-
protected void reload(ICVSResource resource) throws CVSException {
CVSProviderPlugin.getSynchronizer().reload(((LocalResource)resource).getLocalFile(), new NullProgressMonitor());
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
index a8c672c96..f554913bc 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
@@ -78,6 +78,7 @@ public class CVSProviderTest extends EclipseTest {
// Perform some operations on the copy
addResources(copy, new String[] { "added.txt", "folder2/", "folder2/added.txt" }, false);
IFile file = copy.getFile("changed.txt");
+ JUnitTestCase.waitMsec(1500);
file.setContents(getRandomContents(), false, false, null);
getProvider(copy).delete(new IResource[] {copy.getFile("deleted.txt")}, 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 11feb1ce3..68922d9ac 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
@@ -54,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("testDeletionConflicts"));
+ //return new CVSTestSetup(new SyncElementTest("testOutgoingChanges"));
}
/*
@@ -186,6 +186,7 @@ public class SyncElementTest extends EclipseTest {
// Make some modifications
IFile file = project.getFile("folder1/a.txt");
+ JUnitTestCase.waitMsec(1500); // Wait so that timestamp of modified file differs from original
file.setContents(getRandomContents(), false, false, null);
addResources(project, new String[] { "folder2/folder3/add.txt" }, false);
deleteResources(project, new String[] {"folder1/b.txt"}, false);
@@ -249,8 +250,8 @@ public class SyncElementTest extends EclipseTest {
// Update the resource sync info so the resources can be commited
// Merge won't work for folders so we'll add them explicilty!!!
- addResources(project, new String[] {"folder2/", "folder2/folder3/"}, false);
- makeOutgoing(tree, new String[] {"folder1/b.txt", "folder2/folder3/add.txt"});
+ addResources(project, new String[] {"folder2/", "folder2/folder3/", "folder2/folder3/add.txt"}, false);
+ deleteResources(project, new String[] {"folder1/b.txt"}, false);
commitResources(project, new String[] {"folder1/b.txt", "folder2/folder3/add.txt"});
// Ensure we are in sync
@@ -434,6 +435,7 @@ public class SyncElementTest extends EclipseTest {
file.delete(false, DEFAULT_MONITOR);
deleteResources(project, new String[] {"delete2.txt"}, false);
file = project.getFile("delete3.txt");
+ JUnitTestCase.waitMsec(1500); // Wait so that timestamp of modified file differs from original
file.setContents(getRandomContents(), false, false, null);
file = project.getFile("delete4.txt");
file.delete(false, DEFAULT_MONITOR);
@@ -459,8 +461,8 @@ public class SyncElementTest extends EclipseTest {
IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.CHANGE,
IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.CHANGE,
IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.CHANGE,
- IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.DELETION | IRemoteSyncElement.PSEUDO_CONFLICT,
- IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.DELETION | IRemoteSyncElement.PSEUDO_CONFLICT });
+ IRemoteSyncElement.IN_SYNC,
+ IRemoteSyncElement.IN_SYNC });
// Catch up to remote changes.
// XXX SPECIAL CASE: delete2.txt must be unmanaged before the catch-up
@@ -511,8 +513,8 @@ public class SyncElementTest extends EclipseTest {
IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.CHANGE,
IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.CHANGE,
IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.CHANGE,
- IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.DELETION | IRemoteSyncElement.PSEUDO_CONFLICT,
- IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.DELETION | IRemoteSyncElement.PSEUDO_CONFLICT });
+ IRemoteSyncElement.IN_SYNC,
+ IRemoteSyncElement.IN_SYNC });
// Release the resources
// XXX SPECIAL CASE: "delete1.txt", "delete2.txt" and "delete3.txt" must be merged
@@ -710,6 +712,7 @@ public class SyncElementTest extends EclipseTest {
// Make some modifications
IFile file = project.getFile("folder1/a.txt");
+ JUnitTestCase.waitMsec(1500); // Wait so that timestamp of modified file differs from original
file.setContents(getRandomContents(), false, false, null);
addResources(project, new String[] { "folder1/add.txt" }, false);
deleteResources(project, new String[] {"folder1/b.txt"}, false);

Back to the top