Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/sets/SubscriberEventHandler.java109
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS Sync View Tests.launch8
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/AllTests.java1
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/AllTestsTeamSubscriber.java10
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSMergeSubscriberTest.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSSyncSubscriberTest.java8
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/CVSWorkspaceSubscriberTest.java3
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/SubscriberTestSetup.java30
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSUITestCase.java17
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/LoggingTestCase.java10
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/CommandTests.java22
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java7
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java7
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/AllTestsSynchronizeView.java51
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/SyncInfoFromSyncSet.java9
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/SyncViewTests.java34
16 files changed, 173 insertions, 158 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/sets/SubscriberEventHandler.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/sets/SubscriberEventHandler.java
index 856dd4e63..7fd83dea2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/sets/SubscriberEventHandler.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/sets/SubscriberEventHandler.java
@@ -18,10 +18,12 @@ import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.ExceptionCollector;
+import org.eclipse.team.internal.ui.IPreferenceIds;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
@@ -29,7 +31,11 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
* This handler collects changes and removals to resources and calculates their
* synchronization state in a background job. The result is fed input the SyncSetInput.
*
- * Exceptions that occur when the job is processing the events are ???.
+ * Exceptions that occur when the job is processing the events are collected and
+ * returned as part of the Job's status.
+ *
+ * OPTIMIZATION: look into provinding events with multiple resources instead of
+ * one.
*/
public class SubscriberEventHandler {
// The number of events to process before feeding into the set.
@@ -48,6 +54,7 @@ public class SubscriberEventHandler {
// The job that runs when events need to be processed
Job eventHandlerJob;
+ // manages exceptions
private ExceptionCollector errors;
/**
@@ -94,9 +101,19 @@ public class SubscriberEventHandler {
errors = new ExceptionCollector(Policy.bind("SubscriberEventHandler.errors"), TeamUIPlugin.ID, IStatus.ERROR, null /* don't log */); //$NON-NLS-1$
reset(Event.INITIALIZE);
createEventHandlingJob();
- eventHandlerJob.schedule();
+ schedule();
}
/**
+ * Schedule the job or process the events now.
+ */
+ public void schedule() {
+ if(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.TESTING_SYNCVIEW)) {
+ processEvents(new NullProgressMonitor());
+ } else {
+ eventHandlerJob.schedule();
+ }
+ }
+ /**
* Initialize all resources for the subscriber associated with the set. This will basically recalculate
* all synchronization information for the subscriber.
* @param resource
@@ -130,7 +147,7 @@ public class SubscriberEventHandler {
if (shutdown || eventHandlerJob == null || eventHandlerJob.getState() != Job.NONE)
return;
else {
- eventHandlerJob.schedule();
+ schedule();
}
}
/**
@@ -156,50 +173,58 @@ public class SubscriberEventHandler {
* the queue is empty.
*/
private void createEventHandlingJob() {
- eventHandlerJob = new Job(Policy.bind("SubscriberEventHandler.jobName")) { //$NON-NLS-1$
-
- public IStatus run(IProgressMonitor monitor) {
- monitor.beginTask(null, 100); //$NON-NLS-1$
- List resultCache = new ArrayList();
-
- Event event;
- errors.clear();
-
- while ((event = nextElement()) != null) {
- // cancellation is dangerous because this will leave the sync info in a bad state.
- // purposely not checking
- try {
- int type = event.getType();
- switch(type) {
- case Event.REMOVAL :
- resultCache.add(event);
- break;
- case Event.CHANGE :
- List results = new ArrayList();
- collect(event.getResource(), event.getDepth(), monitor, results);
- resultCache.addAll(results);
- break;
- case Event.INITIALIZE :
- Event[] events = getAllOutOfSync(new IResource[] {event.getResource()}, event.getDepth(), monitor);
- resultCache.addAll(Arrays.asList(events));
- break;
- }
- } catch (TeamException e) {
- // handle exception but keep going
- errors.handleException(e);
- }
-
- if (awaitingProcessing.isEmpty() || resultCache.size() > NOTIFICATION_BATCHING_NUMBER) {
- dispatchEvents((Event[])resultCache.toArray(new Event[resultCache.size()]));
- resultCache.clear();
- }
- }
- return errors.getStatus();
+ eventHandlerJob = new Job(Policy.bind("SubscriberEventHandler.jobName")) { //$NON-NLS-1$
+ public IStatus run(IProgressMonitor monitor) {
+ return processEvents(monitor);
}
};
eventHandlerJob.setPriority(Job.SHORT);
eventHandlerJob.setSystem(true);
}
+ /**
+ * Process events from the events queue and dispatch results.
+ */
+ private IStatus processEvents(IProgressMonitor monitor) {
+ List resultCache = new ArrayList();
+ Event event;
+ errors.clear();
+ try {
+ monitor.beginTask(null, 100); //$NON-NLS-1$
+
+ while ((event = nextElement()) != null) {
+ // Cancellation is dangerous because this will leave the sync info in a bad state.
+ // Purposely not checking -
+ try {
+ int type = event.getType();
+ switch(type) {
+ case Event.REMOVAL :
+ resultCache.add(event);
+ break;
+ case Event.CHANGE :
+ List results = new ArrayList();
+ collect(event.getResource(), event.getDepth(), monitor, results);
+ resultCache.addAll(results);
+ break;
+ case Event.INITIALIZE :
+ Event[] events = getAllOutOfSync(new IResource[] {event.getResource()}, event.getDepth(), monitor);
+ resultCache.addAll(Arrays.asList(events));
+ break;
+ }
+ } catch (TeamException e) {
+ // handle exception but keep going
+ errors.handleException(e);
+ }
+
+ if (awaitingProcessing.isEmpty() || resultCache.size() > NOTIFICATION_BATCHING_NUMBER) {
+ dispatchEvents((Event[])resultCache.toArray(new Event[resultCache.size()]));
+ resultCache.clear();
+ }
+ }
+ } finally {
+ monitor.done();
+ }
+ return errors.getStatus();
+ }
/**
* Collect the calculated synchronization information for the given resource at the given depth. The
* results are added to the provided list.
diff --git a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS Sync View Tests.launch b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS Sync View Tests.launch
index 4a8e7d706..2e1642cf8 100644
--- a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS Sync View Tests.launch
+++ b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS Sync View Tests.launch
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.pde.junit.launchconfig">
<stringAttribute key="org.eclipse.pde.junitWORKSPACE_LOCATION" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace"/>
+ <booleanAttribute key="org.eclipse.pde.junit.DELETE_WORKSPACE" value="true"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
- <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.ui.sync.SyncViewTests"/>
+ <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.ui.sync.AllTestsSynchronizeView"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.team.tests.cvs.core"/>
+ <stringAttribute key="org.eclipse.pde.junit.APPLICATION_NAME" value="org.eclipse.pde.junit.uitestapplication"/>
+ <stringAttribute key="org.eclipse.debug.ui.target_run_perspective" value="perspective_none"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os win32 -ws win32 -arch x86"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName2=testDeletionConflicts"/>
<stringAttribute key="org.eclipse.debug.ui.target_debug_perspective" value="perspective_default"/>
- <booleanAttribute key="org.eclipse.pde.junit.DELETE_WORKSPACE" value="true"/>
- <stringAttribute key="org.eclipse.pde.junit.APPLICATION_NAME" value="org.eclipse.pde.junit.uitestapplication"/>
- <stringAttribute key="org.eclipse.debug.ui.target_run_perspective" value="perspective_none"/>
</launchConfiguration>
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..bc6ad2cdc 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.sync.AllTestsSynchronizeView;
public class AllTests extends EclipseTest {
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/AllTestsTeamSubscriber.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/AllTestsTeamSubscriber.java
index 28b2c5d66..21d69c0fb 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/AllTestsTeamSubscriber.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/AllTestsTeamSubscriber.java
@@ -12,10 +12,11 @@ package org.eclipse.team.tests.ccvs.core.subscriber;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
public class AllTestsTeamSubscriber extends EclipseTest {
-
+
public AllTestsTeamSubscriber() {
super();
}
@@ -25,13 +26,10 @@ public class AllTestsTeamSubscriber extends EclipseTest {
}
public static Test suite() {
- return suite(new SyncInfoSource());
- }
-
- public static Test suite(SyncInfoSource source) {
TestSuite suite = new TestSuite();
suite.addTest(CVSMergeSubscriberTest.suite());
suite.addTest(CVSWorkspaceSubscriberTest.suite());
- return new SubscriberTestSetup(suite, source);
+ CVSSyncSubscriberTest.setSyncSource(new SyncInfoSource());
+ return new CVSTestSetup(suite);
}
}
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 0190329ac..1b0e738a7 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
@@ -19,18 +19,19 @@ import junit.framework.TestSuite;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.core.subscribers.TeamProvider;
import org.eclipse.team.core.subscribers.TeamSubscriber;
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.CVSTeamProvider;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
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.subscribers.CVSMergeSubscriber;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.ui.sync.SyncInfoSet;
@@ -383,7 +384,7 @@ public class CVSMergeSubscriberTest extends CVSSyncSubscriberTest {
ICVSFolder cvsProject = CVSWorkspaceRoot.getCVSFolderFor(project);
CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(project);
- provider.deconfigure();
+ cvsProject.unmanage(new NullProgressMonitor());
assertProjectRemoved(subscriber, project);
}
}
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 2b57551f5..b3d084dda 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
@@ -40,6 +40,7 @@ public abstract class CVSSyncSubscriberTest extends EclipseTest {
private ITeamResourceChangeListener listener;
private List accumulatedTeamDeltas = new ArrayList();
+ private static SyncInfoSource source = null;
public CVSSyncSubscriberTest() {
super();
@@ -49,6 +50,10 @@ public abstract class CVSSyncSubscriberTest extends EclipseTest {
super(name);
}
+ public static void setSyncSource(SyncInfoSource newSource) {
+ source = newSource;
+ }
+
protected TeamSubscriber getWorkspaceSubscriber() throws TeamException {
TeamSubscriber subscriber = TeamProvider.getSubscriber(CVSProviderPlugin.CVS_WORKSPACE_SUBSCRIBER_ID);
if (subscriber == null) fail("The CVS sync subsciber is not registered");
@@ -56,7 +61,8 @@ public abstract class CVSSyncSubscriberTest extends EclipseTest {
}
public SyncInfoSource getSyncInfoSource() {
- return SubscriberTestSetup.getSyncInfoSource();
+ assertNotNull(source);
+ return source;
}
protected void refresh(TeamSubscriber subscriber, IResource resource) throws TeamException {
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 0420a2f04..ef51ce85e 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
@@ -29,6 +29,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
@@ -1122,7 +1123,7 @@ public class CVSWorkspaceSubscriberTest extends CVSSyncSubscriberTest {
IProject project = createProject("testDisconnect", new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder1/b.txt"});
ICVSFolder cvsProject = CVSWorkspaceRoot.getCVSFolderFor(project);
CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(project);
- provider.deconfigure();
+ cvsProject.unmanage(new NullProgressMonitor());
assertProjectRemoved(getWorkspaceSubscriber(), project);
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/SubscriberTestSetup.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/SubscriberTestSetup.java
deleted file mode 100644
index 97dea9448..000000000
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/SubscriberTestSetup.java
+++ /dev/null
@@ -1,30 +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 junit.framework.Test;
-
-import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
-
-public class SubscriberTestSetup extends CVSTestSetup {
-
- private static SyncInfoSource syncInfoSource = new SyncInfoSource();
-
- public static SyncInfoSource getSyncInfoSource() {
- return syncInfoSource;
- }
-
- public SubscriberTestSetup(Test test, SyncInfoSource source) {
- super(test);
- syncInfoSource = source;
- }
-
-}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSUITestCase.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSUITestCase.java
index 124d46a6d..21ecd5074 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSUITestCase.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSUITestCase.java
@@ -19,6 +19,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import junit.framework.Test;
+
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.compare.structuremergeviewer.IDiffContainer;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
@@ -27,6 +29,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceDescription;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.Dialog;
@@ -79,12 +82,12 @@ public class CVSUITestCase extends LoggingTestCase {
protected boolean USE_CONSOLE = System.getProperty("cvs.tests.use_console") != null;
protected boolean SHOW_CONSOLE = System.getProperty("cvs.tests.show_console") != null;
- public CVSUITestCase(String name) {
- super(name);
+ public CVSUITestCase(Test test) {
+ super(test);
testWindows = new ArrayList(3);
}
- protected void setUp() throws Exception {
+ public void setUp() throws CVSException {
super.setUp();
testRepository = CVSTestSetup.repository;
testWindow = openTestWindow();
@@ -106,7 +109,11 @@ public class CVSUITestCase extends LoggingTestCase {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription description = workspace.getDescription();
description.setAutoBuilding(false);
- workspace.setDescription(description);
+ try {
+ workspace.setDescription(description);
+ } catch (CoreException e) {
+ throw new CVSException(e);
+ }
// disable CVS GZIP compression
IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
@@ -125,7 +132,7 @@ public class CVSUITestCase extends LoggingTestCase {
Util.processEventsUntil(100);
}
- protected void tearDown() throws Exception {
+ public void tearDown() throws CVSException {
// wait for UI to settle
Util.processEventsUntil(100);
closeAllTestWindows();
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/LoggingTestCase.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/LoggingTestCase.java
index ef4decbaf..a1dccc563 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/LoggingTestCase.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/LoggingTestCase.java
@@ -12,19 +12,21 @@ package org.eclipse.team.tests.ccvs.ui;
import junit.framework.Assert;
-import junit.framework.TestCase;
+import junit.framework.Test;
import junit.framework.TestResult;
+
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
-public class LoggingTestCase extends TestCase {
+public class LoggingTestCase extends CVSTestSetup {
private LoggingTestResult logResult;
private int disableLogStack;
/**
* Creates a new logging test case.
*/
- public LoggingTestCase(String name) {
- super(name);
+ public LoggingTestCase(Test test) {
+ super(test);
}
/**
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/CommandTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/CommandTests.java
index 38b71eca1..ab2378048 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/CommandTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/CommandTests.java
@@ -20,6 +20,7 @@ import java.util.TreeSet;
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;
@@ -43,22 +44,23 @@ public class CommandTests extends CVSUITestCase {
private IProject eclipseProject;
private IProject uiProject;
- public CommandTests(String name) {
- super(name);
- }
- public CommandTests() {
- super("");
+ public CommandTests(Test test) {
+ super(test);
}
public static Test suite() {
return new BenchmarkTestSetup(new TestSuite(CommandTests.class));
}
- public void setUp() throws Exception {
+ public void setUp() throws CVSException {
super.setUp();
- baseName = Util.makeUniqueName(null, getName(), null);
- referenceProject = Util.createProject(baseName + "-reference");
- eclipseProject = Util.createProject(baseName + "-eclipse");
- uiProject = Util.createProject(baseName);
+ try {
+ baseName = Util.makeUniqueName(null, "thisproject", null);
+ referenceProject = Util.createProject(baseName + "-reference");
+ eclipseProject = Util.createProject(baseName + "-eclipse");
+ uiProject = Util.createProject(baseName);
+ } catch (CoreException e) {
+ throw new CVSException(e);
+ }
}
public void testImportAddCommitCheckout() throws Throwable {
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java
index 192e3bd31..8a605054d 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/SyncTests.java
@@ -25,11 +25,8 @@ public class SyncTests extends CVSUITestCase {
private static final int FILE_SIZE_VARIANCE = 0;
private static final int PROB_BINARY = 0;
- public SyncTests(String name) {
- super(name);
- }
- public SyncTests() {
- super("");
+ public SyncTests(Test test) {
+ super(test);
}
public static Test suite() {
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java
index 45f8bcaf3..530023dbc 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/WorkflowTests.java
@@ -28,11 +28,8 @@ public class WorkflowTests extends CVSUITestCase {
private int FILE_SIZE_MEAN = 16384;
private int FILE_SIZE_VARIANCE = 12288;
private int PROB_BINARY = 5;
- public WorkflowTests(String name) {
- super(name);
- }
- public WorkflowTests() {
- super("");
+ public WorkflowTests(Test test) {
+ super(test);
}
public static Test suite() {
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/AllTestsSynchronizeView.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/AllTestsSynchronizeView.java
new file mode 100644
index 000000000..a38c69c5f
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/AllTestsSynchronizeView.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.sync;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.team.internal.ui.IPreferenceIds;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
+import org.eclipse.team.tests.ccvs.core.EclipseTest;
+import org.eclipse.team.tests.ccvs.core.subscriber.CVSMergeSubscriberTest;
+import org.eclipse.team.tests.ccvs.core.subscriber.CVSSyncSubscriberTest;
+import org.eclipse.team.tests.ccvs.core.subscriber.CVSWorkspaceSubscriberTest;
+import org.eclipse.team.tests.ccvs.ui.CVSUITestCase;
+
+public class AllTestsSynchronizeView extends EclipseTest {
+
+ private SynchronizeView syncView;
+
+ public AllTestsSynchronizeView() {
+ super();
+ }
+
+ public AllTestsSynchronizeView(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite();
+
+ // sync info tests re-using the subscribers tests but checking state based on the
+ // sync set data structures in the synchronize view.
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.TESTING_SYNCVIEW, true);
+ suite.addTest(CVSMergeSubscriberTest.suite());
+ suite.addTest(CVSWorkspaceSubscriberTest.suite());
+ CVSSyncSubscriberTest.setSyncSource(new SyncInfoFromSyncSet());
+
+ // place other ui tests here
+
+ return new CVSUITestCase(suite);
+ }
+}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/SyncInfoFromSyncSet.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/SyncInfoFromSyncSet.java
index 23650d1ae..20bea0680 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/SyncInfoFromSyncSet.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/SyncInfoFromSyncSet.java
@@ -18,8 +18,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.core.subscribers.TeamSubscriber;
-import org.eclipse.team.internal.ui.IPreferenceIds;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.sync.sets.SubscriberInput;
import org.eclipse.team.internal.ui.sync.sets.SyncSet;
import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
@@ -34,7 +32,6 @@ public class SyncInfoFromSyncSet extends SyncInfoSource {
}
public SyncInfo getSyncInfo(TeamSubscriber subscriber, IResource resource) throws TeamException {
- TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.TESTING_SYNCVIEW, true);
SubscriberInput input = getInput(subscriber);
SyncSet set = input.getWorkingSetSyncSet();
SyncInfo info = set.getSyncInfo(resource);
@@ -56,12 +53,6 @@ public class SyncInfoFromSyncSet extends SyncInfoSource {
syncView.activateSubscriber(subscriber);
while (Display.getCurrent().readAndDispatch()) {};
input = syncView.getInput();
- } else {
- try {
- // sleep to let the events propagate
- Thread.sleep(500);
- } catch (InterruptedException e) {
- }
}
if (subscriber != input.getSubscriber()) {
throw new AssertionFailedError();
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/SyncViewTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/SyncViewTests.java
deleted file mode 100644
index 835808b63..000000000
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/sync/SyncViewTests.java
+++ /dev/null
@@ -1,34 +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.sync;
-
-import junit.framework.Test;
-
-import org.eclipse.team.internal.ui.sync.views.SynchronizeView;
-import org.eclipse.team.tests.ccvs.core.EclipseTest;
-import org.eclipse.team.tests.ccvs.core.subscriber.AllTestsTeamSubscriber;
-
-public class SyncViewTests extends EclipseTest {
-
- private SynchronizeView syncView;
-
- public SyncViewTests() {
- super();
- }
-
- public SyncViewTests(String name) {
- super(name);
- }
-
- public static Test suite() {
- return AllTestsTeamSubscriber.suite(new SyncInfoFromSyncSet());
- }
-}

Back to the top