Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-03-10 15:58:38 +0000
committerMichael Valenta2004-03-10 15:58:38 +0000
commitfe2ec41fafe64ff3bbeb1e6912c9860113a11784 (patch)
tree19df7a7615d8f3c38b179e05b8873f941df9e4bf /tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team
parent8296588a95cbe5f38d9788dacafd27f9cf9d621b (diff)
downloadeclipse.platform.team-fe2ec41fafe64ff3bbeb1e6912c9860113a11784.tar.gz
eclipse.platform.team-fe2ec41fafe64ff3bbeb1e6912c9860113a11784.tar.xz
eclipse.platform.team-fe2ec41fafe64ff3bbeb1e6912c9860113a11784.zip
Made TeamOperation API
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/EclipseTest.java12
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ConcurrencyTests.java17
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CompareOperationTests.java20
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/HeadlessCVSRunnableContext.java53
4 files changed, 19 insertions, 83 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index d80a52980..a5a638414 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -32,7 +32,7 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.SyncFileChangeListener;
import org.eclipse.team.internal.ccvs.ui.operations.*;
-import org.eclipse.team.tests.ccvs.ui.HeadlessCVSRunnableContext;
+import org.eclipse.ui.IWorkbenchPart;
public class EclipseTest extends EclipseWorkspaceTest {
@@ -253,7 +253,7 @@ public class EclipseTest extends EclipseWorkspaceTest {
* Commit the resources from an existing container to the CVS repository
*/
public void tagProject(IProject project, CVSTag tag, boolean force) throws TeamException {
- ITagOperation op = new TagOperation(null, new IResource[] {project});
+ ITagOperation op = new TagOperation((IWorkbenchPart)null, new IResource[] {project});
runTag(op, tag, force);
}
@@ -791,8 +791,12 @@ public class EclipseTest extends EclipseWorkspaceTest {
protected static void executeHeadless(CVSOperation op) throws CVSException {
try {
- op.setCVSRunnableContext(new HeadlessCVSRunnableContext());
- op.run();
+ try {
+ // Bypass contxt by executing run(IProgressMonitor) directly
+ op.run(DEFAULT_MONITOR);
+ } catch (InvocationTargetException e1) {
+ throw CVSException.wrapException(e1);
+ }
} catch (InterruptedException e) {
throw new OperationCanceledException();
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ConcurrencyTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ConcurrencyTests.java
index 19e2aee45..120f6e699 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ConcurrencyTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ConcurrencyTests.java
@@ -10,10 +10,8 @@
*******************************************************************************/
package org.eclipse.team.tests.ccvs.core.provider;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -23,17 +21,13 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.progress.IElementCollector;
-import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.operations.FetchMembersOperation;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
-import org.eclipse.team.tests.ccvs.ui.HeadlessCVSRunnableContext;
public class ConcurrencyTests extends EclipseTest {
@@ -55,7 +49,7 @@ public class ConcurrencyTests extends EclipseTest {
}
}
- public void testBackgroundMemberFetch() throws InterruptedException, TeamException, CoreException {
+ public void testBackgroundMemberFetch() throws CoreException, InvocationTargetException, InterruptedException {
IProject project = createProject("testBackgroundMemberFetch", new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder2/", "folder2/a.txt", "folder2/folder3/", "folder2/folder3/b.txt", "folder2/folder3/c.txt"});
ICVSRemoteFolder folder = (ICVSRemoteFolder)CVSWorkspaceRoot.getRemoteResourceFor(project);
final List result = new ArrayList();
@@ -72,13 +66,12 @@ public class ConcurrencyTests extends EclipseTest {
}
};
- IJobChangeListener listener = new JobChangeAdapter() {
+ FetchMembersOperation operation = new FetchMembersOperation(null, folder, collector) {
public void done(IJobChangeEvent event) {
done[0] = true;
+ super.done(event);
}
};
- FetchMembersOperation operation = new FetchMembersOperation(null, folder, collector);
- operation.setCVSRunnableContext(new HeadlessCVSRunnableContext(listener));
operation.run();
int count = 0;
while (!done[0]) {
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CompareOperationTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CompareOperationTests.java
index 0d672a24b..d0c86cfa4 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CompareOperationTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CompareOperationTests.java
@@ -10,37 +10,29 @@
*******************************************************************************/
package org.eclipse.team.tests.ccvs.ui;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.operations.RemoteCompareOperation;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
+import org.eclipse.ui.IWorkbenchPart;
public class CompareOperationTests extends CVSOperationTest {
public class TestRemoteCompareOperation extends RemoteCompareOperation {
private ICVSRemoteFolder leftTree, rightTree;
- public TestRemoteCompareOperation(Shell shell, ICVSRemoteResource resource, CVSTag tag) {
- super(shell, resource, tag);
+ public TestRemoteCompareOperation(IWorkbenchPart part, ICVSRemoteResource resource, CVSTag tag) {
+ super(part, resource, tag);
}
/*
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/HeadlessCVSRunnableContext.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/HeadlessCVSRunnableContext.java
deleted file mode 100644
index 04bdb9973..000000000
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/HeadlessCVSRunnableContext.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * 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 java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.internal.ui.actions.ITeamRunnableContext;
-import org.eclipse.team.internal.ui.actions.JobRunnableContext;
-
-public class HeadlessCVSRunnableContext implements ITeamRunnableContext {
-
- private IJobChangeListener listener;
-
- public HeadlessCVSRunnableContext() {
- this(null);
- }
-
- public HeadlessCVSRunnableContext(IJobChangeListener listener) {
- this.listener = listener;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.operations.ITeamRunnableContext#run(java.lang.String, org.eclipse.core.runtime.jobs.ISchedulingRule, org.eclipse.jface.operation.IRunnableWithProgress)
- */
- public void run(IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
-
- if (listener != null) {
- new JobRunnableContext("Headless Job", listener, null).run(runnable);
- } else {
- runnable.run(new NullProgressMonitor());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.operations.ITeamRunnableContext#getShell()
- */
- public Shell getShell() {
- return null;
- }
-
-}

Back to the top