Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-01-24 01:33:59 +0000
committerMichael Valenta2004-01-24 01:33:59 +0000
commitfc435f364a92463d5b8bb9d6ed4c8bde2f5c133a (patch)
treec270325940632ffe8e2e229acdc4e7592d731d4b /tests/org.eclipse.team.tests.core
parentbc76249996578adfcbac04655ed939328df9e4a7 (diff)
downloadeclipse.platform.team-fc435f364a92463d5b8bb9d6ed4c8bde2f5c133a.tar.gz
eclipse.platform.team-fc435f364a92463d5b8bb9d6ed4c8bde2f5c133a.tar.xz
eclipse.platform.team-fc435f364a92463d5b8bb9d6ed4c8bde2f5c133a.zip
*** empty log message ***
Diffstat (limited to 'tests/org.eclipse.team.tests.core')
-rw-r--r--tests/org.eclipse.team.tests.core/plugin.xml14
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java127
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestSubscriber.java95
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestSyncInfo.java32
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java46
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/TestTreeViewer.java30
6 files changed, 1 insertions, 343 deletions
diff --git a/tests/org.eclipse.team.tests.core/plugin.xml b/tests/org.eclipse.team.tests.core/plugin.xml
index a99182bcb..332327000 100644
--- a/tests/org.eclipse.team.tests.core/plugin.xml
+++ b/tests/org.eclipse.team.tests.core/plugin.xml
@@ -91,18 +91,6 @@
id="org.eclipse.team.tests.core.linking">
</repository>
</extension>
- <extension
- point="org.eclipse.ui.views">
- <category
- name="Team Test Views"
- id="org.eclipse.team.tests.core">
- </category>
- <view
- name="Content Provider Test View"
- category="org.eclipse.team.tests.core"
- class="org.eclipse.team.tests.ui.views.ContentProviderTestView"
- id="org.eclipse.team.tests.ui.views.ContentProviderTestView">
- </view>
- </extension>
+
</plugin>
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java
deleted file mode 100644
index 3a5c9f441..000000000
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/SyncInfoSetContentProviderTest.java
+++ /dev/null
@@ -1,127 +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.ui.synchronize;
-
-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.TeamException;
-import org.eclipse.team.core.subscribers.MutableSyncInfoSet;
-import org.eclipse.team.core.subscribers.SyncInfo;
-import org.eclipse.team.tests.core.TeamTest;
-import org.eclipse.team.tests.ui.views.*;
-
-/**
- * Tests for the SyncInfoSet content providers.
- */
-public class SyncInfoSetContentProviderTest extends TeamTest {
-
- public static final TestSubscriber subscriber = new TestSubscriber();
- /*
- * This method creates a project with the given resources, imports
- * it to CVS and checks it out
- */
- protected IProject createProject(String prefix, String[] resources) throws CoreException {
- IProject project = getUniqueTestProject(prefix);
- buildResources(project, resources, true);
- return project;
- }
-
- /*
- * Create a test project using the currently running test case as the project name prefix
- */
- protected IProject createProject(String[] resources) throws CoreException {
- return createProject(getName(), resources);
- }
-
- private MutableSyncInfoSet createSet(IProject project, String[] resources, int[] syncKind) throws TeamException {
- MutableSyncInfoSet set = new MutableSyncInfoSet();
- adjustSet(
- set,
- project,
- resources,
- syncKind);
- return set;
- }
-
- private void adjustSet(MutableSyncInfoSet set, IProject project, String[] resourceStrings, int[] syncKind) throws TeamException {
- IResource[] resources = buildResources(project, resourceStrings);
- set.beginInput();
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- int kind = syncKind[i];
- if (kind == SyncInfo.IN_SYNC) {
- set.remove(resource);
- } else {
- SyncInfo newInfo = subscriber.getSyncInfo(resource, kind);
- if (set.getSyncInfo(resource) != null) {
- set.changed(newInfo);
- } else {
- set.add(newInfo);
- }
- }
- }
- set.endInput(new NullProgressMonitor());
- }
-
- /**
- * Ensure that the resource
- * @param resources
- */
- private void assertVisible(IProject project, String[] resources) {
- // TODO Auto-generated method stub
-
- }
-
- public void simpleTest() throws CoreException {
- IProject project = createProject(new String[] { "file.txt", "folder1/file2.txt", "folder1/folder2/file3.txt"});
- MutableSyncInfoSet set = createSet(
- project,
- new String[] { "file.txt" },
- new int[] {SyncInfo.OUTGOING | SyncInfo.CHANGE});
- assertVisible(project, new String[] { "file.txt" });
-
- adjustSet(
- set,
- project,
- new String[] { "folder1/file2.txt", "folder1/folder2/file3.txt" },
- new int[] {
- SyncInfo.OUTGOING | SyncInfo.CHANGE,
- SyncInfo.OUTGOING | SyncInfo.CHANGE});
- assertVisible(project, new String[] { "file.txt", "folder1/file2.txt", "folder1/folder2/file3.txt" });
-
- adjustSet(
- set,
- project,
- new String[] { "folder1/file2.txt"},
- new int[] {
- SyncInfo.IN_SYNC,
- });
- assertVisible(project, new String[] { "file.txt", "folder1/folder2/file3.txt" });
-
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- TestTreeViewer viewer = new TestTreeViewer(null);
- }
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- // TODO Dispose of whatever was created
- super.tearDown();
- }
-}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestSubscriber.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestSubscriber.java
deleted file mode 100644
index 0f1129ca7..000000000
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestSubscriber.java
+++ /dev/null
@@ -1,95 +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.ui.synchronize;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.*;
-
-/**
- * @author Administrator
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public class TestSubscriber extends TeamSubscriber {
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.TeamSubscriber#getDescription()
- */
- public String getDescription() {
- return "Test Subscriber";
- }
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.TeamSubscriber#isSupervised(org.eclipse.core.resources.IResource)
- */
- public boolean isSupervised(IResource resource) throws TeamException {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.TeamSubscriber#members(org.eclipse.core.resources.IResource)
- */
- public IResource[] members(IResource resource) throws TeamException {
- if (resource.getType() == IResource.FILE) {
- return new IResource[0];
- }
- try {
- return ((IContainer)resource).members();
- } catch (CoreException e) {
- throw TeamException.asTeamException(e);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.TeamSubscriber#roots()
- */
- public IResource[] roots() {
- return ResourcesPlugin.getWorkspace().getRoot().getProjects();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.TeamSubscriber#getSyncInfo(org.eclipse.core.resources.IResource)
- */
- public SyncInfo getSyncInfo(IResource resource) throws TeamException {
- return getSyncInfo(resource, SyncInfo.IN_SYNC);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.TeamSubscriber#refresh(org.eclipse.core.resources.IResource[], int, org.eclipse.core.runtime.IProgressMonitor)
- */
- public void refresh(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException {
- // Nothing to do
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.TeamSubscriber#getDefaultComparisonCriteria()
- */
- public IComparisonCriteria getDefaultComparisonCriteria() {
- return new IComparisonCriteria() {
- public boolean compare(Object e1, Object e2) {
- return false;
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.TeamSubscriber#isThreeWay()
- */
- public boolean isThreeWay() {
- return false;
- }
-
- public SyncInfo getSyncInfo(IResource resource, int i) throws TeamException {
- return new TestSyncInfo(resource, i, this);
- }
-}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestSyncInfo.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestSyncInfo.java
deleted file mode 100644
index 75812e94c..000000000
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/synchronize/TestSyncInfo.java
+++ /dev/null
@@ -1,32 +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.ui.synchronize;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.SyncInfo;
-
-public class TestSyncInfo extends SyncInfo {
-
- private int kind;
-
- public TestSyncInfo(IResource resource, int kind, TestSubscriber subscriber) throws TeamException {
- super(resource, null, null, subscriber);
- this.kind = kind;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.SyncInfo#calculateKind()
- */
- protected int calculateKind() throws TeamException {
- return this.kind;
- }
-}
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java
deleted file mode 100644
index 6e230dcaf..000000000
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/ContentProviderTestView.java
+++ /dev/null
@@ -1,46 +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.ui.views;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.team.core.subscribers.SyncInfo;
-import org.eclipse.team.core.subscribers.SyncInfoSet;
-import org.eclipse.team.internal.ui.synchronize.views.CompressedFolderContentProvider;
-import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
-import org.eclipse.team.ui.synchronize.TeamSubscriberParticipantLabelProvider;
-import org.eclipse.ui.part.ViewPart;
-
-public class ContentProviderTestView extends ViewPart {
-
- public static final String ID = "org.eclipse.team.tests.ui.views.ContentProviderTestView";
-
- private TestTreeViewer viewer;
-
- public ContentProviderTestView() {
- }
-
- public void createPartControl(Composite parent) {
- viewer = new TestTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setContentProvider(new CompressedFolderContentProvider());
- viewer.setLabelProvider(new TeamSubscriberParticipantLabelProvider());
- setInput(new SyncInfoSet(new SyncInfo[0]));
- }
-
- public void setInput(SyncInfoSet set) {
- viewer.setInput(new SyncInfoDiffNode(set, ResourcesPlugin.getWorkspace().getRoot()));
- }
-
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/TestTreeViewer.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/TestTreeViewer.java
deleted file mode 100644
index 4284e4a27..000000000
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/ui/views/TestTreeViewer.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.ui.views;
-
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-
-public class TestTreeViewer extends TreeViewer {
-
- public TestTreeViewer(Composite parent) {
- super(parent);
- }
-
- public TestTreeViewer(Composite parent, int style) {
- super(parent, style);
- }
-
- public TestTreeViewer(Tree tree) {
- super(tree);
- }
-}

Back to the top