From e27dfe342caaf2f8713211f00c9e0932003717a2 Mon Sep 17 00:00:00 2001 From: Michael Valenta Date: Mon, 8 Sep 2003 20:46:37 +0000 Subject: *** empty log message *** --- .../org/eclipse/team/tests/ccvs/core/AllTests.java | 2 ++ .../team/tests/ccvs/ui/unit/AllUIUnitTests.java | 34 ++++++++++++++++++++++ .../tests/ccvs/ui/unit/CheckoutOperationTests.java | 21 +++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/AllUIUnitTests.java diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/AllTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/AllTests.java index ce45de614..f64c6c6c0 100644 --- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/AllTests.java +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/AllTests.java @@ -15,6 +15,7 @@ import junit.framework.TestSuite; import org.eclipse.team.tests.ccvs.core.cvsresources.AllTestsCVSResources; import org.eclipse.team.tests.ccvs.core.provider.AllTestsProvider; import org.eclipse.team.tests.ccvs.core.subscriber.AllTestsTeamSubscriber; +import org.eclipse.team.tests.ccvs.ui.unit.AllUIUnitTests; public class AllTests extends EclipseTest { @@ -42,6 +43,7 @@ public class AllTests extends EclipseTest { suite.addTest(AllTestsCVSResources.suite()); suite.addTest(AllTestsProvider.suite()); suite.addTest(AllTestsTeamSubscriber.suite()); + suite.addTest(AllUIUnitTests.suite()); return new CVSTestSetup(suite); } } diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/AllUIUnitTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/AllUIUnitTests.java new file mode 100644 index 000000000..40eaa011a --- /dev/null +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/AllUIUnitTests.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * 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.unit; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.eclipse.team.tests.ccvs.core.EclipseTest; + +public class AllUIUnitTests extends EclipseTest { + + public AllUIUnitTests() { + super(); + } + + public AllUIUnitTests(String name) { + super(name); + } + + public static Test suite() { + TestSuite suite = new TestSuite(); + suite.addTest(CheckoutOperationTests.suite()); + return suite; + } + +} diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/CheckoutOperationTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/CheckoutOperationTests.java index 9f211e355..47058de5f 100644 --- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/CheckoutOperationTests.java +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/CheckoutOperationTests.java @@ -26,6 +26,7 @@ import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; import org.eclipse.team.internal.ccvs.ui.operations.CVSOperation; import org.eclipse.team.internal.ccvs.ui.operations.CheckoutMultipleProjectsOperation; +import org.eclipse.team.internal.ccvs.ui.operations.CheckoutSingleProjectOperation; import org.eclipse.team.tests.ccvs.core.CVSTestSetup; import org.eclipse.team.tests.ccvs.core.EclipseTest; @@ -120,6 +121,26 @@ public class CheckoutOperationTests extends EclipseTest { } catch (InterruptedException e) { fail("Operation should not have been interrupted"); } + } + + public void testCheckoutAs() throws TeamException, CoreException, IOException { + IProject project = createProject("testCheckoutAs", new String[] { "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt" }); + IProject copy = ResourcesPlugin.getWorkspace().getRoot().getProject(project.getName() + "-copy"); + + // checkout the project to the default location + try { + CVSOperation op = new CheckoutSingleProjectOperation( + null /* shell */, + (ICVSRemoteFolder)CVSWorkspaceRoot.getRemoteResourceFor(project), + copy, + null /*target location*/, + false); + op.setCVSRunnableContext(new HeadlessCVSRunnableContext()); + op.run(); + } catch (InterruptedException e) { + fail("Operation should not have been interrupted"); + } + assertEquals(project, copy); } } -- cgit v1.2.3