Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-12-03 17:23:14 +0000
committerMichael Valenta2003-12-03 17:23:14 +0000
commit6d722bc601b2e70f6fb3e50f5aea7fa2364c9ef1 (patch)
tree2847ec3d1e6255fd4a5a3438c2342a4e9e6bacd8 /tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team
parent5f99d331f258bc2c26cce23d8b9aa71355df5c85 (diff)
downloadeclipse.platform.team-6d722bc601b2e70f6fb3e50f5aea7fa2364c9ef1.tar.gz
eclipse.platform.team-6d722bc601b2e70f6fb3e50f5aea7fa2364c9ef1.tar.xz
eclipse.platform.team-6d722bc601b2e70f6fb3e50f5aea7fa2364c9ef1.zip
Fixed nested MarkAsMerged bug
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/subscriber/CVSMergeSubscriberTest.java8
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSSyncSubscriberTest.java26
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java29
3 files changed, 49 insertions, 14 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSMergeSubscriberTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSMergeSubscriberTest.java
index 598b58f03..729094d9e 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSMergeSubscriberTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSMergeSubscriberTest.java
@@ -74,14 +74,6 @@ public class CVSMergeSubscriberTest extends CVSSyncSubscriberTest {
action.getRunnable(new SyncInfoSet(infos)).run(DEFAULT_MONITOR);
}
-
- private void markAsMerged(CVSMergeSubscriber subscriber, IProject project, String[] resourcePaths) throws CoreException, TeamException, InvocationTargetException, InterruptedException {
- IResource[] resources = getResources(project, resourcePaths);
- SyncInfo[] infos = createSyncInfos(subscriber, resources);
- TestMarkAsMergedAction action = new TestMarkAsMergedAction();
- action.getRunnable(new SyncInfoSet(infos)).run(DEFAULT_MONITOR);
- }
-
/**
* Test the basic incoming changes cases
* - incoming addition
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSSyncSubscriberTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSSyncSubscriberTest.java
index 2c715cddf..c65d34f9b 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSSyncSubscriberTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSSyncSubscriberTest.java
@@ -10,18 +10,31 @@
*******************************************************************************/
package org.eclipse.team.tests.ccvs.core.subscriber;
-import java.util.*;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
import junit.framework.AssertionFailedError;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.*;
+import org.eclipse.team.core.subscribers.ITeamResourceChangeListener;
+import org.eclipse.team.core.subscribers.SyncInfo;
+import org.eclipse.team.core.subscribers.TeamDelta;
+import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.core.sync.RemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
import org.eclipse.team.tests.ccvs.ui.SynchronizeViewTestAdapter;
+import org.eclipse.team.ui.synchronize.actions.SyncInfoSet;
/**
* Provides test methods common to CVS sync subscribers
@@ -218,4 +231,11 @@ public abstract class CVSSyncSubscriberTest extends EclipseTest {
protected void assertProjectRemoved(TeamSubscriber subscriber, IProject project) throws TeamException {
getSyncInfoSource().assertProjectRemoved(subscriber, project);
}
+
+ protected void markAsMerged(CVSSyncTreeSubscriber subscriber, IProject project, String[] resourcePaths) throws CoreException, TeamException, InvocationTargetException, InterruptedException {
+ IResource[] resources = getResources(project, resourcePaths);
+ SyncInfo[] infos = createSyncInfos(subscriber, resources);
+ TestMarkAsMergedAction action = new TestMarkAsMergedAction();
+ action.getRunnable(new SyncInfoSet(infos)).run(DEFAULT_MONITOR);
+ }
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java
index 7d06341dd..72985d296 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java
@@ -62,8 +62,8 @@ public class CVSWorkspaceSubscriberTest extends CVSSyncSubscriberTest {
}
}
- protected TeamSubscriber getSubscriber() throws TeamException {
- return getWorkspaceSubscriber();
+ protected CVSSyncTreeSubscriber getSubscriber() throws TeamException {
+ return (CVSSyncTreeSubscriber)getWorkspaceSubscriber();
}
/* (non-Javadoc)
@@ -1250,6 +1250,29 @@ public class CVSWorkspaceSubscriberTest extends CVSSyncSubscriberTest {
if (syncBytes != null) {
assertTrue(ResourceSyncInfo.isBinary(syncBytes));
}
-
+ }
+
+ public void testNestedMarkAsMerged() throws CoreException, InvocationTargetException, InterruptedException {
+ // Create a project and checkout a copy
+ IProject project = createProject(new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder1/b.txt"});
+ IProject copy = checkoutCopy(project, "-copy");
+ // Add the same resources to both projects to create conflicting additions
+ buildResources(project, new String[] { "folder2/", "folder2/file.txt", "folder2/file2.txt"}, false);
+ addResources(copy, new String[] { "folder2/", "folder2/file.txt", "folder2/file2.txt"}, true);
+ assertSyncEquals("testNestedMarkAsMerged sync check", project,
+ new String[] { "folder2/", "folder2/file.txt", "folder2/file.txt"},
+ true, new int[] {
+ SyncInfo.CONFLICTING | SyncInfo.ADDITION,
+ SyncInfo.CONFLICTING | SyncInfo.ADDITION,
+ SyncInfo.CONFLICTING | SyncInfo.ADDITION
+ });
+ markAsMerged(getSubscriber(), project, new String[] {"folder2/file.txt"});
+ assertSyncEquals("testNestedMarkAsMerged sync check", project,
+ new String[] { "folder2/", "folder2/file.txt", "folder2/file2.txt"},
+ true, new int[] {
+ SyncInfo.IN_SYNC,
+ SyncInfo.OUTGOING | SyncInfo.CHANGE,
+ SyncInfo.CONFLICTING | SyncInfo.ADDITION
+ });
}
}

Back to the top