Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-03-09 21:59:42 +0000
committerMichael Valenta2004-03-09 21:59:42 +0000
commitbe1ecfd92fd599cfa15d9a1fe127d049852796f5 (patch)
treea644d319de2479c72d15042159c4cba1c04eb9aa /tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team
parent70d8db4a04629905c0aefa376adfc27566b12c73 (diff)
downloadeclipse.platform.team-be1ecfd92fd599cfa15d9a1fe127d049852796f5.tar.gz
eclipse.platform.team-be1ecfd92fd599cfa15d9a1fe127d049852796f5.tar.xz
eclipse.platform.team-be1ecfd92fd599cfa15d9a1fe127d049852796f5.zip
Refactoring SubscriberActionRoot_branch_I20040315
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.java13
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSSyncSubscriberTest.java15
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java40
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitAction.java35
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitOperation.java (renamed from tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestOverrideAndCommit.java)45
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMarkAsMergedAction.java25
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMergeUpdateOperation.java (renamed from tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMergeUpdateAction.java)24
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestOverrideAndUpdateOperation.java (renamed from tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestOverrideAndUpdate.java)36
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestUpdateOperation.java (renamed from tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestUpdateAction.java)30
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/HeadlessCVSRunnableContext.java10
10 files changed, 123 insertions, 150 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 8b7ad2def..0b01cf083 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
@@ -16,18 +16,13 @@ import java.lang.reflect.InvocationTargetException;
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.core.resources.IFolder;
-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.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
@@ -71,8 +66,8 @@ public class CVSMergeSubscriberTest extends CVSSyncSubscriberTest {
}
private void mergeResources(Subscriber subscriber, SyncInfo[] infos, boolean allowOverwrite) throws TeamException, InvocationTargetException, InterruptedException {
- TestMergeUpdateAction action = new TestMergeUpdateAction(allowOverwrite);
- action.getRunnable(new SyncInfoSet(infos)).run(DEFAULT_MONITOR);
+ TestMergeUpdateOperation action = new TestMergeUpdateOperation(getElements(infos), allowOverwrite);
+ action.run(DEFAULT_MONITOR);
}
/**
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 66caa4549..6d24e485b 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
@@ -15,16 +15,18 @@ import java.util.*;
import junit.framework.AssertionFailedError;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.*;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber;
+import org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedOperation;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
import org.eclipse.team.tests.ccvs.ui.SynchronizeViewTestAdapter;
+import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
/**
* Provides test methods common to CVS sync subscribers
@@ -225,7 +227,14 @@ public abstract class CVSSyncSubscriberTest extends EclipseTest {
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);
+ new SubscriberConfirmMergedOperation(null, getElements(infos)).run(DEFAULT_MONITOR);
+ }
+
+ protected IDiffElement[] getElements(SyncInfo[] infos) {
+ SyncInfoModelElement[] elements = new SyncInfoModelElement[infos.length];
+ for (int i = 0; i < elements.length; i++) {
+ elements[i] = new SyncInfoModelElement(null, infos[i]);
+ }
+ return elements;
}
}
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 221a261c8..ebf74c5f7 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
@@ -18,19 +18,20 @@ import java.util.*;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
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.*;
-import org.eclipse.team.core.synchronize.*;
+import org.eclipse.team.core.subscribers.ISubscriberChangeEvent;
+import org.eclipse.team.core.synchronize.SyncInfo;
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.internal.ccvs.ui.subscriber.CVSSubscriberOperation;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
/**
@@ -247,39 +248,46 @@ public class CVSWorkspaceSubscriberTest extends CVSSyncSubscriberTest {
}
public IResource[] update(IContainer container, String[] hierarchy) throws CoreException, TeamException, InvocationTargetException, InterruptedException {
- return runSubscriberAction(new TestUpdateAction(), container, hierarchy);
+ IResource[] resources = getResources(container, hierarchy);
+ runSubscriberOperation(new TestUpdateOperation(getElements(resources)));
+ return resources;
}
-
+
public IResource[] commit(IContainer container, String[] hierarchy) throws CoreException, TeamException {
- return runSubscriberAction(new TestCommitAction(), container, hierarchy);
+ IResource[] resources = getResources(container, hierarchy);
+ runSubscriberOperation(new TestCommitOperation(getElements(resources), false /* override */));
+ return resources;
}
public IResource[] overrideAndUpdate(IContainer container, String[] hierarchy, boolean shouldPrompt) throws CoreException, TeamException {
- TestOverrideAndUpdate action = new TestOverrideAndUpdate();
- IResource[] resources = runSubscriberAction(action, container, hierarchy);
+ IResource[] resources = getResources(container, hierarchy);
+ TestOverrideAndUpdateOperation action = new TestOverrideAndUpdateOperation(getElements(resources));
+ runSubscriberOperation(action);
assertTrue(shouldPrompt == action.isPrompted());
return resources;
}
public IResource[] overrideAndCommit(IContainer container, String[] hierarchy, boolean shouldPrompt) throws CoreException, TeamException {
- TestOverrideAndCommit action = new TestOverrideAndCommit();
- IResource[] resources = runSubscriberAction(action, container, hierarchy);
- assertTrue(shouldPrompt == action.isPrompted());
+ IResource[] resources = getResources(container, hierarchy);
+ TestCommitOperation action = new TestCommitOperation(getElements(resources), true /* override */);
+ runSubscriberOperation(action);
+ //assertTrue(shouldPrompt == action.isPrompted());
return resources;
}
- private IResource[] runSubscriberAction(CVSSubscriberAction action, IContainer container, String[] hierarchy) throws CoreException {
- IResource[] resources = getResources(container, hierarchy);
+ protected IDiffElement[] getElements(IResource[] resources) throws CoreException {
SyncInfo[] syncResources = createSyncInfos(resources);
+ return getElements(syncResources);
+ }
+
+ private void runSubscriberOperation(CVSSubscriberOperation op) throws CoreException {
try {
- action.getRunnable(new SyncInfoSet(syncResources)).run(DEFAULT_MONITOR);
- return resources;
+ op.run(DEFAULT_MONITOR);
} catch (InvocationTargetException e) {
throw CVSException.wrapException(e);
} catch (InterruptedException e) {
fail("Operation was interupted");
}
- return new IResource[0];
}
/******************************************************************
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitAction.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitAction.java
deleted file mode 100644
index 48ff6566e..000000000
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitAction.java
+++ /dev/null
@@ -1,35 +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.core.subscriber;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
-import org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction;
-
-class TestCommitAction extends SubscriberCommitAction {
-
- public IRunnableWithProgress getRunnable(SyncInfoSet syncSet) {
- return super.getRunnable(syncSet);
- }
-
- protected boolean canRunAsJob() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction#promptForComment(org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager, org.eclipse.core.resources.IResource[])
- */
- protected String promptForComment(RepositoryManager manager, IResource[] resourcesToCommit) {
- return "dummy comment";
- }
-}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestOverrideAndCommit.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitOperation.java
index 21a7817f6..40dc2a764 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestOverrideAndCommit.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestCommitOperation.java
@@ -10,38 +10,57 @@
*******************************************************************************/
package org.eclipse.team.tests.ccvs.core.subscriber;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
-import org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndCommitAction;
+import org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitOperation;
-public class TestOverrideAndCommit extends OverrideAndCommitAction {
+class TestCommitOperation extends SubscriberCommitOperation {
- private boolean prompted = false;
+ private boolean prompted;
+
+ public TestCommitOperation(IDiffElement[] elements, boolean override) {
+ super(null, elements, override);
+ }
/* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction#promptForComment(org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager, org.eclipse.core.resources.IResource[])
+ * @see org.eclipse.team.internal.ui.actions.TeamOperation#canRunAsJob()
*/
- protected String promptForComment(RepositoryManager manager, IResource[] resourcesToCommit) {
- return "test comments";
+ protected boolean canRunAsJob() {
+ return false;
}
/* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction#promptForConflicts(org.eclipse.team.ui.sync.SyncInfoSet)
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitOperation#promptForComment(org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager, org.eclipse.core.resources.IResource[])
+ */
+ protected String promptForComment(RepositoryManager manager, IResource[] resourcesToCommit) {
+ return "dummy comment";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitOperation#promptForConflicts(org.eclipse.team.core.synchronize.SyncInfoSet)
*/
protected int promptForConflicts(SyncInfoSet syncSet) {
this.prompted = true;
return 0; // ok to commit all conflicts
}
- public boolean isPrompted() {
- return this.prompted;
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitOperation#promptForResourcesToBeAdded(org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager, org.eclipse.core.resources.IResource[])
+ */
+ protected IResource[] promptForResourcesToBeAdded(RepositoryManager manager, IResource[] unadded) {
+ return unadded;
}
-
+
/* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberAction#canRunAsJob()
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitOperation#promptForConflictHandling(org.eclipse.team.core.synchronize.SyncInfoSet)
*/
- protected boolean canRunAsJob() {
- return false;
+ protected boolean promptForConflictHandling(SyncInfoSet syncSet) {
+ return true;
+ }
+
+ public boolean isPrompted() {
+ return this.prompted;
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMarkAsMergedAction.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMarkAsMergedAction.java
deleted file mode 100644
index 35d6e4212..000000000
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMarkAsMergedAction.java
+++ /dev/null
@@ -1,25 +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.core.subscriber;
-
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction;
-
-
-class TestMarkAsMergedAction extends SubscriberConfirmMergedAction {
- public IRunnableWithProgress getRunnable(SyncInfoSet syncSet) {
- return super.getRunnable(syncSet);
- }
- protected boolean canRunAsJob() {
- return false;
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMergeUpdateAction.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMergeUpdateOperation.java
index b6c5735ff..c82f0bb18 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMergeUpdateAction.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestMergeUpdateOperation.java
@@ -10,32 +10,36 @@
*******************************************************************************/
package org.eclipse.team.tests.ccvs.core.subscriber;
+import junit.framework.Assert;
+
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.ui.subscriber.MergeUpdateAction;
-import org.eclipse.team.tests.ccvs.core.EclipseTest;
+import org.eclipse.team.internal.ccvs.ui.subscriber.MergeUpdateOperation;
-class TestMergeUpdateAction extends MergeUpdateAction {
+class TestMergeUpdateOperation extends MergeUpdateOperation {
boolean allowOverwrite = false;
- public TestMergeUpdateAction(boolean allowOverwrite) {
+ public TestMergeUpdateOperation(IDiffElement[] elements, boolean allowOverwrite) {
+ super(null, elements, false /* prompt before update */);
this.allowOverwrite = allowOverwrite;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberOperation#promptForOverwrite(org.eclipse.team.core.synchronize.SyncInfoSet)
+ */
protected boolean promptForOverwrite(SyncInfoSet syncSet) {
if (allowOverwrite) return true;
if (syncSet.isEmpty()) return true;
IResource[] resources = syncSet.getResources();
- EclipseTest.fail(resources[0].getFullPath().toString() + " failed to merge properly");
+ Assert.fail(resources[0].getFullPath().toString() + " failed to merge properly");
return false;
}
- public IRunnableWithProgress getRunnable(SyncInfoSet syncSet) {
- return super.getRunnable(syncSet);
- }
-
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.actions.TeamOperation#canRunAsJob()
+ */
protected boolean canRunAsJob() {
return false;
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestOverrideAndUpdate.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestOverrideAndUpdateOperation.java
index 155c1166e..fbce4c751 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestOverrideAndUpdate.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestOverrideAndUpdateOperation.java
@@ -1,35 +1,33 @@
package org.eclipse.team.tests.ccvs.core.subscriber;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndUpdateAction;
+import org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndUpdateSubscriberOperation;
+
+public class TestOverrideAndUpdateOperation extends OverrideAndUpdateSubscriberOperation {
-public class TestOverrideAndUpdate extends OverrideAndUpdateAction {
-
private boolean prompted = false;
+ protected TestOverrideAndUpdateOperation(IDiffElement[] elements) {
+ super(null, elements);
+ }
+
/* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateAction#promptForOverwrite(org.eclipse.team.ui.sync.SyncInfoSet)
+ * @see org.eclipse.team.internal.ui.actions.TeamOperation#canRunAsJob()
*/
- protected boolean promptForOverwrite(SyncInfoSet syncSet) {
- this.prompted = true;
- return true;
+ protected boolean canRunAsJob() {
+ return false;
}
-
+
/* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateAction#warnAboutFailedResources(org.eclipse.team.ui.sync.SyncInfoSet)
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberOperation#promptForOverwrite(org.eclipse.team.core.synchronize.SyncInfoSet)
*/
- protected void warnAboutFailedResources(SyncInfoSet syncSet) {
- return;
+ protected boolean promptForOverwrite(SyncInfoSet syncSet) {
+ TestOverrideAndUpdateOperation.this.prompted = true;
+ return true;
}
-
+
public boolean isPrompted() {
return this.prompted;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberAction#canRunAsJob()
- */
- protected boolean canRunAsJob() {
- return false;
- }
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestUpdateAction.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestUpdateOperation.java
index 1bc36c774..3f072bbf6 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestUpdateAction.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/TestUpdateOperation.java
@@ -10,30 +10,36 @@
*******************************************************************************/
package org.eclipse.team.tests.ccvs.core.subscriber;
-import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceUpdateAction;
+import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceUpdateOperation;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
-class TestUpdateAction extends WorkspaceUpdateAction {
+class TestUpdateOperation extends WorkspaceUpdateOperation {
+ protected TestUpdateOperation(IDiffElement[] elements) {
+ super(null, elements, false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.actions.TeamOperation#canRunAsJob()
+ */
+ protected boolean canRunAsJob() {
+ return false;
+ }
+
/* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateAction#warnAboutFailedResources(org.eclipse.team.ui.sync.SyncInfoSet)
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.SafeUpdateOperation#warnAboutFailedResources(org.eclipse.team.core.synchronize.SyncInfoSet)
*/
protected void warnAboutFailedResources(SyncInfoSet syncSet) {
return;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberOperation#promptForOverwrite(org.eclipse.team.core.synchronize.SyncInfoSet)
+ */
protected boolean promptForOverwrite(SyncInfoSet syncSet) {
EclipseTest.fail("Should never prompt on update, simply update nodes that are valid.");
return false;
}
-
- public IRunnableWithProgress getRunnable(SyncInfoSet syncSet) {
- return super.getRunnable(syncSet);
- }
-
- protected boolean canRunAsJob() {
- return false;
- }
}
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
index da2804248..04bdb9973 100644
--- 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
@@ -14,7 +14,6 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.actions.ITeamRunnableContext;
@@ -22,7 +21,6 @@ import org.eclipse.team.internal.ui.actions.JobRunnableContext;
public class HeadlessCVSRunnableContext implements ITeamRunnableContext {
- private boolean background;
private IJobChangeListener listener;
public HeadlessCVSRunnableContext() {
@@ -36,14 +34,10 @@ public class HeadlessCVSRunnableContext implements ITeamRunnableContext {
/* (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(
- String title,
- ISchedulingRule schedulingRule,
- boolean postponeBuild, IRunnableWithProgress runnable)
- throws InvocationTargetException, InterruptedException {
+ public void run(IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
if (listener != null) {
- new JobRunnableContext(listener, null).run("Headless Job", null, true, runnable);
+ new JobRunnableContext("Headless Job", listener, null).run(runnable);
} else {
runnable.run(new NullProgressMonitor());
}

Back to the top