diff options
author | Michael Valenta | 2003-11-07 17:20:08 +0000 |
---|---|---|
committer | Michael Valenta | 2003-11-07 17:20:08 +0000 |
commit | eddf28cab7d0a12a6c657edeb3138a15ed890009 (patch) | |
tree | 2c6befbe80fc5f00b3cd00278e54a4f82d36bd5b /tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team | |
parent | a382046ae6561a97b59e6004d18f885c9ab044c7 (diff) | |
download | eclipse.platform.team-eddf28cab7d0a12a6c657edeb3138a15ed890009.tar.gz eclipse.platform.team-eddf28cab7d0a12a6c657edeb3138a15ed890009.tar.xz eclipse.platform.team-eddf28cab7d0a12a6c657edeb3138a15ed890009.zip |
*** empty log message ***
Diffstat (limited to 'tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team')
3 files changed, 74 insertions, 6 deletions
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 e43324aaa..a8a22a26f 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 @@ -57,9 +57,13 @@ public class SyncElementTest extends EclipseTest { } public static Test suite() { - TestSuite suite = new TestSuite(SyncElementTest.class); - return new CVSTestSetup(suite); - //return new CVSTestSetup(new SyncElementTest("testAdditionConflicts")); + String testName = System.getProperty("eclipse.cvs.testName"); + if (testName == null) { + TestSuite suite = new TestSuite(SyncElementTest.class); + return new CVSTestSetup(suite); + } else { + return new CVSTestSetup(new SyncElementTest(testName)); + } } /* @@ -669,12 +673,12 @@ public class SyncElementTest extends EclipseTest { // Checkout a copy and make some modifications IProject copy = checkoutCopy(project, "-copy"); - appendText(copy.getFile("file1.txt"), "", true); + appendText(copy.getFile("file1.txt"), "start", true); setContentsAndEnsureModified(copy.getFile("folder1/a.txt")); getProvider(copy).checkin(new IResource[] {copy}, IResource.DEPTH_INFINITE, DEFAULT_MONITOR); // Make the same modifications to the original - appendText(project.getFile("file1.txt"), "", false); + appendText(project.getFile("file1.txt"), "start", true); setContentsAndEnsureModified(project.getFile("folder1/a.txt"), "unique text"); // Get the sync tree for the project @@ -682,7 +686,7 @@ public class SyncElementTest extends EclipseTest { assertSyncEquals("testGranularityContents", tree, new String[] { "file1.txt", "folder1/", "folder1/a.txt"}, new int[] { - IRemoteSyncElement.IN_SYNC, + IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.CHANGE | IRemoteSyncElement.PSEUDO_CONFLICT, IRemoteSyncElement.IN_SYNC, IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.CHANGE }, IRemoteSyncElement.GRANULARITY_CONTENTS); diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/AllUITests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/AllUITests.java index e584c5601..0dcdb67bf 100644 --- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/AllUITests.java +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/AllUITests.java @@ -29,6 +29,7 @@ public class AllUITests extends EclipseTest { TestSuite suite = new TestSuite(); suite.addTest(CheckoutOperationTests.suite()); suite.addTest(CompareOperationTests.suite()); + suite.addTest(MiscOperationsTests.suite()); return suite; } diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/MiscOperationsTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/MiscOperationsTests.java new file mode 100644 index 000000000..505219ca8 --- /dev/null +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/MiscOperationsTests.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (c) 2000, 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.team.tests.ccvs.ui; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.team.core.RepositoryProvider; +import org.eclipse.team.core.TeamException; +import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; +import org.eclipse.team.internal.ccvs.ui.operations.DisconnectOperation; +import org.eclipse.team.tests.ccvs.core.CVSTestSetup; + +/** + * Miscellaneous operation tests + */ +public class MiscOperationsTests extends CVSOperationTest { + + public MiscOperationsTests() { + super(); + } + + public MiscOperationsTests(String name) { + super(name); + } + + public static Test suite() { + String testName = System.getProperty("eclipse.cvs.testName"); + if (testName == null) { + TestSuite suite = new TestSuite(MiscOperationsTests.class); + return new CVSTestSetup(suite); + } else { + return new CVSTestSetup(new MiscOperationsTests(testName)); + } + } + + public void testDisconnect() throws TeamException, CoreException { + IProject project = createProject(new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder1/b.txt"}); + + // First, disconnect but leave the CVS folders + run(new DisconnectOperation(null, new IProject[] {project }, false)); + assertNull(RepositoryProvider.getProvider(project)); + assertTrue(project.getFolder("CVS").exists()); + + // Next, disconnect and purge the CVS folders + RepositoryProvider.map(project, CVSProviderPlugin.getTypeId()); + run(new DisconnectOperation(null, new IProject[] {project }, true)); + assertNull(RepositoryProvider.getProvider(project)); + assertTrue(project.getFolder("folder1").exists()); + assertTrue(project.getFile("file1.txt").exists()); + assertTrue(!project.getFolder("CVS").exists()); + } +} |