diff options
author | Michael Valenta | 2003-11-27 19:14:41 +0000 |
---|---|---|
committer | Michael Valenta | 2003-11-27 19:14:41 +0000 |
commit | 325b4933e94248b1f6ce38ef60383fd7973e925c (patch) | |
tree | 93bba80f80e0c176f11072461e0ad165a850dc0e /tests/org.eclipse.team.tests.cvs.core/src/org/eclipse | |
parent | b90a0d219f8ebced02a245dc922c351fba34f77e (diff) | |
download | eclipse.platform.team-325b4933e94248b1f6ce38ef60383fd7973e925c.tar.gz eclipse.platform.team-325b4933e94248b1f6ce38ef60383fd7973e925c.tar.xz eclipse.platform.team-325b4933e94248b1f6ce38ef60383fd7973e925c.zip |
47560: No warning when updating binary resources from CVS server
Diffstat (limited to 'tests/org.eclipse.team.tests.cvs.core/src/org/eclipse')
-rw-r--r-- | tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java | 63 |
1 files changed, 42 insertions, 21 deletions
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 58a631b88..6db4cf792 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 @@ -13,38 +13,22 @@ package org.eclipse.team.tests.ccvs.core.subscriber; import java.io.ByteArrayInputStream; import java.io.IOException; import java.lang.reflect.InvocationTargetException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; +import java.util.*; 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.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.resources.*; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Path; import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.subscribers.ContentComparisonCriteria; -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.internal.ccvs.core.CVSException; -import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; -import org.eclipse.team.internal.ccvs.core.CVSTag; -import org.eclipse.team.internal.ccvs.core.CVSTeamProvider; -import org.eclipse.team.internal.ccvs.core.ICVSFolder; -import org.eclipse.team.internal.ccvs.core.ICVSResource; +import org.eclipse.team.core.subscribers.*; +import org.eclipse.team.internal.ccvs.core.*; import org.eclipse.team.internal.ccvs.core.client.Command; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; +import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; import org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberAction; import org.eclipse.team.tests.ccvs.core.CVSTestSetup; import org.eclipse.team.ui.synchronize.actions.SyncInfoSet; @@ -1231,4 +1215,41 @@ public class CVSWorkspaceSubscriberTest extends CVSSyncSubscriberTest { project.close(null); assertProjectRemoved(getWorkspaceSubscriber(), project); } + + public void testUpdateBinaryConflict() throws TeamException, CoreException, InvocationTargetException, InterruptedException { + // Create a shared project with a binary file + IProject project = createProject(new String[] { "binary.gif"}); + assertIsBinary(project.getFile("binary.gif")); + + // Checkout a copy, modify the binary file and commit + IProject copy = checkoutCopy(project, "-copy"); + assertIsBinary(copy.getFile("binary.gif")); + setContentsAndEnsureModified(copy.getFile("binary.gif")); + commitProject(copy); + + // Modify the same binary file and ensure sync is correct + setContentsAndEnsureModified(project.getFile("binary.gif")); + assertSyncEquals("testProjectClose sync check", project, + new String[] { "binary.gif"}, + true, new int[] { + SyncInfo.CONFLICTING | SyncInfo.CHANGE, + }); + + // Perform an update and ensure the binary conflict is skipped + update(project, new String[] { "binary.gif"}); + assertSyncEquals("testProjectClose sync check", project, + new String[] { "binary.gif"}, + true, new int[] { + SyncInfo.CONFLICTING | SyncInfo.CHANGE, + }); + } + + private void assertIsBinary(IFile local) throws CVSException { + ICVSFile file = CVSWorkspaceRoot.getCVSFileFor((IFile)local); + byte[] syncBytes = file.getSyncBytes(); + if (syncBytes != null) { + assertTrue(ResourceSyncInfo.isBinary(syncBytes)); + } + + } } |