From ebb2566c95427e5c7cffd5e27f1e910b0a187b17 Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Mon, 9 Jan 2017 14:12:58 +0100 Subject: Bug 510100 - [cleanup] Get rid of trailing white space in platform.debug Also enabled "cleanup whitespace on save" actions for debug.ui and debug.tests bundles. Change-Id: I755b879ab1d49144a1bec3f4318dbb8b29521bb3 Signed-off-by: Andrey Loskutov --- .../.settings/org.eclipse.jdt.ui.prefs | 2 +- .../src/org/eclipse/debug/tests/LocalSuite.java | 12 +- .../org/eclipse/debug/tests/PerformanceSuite.java | 12 +- .../src/org/eclipse/debug/tests/TestsPlugin.java | 14 +-- .../debug/tests/launching/AbstractLaunchTest.java | 18 +-- .../launching/AcceleratorSubstitutionTests.java | 14 +-- .../debug/tests/launching/LaunchHistoryTests.java | 34 +++--- .../debug/tests/launching/RefreshTabTests.java | 50 ++++----- .../debug/tests/statushandlers/StatusHandler.java | 2 +- .../tests/statushandlers/StatusHandlerTests.java | 8 +- .../view/memory/DynamicRenderingBindings.java | 12 +- .../tests/view/memory/MemoryBlockDynamic.java | 4 +- .../debug/tests/view/memory/MemoryBlockOne.java | 4 +- .../debug/tests/view/memory/MemoryBlockThree.java | 4 +- .../debug/tests/view/memory/MemoryBlockTwo.java | 4 +- .../tests/view/memory/MemoryRenderingTests.java | 32 +++--- .../tests/view/memory/RenderingTypeDelegate.java | 4 +- .../debug/tests/viewer/model/CheckTests.java | 60 +++++----- .../tests/viewer/model/ChildrenUpdateTests.java | 66 +++++------ .../viewer/model/ColumnPresentationTests.java | 30 ++--- .../debug/tests/viewer/model/FilterTests.java | 122 ++++++++++----------- .../tests/viewer/model/FilterTransformTests.java | 34 +++--- .../model/ITestModelUpdatesListenerConstants.java | 16 +-- .../tests/viewer/model/JFaceViewerCheckTests.java | 4 +- .../viewer/model/JFaceViewerContentTests.java | 4 +- .../tests/viewer/model/JFaceViewerDeltaTests.java | 6 +- .../tests/viewer/model/JFaceViewerFilterTests.java | 4 +- .../tests/viewer/model/JFaceViewerLazyTests.java | 4 +- .../viewer/model/JFaceViewerPerformanceTests.java | 6 +- .../tests/viewer/model/JFaceViewerPopupTests.java | 4 +- .../viewer/model/JFaceViewerSelectionTests.java | 4 +- .../tests/viewer/model/JFaceViewerStateTests.java | 4 +- .../tests/viewer/model/JFaceViewerUpdateTests.java | 4 +- .../debug/tests/viewer/model/LazyTests.java | 60 +++++----- .../debug/tests/viewer/model/PerformanceTests.java | 96 ++++++++-------- .../viewer/model/PresentationContextTests.java | 10 +- .../debug/tests/viewer/model/TreePathWrapper.java | 24 ++-- .../viewer/model/VirtualViewerContentTests.java | 4 +- .../viewer/model/VirtualViewerDeltaTests.java | 4 +- .../viewer/model/VirtualViewerFilterTests.java | 4 +- .../viewer/model/VirtualViewerLazyModeTests.java | 12 +- .../model/VirtualViewerPerformanceTests.java | 6 +- .../viewer/model/VirtualViewerPopupTests.java | 8 +- .../viewer/model/VirtualViewerSelectionTests.java | 4 +- .../viewer/model/VirtualViewerStateTests.java | 4 +- .../viewer/model/VirtualViewerUpdateTests.java | 4 +- .../viewer/model/VisibleVirtualItemValidator.java | 20 ++-- 47 files changed, 431 insertions(+), 431 deletions(-) (limited to 'org.eclipse.debug.tests') diff --git a/org.eclipse.debug.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.debug.tests/.settings/org.eclipse.jdt.ui.prefs index f05e2b2a6..4a66042a4 100644 --- a/org.eclipse.debug.tests/.settings/org.eclipse.jdt.ui.prefs +++ b/org.eclipse.debug.tests/.settings/org.eclipse.jdt.ui.prefs @@ -81,7 +81,7 @@ sp_cleanup.make_type_abstract_if_missing_method=false sp_cleanup.make_variable_declarations_final=false sp_cleanup.never_use_blocks=false sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=false +sp_cleanup.on_save_use_additional_actions=true sp_cleanup.organize_imports=false sp_cleanup.qualify_static_field_accesses_with_declaring_class=false sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/LocalSuite.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/LocalSuite.java index 6600cd7a3..2ca50c834 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/LocalSuite.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/LocalSuite.java @@ -25,24 +25,24 @@ import org.eclipse.debug.tests.viewer.model.JFaceViewerTopIndexTests; import org.eclipse.debug.tests.viewer.model.JFaceViewerUpdateTests; /** - * Tests to run locally. They require a user terminal to execute correctly - * and have frequent issues when run on build machine. - * + * Tests to run locally. They require a user terminal to execute correctly + * and have frequent issues when run on build machine. + * * @since 3.7 */ public class LocalSuite extends TestSuite { /** * Returns the suite. This is required to use the JUnit Launcher. - * + * * @return the test suite */ public static Test suite() { return new LocalSuite(); } - + /** - * Constructs the automated test suite. Adds all tests. + * Constructs the automated test suite. Adds all tests. */ public LocalSuite() { // JFace viewer tests diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java index 68efd22be..3042dabd6 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation *******************************************************************************/ @@ -18,14 +18,14 @@ import org.eclipse.debug.tests.viewer.model.VirtualViewerPerformanceTests; /** * Tests for release builds. - * - * @since 3.6 + * + * @since 3.6 */ public class PerformanceSuite extends TestSuite { /** * Returns the suite. This is required to use the JUnit Launcher. - * + * * @return the test suite */ public static Test suite() { @@ -33,12 +33,12 @@ public class PerformanceSuite extends TestSuite { } /** - * Constructs the automated test suite. Adds all tests. + * Constructs the automated test suite. Adds all tests. */ public PerformanceSuite() { // JFace viewer tests addTest(new TestSuite(JFaceViewerPerformanceTests.class)); - + // Virtual viewer tests addTest(new TestSuite(VirtualViewerPerformanceTests.class)); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java index 6324b079b..75ec60687 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM - ongoing enhancements @@ -28,7 +28,7 @@ import org.osgi.framework.BundleContext; /** * The activator class controls the plug-in life cycle - * + * * @since 3.6 */ public class TestsPlugin extends AbstractUIPlugin { @@ -38,7 +38,7 @@ public class TestsPlugin extends AbstractUIPlugin { // The shared instance private static TestsPlugin plugin; - + /** * The constructor */ @@ -73,7 +73,7 @@ public class TestsPlugin extends AbstractUIPlugin { public static TestsPlugin getDefault() { return plugin; } - + /** * Returns the file corresponding to the specified path from within this bundle * @param path @@ -90,7 +90,7 @@ public class TestsPlugin extends AbstractUIPlugin { return null; } } - + /** * Creates a new project with the specified name * @param projectName @@ -105,11 +105,11 @@ public class TestsPlugin extends AbstractUIPlugin { } else { project.refreshLocal(IResource.DEPTH_INFINITE, null); } - + if (!project.isOpen()) { project.open(null); } return project; - } + } } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java index ab4919da9..6de7f9768 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java @@ -28,7 +28,7 @@ public abstract class AbstractLaunchTest extends TestCase { /** * Constructs a test with the given name. - * + * * @param name */ public AbstractLaunchTest(String name) { @@ -37,25 +37,25 @@ public abstract class AbstractLaunchTest extends TestCase { /** * Returns the launch manager. - * + * * @return launch manager */ protected ILaunchManager getLaunchManager() { return DebugPlugin.getDefault().getLaunchManager(); - } - + } + /** * Returns the singleton instance of the LaunchConfigurationManager - * + * * @return the singleton instance of the LaunchConfigurationManager */ protected LaunchConfigurationManager getLaunchConfigurationManager() { return DebugUIPlugin.getDefault().getLaunchConfigurationManager(); - } - + } + /** * Returns a launch configuration with the given name, creating one if required. - * + * * @param name configuration name * @return launch configuration * @throws CoreException @@ -73,5 +73,5 @@ public abstract class AbstractLaunchTest extends TestCase { ILaunchConfigurationWorkingCopy wc = type.newInstance(null, name); ILaunchConfiguration saved = wc.doSave(); return saved; - } + } } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AcceleratorSubstitutionTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AcceleratorSubstitutionTests.java index bb59c7740..edb3091a9 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AcceleratorSubstitutionTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AcceleratorSubstitutionTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -17,7 +17,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin; /** * Tests accelerator adjustments for DBCS languages. * See bug 186921. - * + * * @since 3.3 */ public class AcceleratorSubstitutionTests extends TestCase { @@ -29,7 +29,7 @@ public class AcceleratorSubstitutionTests extends TestCase { public AcceleratorSubstitutionTests(String name) { super(name); } - + /** * tests a string with "..." */ @@ -38,7 +38,7 @@ public class AcceleratorSubstitutionTests extends TestCase { "Open Run Dialog(&R)...", //$NON-NLS-1$ DebugUIPlugin.adjustDBCSAccelerator("Open Run(&R) Dialog...")); //$NON-NLS-1$ } - + /** * tests a string without "..." */ @@ -46,8 +46,8 @@ public class AcceleratorSubstitutionTests extends TestCase { assertEquals("incorrect DBCS accelerator substitution", //$NON-NLS-1$ "Open Run Dialog(&R)", //$NON-NLS-1$ DebugUIPlugin.adjustDBCSAccelerator("Open Run(&R) Dialog")); //$NON-NLS-1$ - } - + } + /** * tests a string that should not change (no DBCS style accelerator). */ @@ -55,5 +55,5 @@ public class AcceleratorSubstitutionTests extends TestCase { assertEquals("incorrect DBCS accelerator substitution", //$NON-NLS-1$ "Open &Run Dialog...", //$NON-NLS-1$ DebugUIPlugin.adjustDBCSAccelerator("Open &Run Dialog...")); //$NON-NLS-1$ - } + } } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchHistoryTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchHistoryTests.java index f5aa48d85..4690b2223 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchHistoryTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchHistoryTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -21,12 +21,12 @@ import org.eclipse.debug.ui.IDebugUIConstants; /** * Test the utilization of launch histories: sizing, ordering, completeness and correctness - * + * * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager * @see org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener * @see org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction - * + * * @since 3.3 */ public class LaunchHistoryTests extends AbstractLaunchTest { @@ -38,7 +38,7 @@ public class LaunchHistoryTests extends AbstractLaunchTest { public LaunchHistoryTests(String name) { super(name); } - + /** * Returns the run launch history * @return @@ -46,7 +46,7 @@ public class LaunchHistoryTests extends AbstractLaunchTest { private LaunchHistory getRunLaunchHistory() { return getLaunchConfigurationManager().getLaunchHistory(IDebugUIConstants.ID_RUN_LAUNCH_GROUP); } - + /** * Returns the maximum allowed size of the launch histories * @return the maximum size of the launch histories @@ -54,7 +54,7 @@ public class LaunchHistoryTests extends AbstractLaunchTest { private int getMaxHistorySize() { return DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugUIConstants.PREF_MAX_HISTORY_SIZE); } - + /** * Sets the maximum size of the launch history to the specified value * @param value the new maximum size for launch histories @@ -62,7 +62,7 @@ public class LaunchHistoryTests extends AbstractLaunchTest { private void setMaxHistorySize(int value) { DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugUIConstants.PREF_MAX_HISTORY_SIZE, value); } - + /** * Returns the debug launch history * @return @@ -70,7 +70,7 @@ public class LaunchHistoryTests extends AbstractLaunchTest { private LaunchHistory getDebugLaunchHistory() { return getLaunchConfigurationManager().getLaunchHistory(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP); } - + /** * This method tests that an item added to the history is added to the head of * history. @@ -84,7 +84,7 @@ public class LaunchHistoryTests extends AbstractLaunchTest { assertTrue("The run history should contain the LaunchHistoryTest config", runhistory.contains(config)); //$NON-NLS-1$ assertEquals("The most recent launch should be LaunchHistoryTest", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ } - + /** * As both the run and the debug launch histories will accept a java application * launch config, both launch histories should contain the test launch configuration @@ -103,7 +103,7 @@ public class LaunchHistoryTests extends AbstractLaunchTest { assertTrue("the debug history should contain LaunchHistoryTest", debughistory.contains(config)); //$NON-NLS-1$ assertEquals("the debug recent launch should be LaunchHistoryTest", debughistory.getRecentLaunch(), config); //$NON-NLS-1$ } - + /** * If we launch config A, then config B, and then config A again, A should be the most recent launch */ @@ -126,9 +126,9 @@ public class LaunchHistoryTests extends AbstractLaunchTest { assertTrue("The run history should contain the LaunchHistoryTest config", runhistory.contains(config)); //$NON-NLS-1$ assertEquals("The most recent launch should be LaunchHistoryTest", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ } - + /** - * If we rename a launch configuration it should not effect the launch history if the renamed configuration + * If we rename a launch configuration it should not effect the launch history if the renamed configuration * is present in the history. */ public void testRenameConfigHistoryUpdate() throws CoreException { @@ -143,16 +143,16 @@ public class LaunchHistoryTests extends AbstractLaunchTest { copy.rename("RenamedLaunchHistoryItem"); //$NON-NLS-1$ config = copy.doSave(); assertEquals("the renamed config should still be the first on in the history", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - + //rename the configuration back to what it was copy = config.getWorkingCopy(); copy.rename("LaunchHistoryTest"); //$NON-NLS-1$ config = copy.doSave(); } - + /** * If we delete a launch configuration and the configuration is present in the launch history, it should be removed - * from the history and the history should be shifted up one place. + * from the history and the history should be shifted up one place. */ public void testDeleteLaunchConfigurationHistoryUpdate() throws CoreException { LaunchHistory runhistory = getRunLaunchHistory(); @@ -171,7 +171,7 @@ public class LaunchHistoryTests extends AbstractLaunchTest { config = getLaunchConfiguration("LaunchHistoryTest"); //$NON-NLS-1$ assertEquals("the run history should have LaunchHistoryTest as the recent launch after delete", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ } - + /** * Tests that setting the size of the launch history appropriately changes what will be returned * when the history is queried for it contents @@ -190,7 +190,7 @@ public class LaunchHistoryTests extends AbstractLaunchTest { config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); assertTrue("there should only be two items in the history", runhistory.getHistory().length == getMaxHistorySize()); //$NON-NLS-1$ assertTrue("the complete launch history should be greater than or equal to the history size", runhistory.getCompleteLaunchHistory().length >= runhistory.getHistory().length); //$NON-NLS-1$ - + //reset the history size setMaxHistorySize(oldsize); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/RefreshTabTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/RefreshTabTests.java index cdb4a8696..97487ef7e 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/RefreshTabTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/RefreshTabTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -35,7 +35,7 @@ import org.eclipse.ui.PlatformUI; * Tests the refresh tab. */ public class RefreshTabTests extends AbstractLaunchTest { - + /** * Constructor * @param name @@ -46,7 +46,7 @@ public class RefreshTabTests extends AbstractLaunchTest { /** * Sets the selected resource in the navigator view. - * + * * @param resource resource to select */ protected void setSelection(IResource resource) { @@ -64,7 +64,7 @@ public class RefreshTabTests extends AbstractLaunchTest { assertNotNull("Failed to open navigator view", null); //$NON-NLS-1$ } } - + /** * Tests a refresh scope of the selected resource * @throws CoreException @@ -76,9 +76,9 @@ public class RefreshTabTests extends AbstractLaunchTest { IResource[] result = RefreshTab.getRefreshResources(scope); assertNotNull(result); assertEquals(1, result.length); - assertEquals(resource, result[0]); + assertEquals(resource, result[0]); } - + /** * Tests a refresh scope of the selected resource's container * @throws CoreException @@ -90,9 +90,9 @@ public class RefreshTabTests extends AbstractLaunchTest { IResource[] result = RefreshTab.getRefreshResources(scope); assertNotNull(result); assertEquals(1, result.length); - assertEquals(resource.getParent(), result[0]); + assertEquals(resource.getParent(), result[0]); } - + /** * Tests a refresh scope of the selected resource's project * @throws CoreException @@ -104,9 +104,9 @@ public class RefreshTabTests extends AbstractLaunchTest { IResource[] result = RefreshTab.getRefreshResources(scope); assertNotNull(result); assertEquals(1, result.length); - assertEquals(resource.getProject(), result[0]); - } - + assertEquals(resource.getProject(), result[0]); + } + /** * Tests a refresh scope of the selected resource's project * @throws CoreException @@ -116,9 +116,9 @@ public class RefreshTabTests extends AbstractLaunchTest { IResource[] result = RefreshTab.getRefreshResources(scope); assertNotNull(result); assertEquals(1, result.length); - assertEquals(ResourcesPlugin.getWorkspace().getRoot(), result[0]); - } - + assertEquals(ResourcesPlugin.getWorkspace().getRoot(), result[0]); + } + /** * Tests a refresh scope for a specific resource (old format) * @throws CoreException @@ -129,9 +129,9 @@ public class RefreshTabTests extends AbstractLaunchTest { IResource[] result = RefreshTab.getRefreshResources(scope); assertNotNull(result); assertEquals(1, result.length); - assertEquals(resource, result[0]); + assertEquals(resource, result[0]); } - + /** * Tests a refresh scope for a working set * @throws CoreException @@ -142,12 +142,12 @@ public class RefreshTabTests extends AbstractLaunchTest { IResource[] result = RefreshTab.getRefreshResources(scope); assertNotNull(result); assertEquals(1, result.length); - assertEquals(resource, result[0]); + assertEquals(resource, result[0]); } - + /** * Returns a scratch project for launch configurations - * + * * @return */ protected IProject getProject() throws CoreException { @@ -162,11 +162,11 @@ public class RefreshTabTests extends AbstractLaunchTest { } return project; } - + /** * Tests the launch configuration attribute comparator extension for comparing * old/new attribute styles. - * + * * @throws CoreException */ public void testRefreshScopeComparator() throws CoreException { @@ -174,10 +174,10 @@ public class RefreshTabTests extends AbstractLaunchTest { String newStyle = "${working_set:\n\n\n}"; //$NON-NLS-1$ assertEquals("Comparator should return 0", 0, new RefreshScopeComparator().compare(oldStyle, newStyle)); //$NON-NLS-1$ } - + /** * Tests persist restore of some resources. - * + * * @throws CoreException */ public void testResourceMemento() throws CoreException { @@ -189,10 +189,10 @@ public class RefreshTabTests extends AbstractLaunchTest { assertEquals(resources[1], restore[1]); assertEquals(resources[2], restore[2]); } - + /** * Tests persist/restore of empty resource collection. - * + * * @throws CoreException */ public void testEmptyResourceSet() throws CoreException { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java index b8feaa035..07bfe2829 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java index e1c68a0c9..c425ac0c0 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -25,12 +25,12 @@ import org.eclipse.debug.tests.TestsPlugin; * Tests status handlers */ public class StatusHandlerTests extends TestCase { - + /** * Status for which a handler is registered. */ public static final IStatus STATUS = new Status(IStatus.ERROR, TestsPlugin.PLUGIN_ID, 333, "", null); //$NON-NLS-1$ - + /** * Tests that a status handler extension exists */ @@ -39,7 +39,7 @@ public class StatusHandlerTests extends TestCase { assertNotNull("missing status handler extension", handler); //$NON-NLS-1$ assertTrue("Unexpected handler", handler instanceof StatusHandler); //$NON-NLS-1$ } - + /** * Tests that status handlers are not returned when preference is disabled */ diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/DynamicRenderingBindings.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/DynamicRenderingBindings.java index 234ea287e..85cb0950b 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/DynamicRenderingBindings.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/DynamicRenderingBindings.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -20,10 +20,10 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingType; * @since 3.1 */ public class DynamicRenderingBindings extends AbstractMemoryRenderingBindingsProvider { - + // private static DynamicRenderingBindings fgSingleton = null; - + // id of rendering type bound by this provider private String fId = "rendering_type_1"; //$NON-NLS-1$ @@ -33,7 +33,7 @@ public class DynamicRenderingBindings extends AbstractMemoryRenderingBindingsPro public DynamicRenderingBindings() { fgSingleton = this; } - + /** * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock) */ @@ -57,11 +57,11 @@ public class DynamicRenderingBindings extends AbstractMemoryRenderingBindingsPro public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block) { return DebugUITools.getMemoryRenderingManager().getRenderingType(fId); } - + /** * Sets the current rendering bound to this provider, and notifies * listeners of the change. - * + * * @param id rendering id */ public static void setBinding(String id) { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockDynamic.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockDynamic.java index d11f3a4e0..1108634e9 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockDynamic.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockDynamic.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -13,7 +13,7 @@ package org.eclipse.debug.tests.view.memory; /** * Dummy memory block - * + * * @since 3.1 */ public class MemoryBlockDynamic extends MemoryBlock { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockOne.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockOne.java index 0f52807d9..5637ed5c5 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockOne.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockOne.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -13,7 +13,7 @@ package org.eclipse.debug.tests.view.memory; /** * Dummy memory block - * + * * @since 3.1 */ public class MemoryBlockOne extends MemoryBlock { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockThree.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockThree.java index 72ca1ad4e..8b671bd80 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockThree.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockThree.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -13,7 +13,7 @@ package org.eclipse.debug.tests.view.memory; /** * Dummy memory block - * + * * @since 3.1 */ public class MemoryBlockThree extends MemoryBlock { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockTwo.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockTwo.java index a3026c22e..eef3d3545 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockTwo.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryBlockTwo.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -13,7 +13,7 @@ package org.eclipse.debug.tests.view.memory; /** * Dummy memory block - * + * * @since 3.1 */ public class MemoryBlockTwo extends MemoryBlock { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java index 2336c975e..9db3804da 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -22,7 +22,7 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingType; * Tests memory rendering manager */ public class MemoryRenderingTests extends TestCase { - + public MemoryRenderingTests(String name) { super(name); } @@ -39,7 +39,7 @@ public class MemoryRenderingTests extends TestCase { assertTrue("Missing type", indexOf(manager.getRenderingType("org.eclipse.debug.ui.rendering.signedint"), types) >= 0); //$NON-NLS-1$ //$NON-NLS-2$ assertTrue("Missing type", indexOf(manager.getRenderingType("org.eclipse.debug.ui.rendering.unsignedint"), types) >= 0); //$NON-NLS-1$ //$NON-NLS-2$ } - + public void testRenderingTypeNames() { IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); IMemoryRenderingType type = manager.getRenderingType("rendering_type_1"); //$NON-NLS-1$ @@ -55,7 +55,7 @@ public class MemoryRenderingTests extends TestCase { assertEquals("Wrong number of bindings", 1, types.length); //$NON-NLS-1$ assertEquals("Wrong binding", "rendering_type_1", types[0].getId()); //$NON-NLS-1$ //$NON-NLS-2$ } - + public void testDoubleBinding() { IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); IMemoryBlock block = new MemoryBlockTwo(); @@ -63,8 +63,8 @@ public class MemoryRenderingTests extends TestCase { assertEquals("Wrong number of bindings", 2, types.length); //$NON-NLS-1$ assertTrue("Missing binding", indexOf(manager.getRenderingType("rendering_type_1"), types) >= 0); //$NON-NLS-1$ //$NON-NLS-2$ assertTrue("Missing binding", indexOf(manager.getRenderingType("rendering_type_2"), types) >= 0); //$NON-NLS-1$ //$NON-NLS-2$ - } - + } + public void testDefaultBinding() { IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); IMemoryBlock block = new MemoryBlockOne(); @@ -72,28 +72,28 @@ public class MemoryRenderingTests extends TestCase { assertEquals("Wrong number of bindings", 1, types.length); //$NON-NLS-1$ assertEquals("Wrong binding", "rendering_type_1", types[0].getId()); //$NON-NLS-1$ //$NON-NLS-2$ } - + public void testNoDefaultBinding() { IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); IMemoryBlock block = new MemoryBlockTwo(); IMemoryRenderingType[] types = manager.getDefaultRenderingTypes(block); assertEquals("Wrong number of bindings", 0, types.length); //$NON-NLS-1$ } - + public void testPrimaryBinding() { IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); IMemoryBlock block = new MemoryBlockOne(); IMemoryRenderingType type = manager.getPrimaryRenderingType(block); assertEquals("Wrong binding", "rendering_type_1", type.getId()); //$NON-NLS-1$ //$NON-NLS-2$ } - + public void testNoPrimaryBinding() { IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); IMemoryBlock block = new MemoryBlockTwo(); IMemoryRenderingType type = manager.getPrimaryRenderingType(block); assertNull("Wrong binding", type); //$NON-NLS-1$ } - + public void testDefaultWithoutPrimaryBinding() { IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); IMemoryBlock block = new MemoryBlockThree(); @@ -101,7 +101,7 @@ public class MemoryRenderingTests extends TestCase { assertEquals("Wrong number of bindings", 1, types.length); //$NON-NLS-1$ assertEquals("Wrong binding", "rendering_type_3", types[0].getId()); //$NON-NLS-1$ //$NON-NLS-2$ } - + public void testDynamicBinding() { IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); IMemoryBlock block = new MemoryBlockDynamic(); @@ -114,22 +114,22 @@ public class MemoryRenderingTests extends TestCase { IMemoryRenderingType type = manager.getPrimaryRenderingType(block); assertEquals("Wrong bindings", manager.getRenderingType("rendering_type_1"), type); //$NON-NLS-1$ //$NON-NLS-2$ } - + public void testBindingChangeNotification() { final boolean[] changed = new boolean[1]; IMemoryRenderingBindingsListener listener = new IMemoryRenderingBindingsListener() { @Override public void memoryRenderingBindingsChanged() { changed[0] = true; - } + } }; IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - + // bug 374447 - Need to make sure that DynamicRenderingBindings singleton // is initialized IMemoryBlock block = new MemoryBlockDynamic(); IMemoryRenderingType[] types = manager.getRenderingTypes(block); - + try { manager.addListener(listener); assertFalse("Renderings should not have changed yet", changed[0]); //$NON-NLS-1$ @@ -144,7 +144,7 @@ public class MemoryRenderingTests extends TestCase { manager.removeListener(listener); } } - + protected int indexOf(Object thing, Object[] list) { for (int i = 0; i < list.length; i++) { Object object2 = list[i]; diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/RenderingTypeDelegate.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/RenderingTypeDelegate.java index 32d388835..d4cf0bca7 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/RenderingTypeDelegate.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/RenderingTypeDelegate.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -16,7 +16,7 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate; /** * Test memory rendering type delegate. - * + * * @since 3.1 */ public class RenderingTypeDelegate implements IMemoryRenderingTypeDelegate { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java index ecdf67e3b..a4a3df63e 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -25,11 +25,11 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; /** - * Tests which verify the check box support. This test is very similar to the - * content test except that the extending class should create a viewer with - * the SWT.CHECK style enabled.
+ * Tests which verify the check box support. This test is very similar to the + * content test except that the extending class should create a viewer with + * the SWT.CHECK style enabled.
* Most of the check box verification is performed in the test model. - * + * * @since 3.6 */ abstract public class CheckTests extends TestCase { @@ -37,7 +37,7 @@ abstract public class CheckTests extends TestCase { Shell fShell; ITreeModelViewer fViewer; TestModelUpdatesListener fListener; - + public CheckTests(String name) { super(name); } @@ -53,14 +53,14 @@ abstract public class CheckTests extends TestCase { fShell.setLayout(new FillLayout()); fViewer = createViewer(fDisplay, fShell); - + fListener = new TestModelUpdatesListener(fViewer, false, false); fShell.open (); } abstract protected IInternalTreeModelViewer createViewer(Display display, Shell shell); - + /** * @throws java.lang.Exception */ @@ -68,7 +68,7 @@ abstract public class CheckTests extends TestCase { protected void tearDown() throws Exception { fListener.dispose(); fViewer.getPresentationContext().dispose(); - + // Close the shell and exit. fShell.close(); while (!fShell.isDisposed()) { @@ -93,34 +93,34 @@ abstract public class CheckTests extends TestCase { // Make sure that all elements are expanded fViewer.setAutoExpandLevel(-1); - + // Create the agent which forces the tree to populate //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - + // Create the listener which determines when the view is finished updating. - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - + fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); + // Set the viewer input (and trigger updates). fViewer.setInput(model.getRootElement()); - + // Wait for the updates to complete. while (!fListener.isFinished()) { if (!fDisplay.readAndDispatch ()) { Thread.sleep(0); } } - + model.validateData(fViewer, TreePath.EMPTY); } public void testSimpleMultiLevel() throws InterruptedException { //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - + TestModel model = TestModel.simpleMultiLevel(); fViewer.setAutoExpandLevel(-1); - - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - + + fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); + fViewer.setInput(model.getRootElement()); while (!fListener.isFinished()) { @@ -138,14 +138,14 @@ abstract public class CheckTests extends TestCase { // TestModel model = TestModel.simpleSingleLevel(); // fViewer.setAutoExpandLevel(-1); // //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); -// fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); +// fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); // fViewer.setInput(model.getRootElement()); -// +// // // Wait for the updates to complete and validate. // while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) Thread.sleep(0); // model.validateData(fViewer, TreePath.EMPTY); -// -// InternalTreeModelViewer treeViewer = ((InternalTreeModelViewer)fViewer); +// +// InternalTreeModelViewer treeViewer = ((InternalTreeModelViewer)fViewer); // TreePath elementPath = model.findElement("1"); // TestElement element = model.getElement(elementPath); // boolean initialCheckState = element.getChecked(); @@ -158,18 +158,18 @@ abstract public class CheckTests extends TestCase { // fDisplay.post(event); // // while (fDisplay.readAndDispatch ()); -// +// // Assert.assertTrue(element.getChecked() != initialCheckState); // } public void testUpdateCheck() throws InterruptedException { //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - + TestModel model = TestModel.simpleSingleLevel(); fViewer.setAutoExpandLevel(-1); // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); + fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); // Set the input into the view and update the view. fViewer.setInput(model.getRootElement()); @@ -179,14 +179,14 @@ abstract public class CheckTests extends TestCase { } } model.validateData(fViewer, TreePath.EMPTY); - + // Update the model TestElement element = model.getRootElement().getChildren()[0]; - + TreePath elementPath = new TreePath(new Object[] { element }); ModelDelta delta = model.setElementChecked(elementPath, false, false); - - fListener.reset(elementPath, element, -1, true, false); + + fListener.reset(elementPath, element, -1, true, false); model.postDelta(delta); while (!fListener.isFinished(ITestModelUpdatesListenerConstants.LABEL_COMPLETE | ITestModelUpdatesListenerConstants.MODEL_CHANGED_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java index 863b4a785..300cbe8bf 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -35,20 +35,20 @@ import org.eclipse.swt.widgets.Display; /** * Tests coalescing of children update requests. - * + * * @since 3.3 */ public class ChildrenUpdateTests extends TestCase { - + class BogusModelContentProvider extends TreeModelContentProvider { - + /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider#getViewer() */ @Override protected IInternalTreeModelViewer getViewer() { return new IInternalTreeModelViewer(){ - + @Override public void setSelection(ISelection selection) {} @Override @@ -105,52 +105,52 @@ public class ChildrenUpdateTests extends TestCase { public void refresh() {} @Override public void refresh(Object element) {} - + @Override public ISelection getSelection() { return null; } - + @Override public IPresentationContext getPresentationContext() { return null; } - + @Override public Object getInput() { return null; } - + @Override public ViewerLabel getElementLabel(TreePath path, String columnId) { return null; } - + @Override public Display getDisplay() { return DebugUIPlugin.getStandardDisplay(); } - + @Override public int getAutoExpandLevel() { return 0; } - - + + @Override public boolean overrideSelection(ISelection current, ISelection candidate) { return false; } - + @Override public void insert(Object parentOrTreePath, Object element, int position) { } - + @Override public TreePath getTopElementPath() { return null; } - + @Override public ViewerFilter[] getFilters() { return null; @@ -161,36 +161,36 @@ public class ChildrenUpdateTests extends TestCase { @Override public void setFilters(ViewerFilter... filters) { } - + @Override public boolean getExpandedState(Object elementOrTreePath) { return false; } - + @Override public Object getChildElement(TreePath path, int index) { return null; } - + @Override public boolean getHasChildren(Object elementOrTreePath) { return false; } - + @Override public int getChildCount(TreePath path) { return 0; } - + @Override public int findElementIndex(TreePath parentPath, Object element) { return 0; } - + @Override public void expandToLevel(Object elementOrTreePath, int level) { } - + @Override public void autoExpand(TreePath elementPath) { } @@ -199,17 +199,17 @@ public class ChildrenUpdateTests extends TestCase { public boolean getElementChildrenRealized(TreePath parentPath) { return false; } - + @Override public boolean getElementChecked(TreePath path) { return false; } - + @Override public boolean getElementGrayed(TreePath path) { return false; } - + @Override public void setElementChecked(TreePath path, boolean checked, boolean grayed) { } @@ -225,22 +225,22 @@ public class ChildrenUpdateTests extends TestCase { @Override public String[] getVisibleColumns() { return null; - } + } }; } } - + /** * @param name */ public ChildrenUpdateTests(String name) { super(name); } - + protected TreeModelContentProvider getContentProvider() { return new BogusModelContentProvider(); } - + /** * Tests coalescing of requests */ @@ -252,17 +252,17 @@ public class ChildrenUpdateTests extends TestCase { assertTrue("Should coalesce", update1.coalesce(update2)); //$NON-NLS-1$ assertEquals("Wrong offset", 1, update1.getOffset()); //$NON-NLS-1$ assertEquals("Wrong length", 2, update1.getLength()); //$NON-NLS-1$ - + update2 = new ChildrenUpdate(cp, element, TreePath.EMPTY, element, 3, null); assertTrue("Should coalesce", update1.coalesce(update2)); //$NON-NLS-1$ assertEquals("Wrong offset", 1, update1.getOffset()); //$NON-NLS-1$ assertEquals("Wrong length", 3, update1.getLength()); //$NON-NLS-1$ - + update2 = new ChildrenUpdate(cp, element, TreePath.EMPTY, element, 2, null); assertTrue("Should coalesce", update1.coalesce(update2)); //$NON-NLS-1$ assertEquals("Wrong offset", 1, update1.getOffset()); //$NON-NLS-1$ assertEquals("Wrong length", 3, update1.getLength()); //$NON-NLS-1$ - + update2 = new ChildrenUpdate(cp, element, TreePath.EMPTY, element, 5, null); assertFalse("Should not coalesce", update1.coalesce(update2)); //$NON-NLS-1$ assertEquals("Wrong offset", 1, update1.getOffset()); //$NON-NLS-1$ diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java index df9991dfb..9fed7b530 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -43,7 +43,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat private Shell fShell; private TreeModelViewer fViewer; private TestModelUpdatesListener fListener; - private boolean fResized = false; + private boolean fResized = false; public ColumnPresentationTests(String name) { super(name); @@ -76,7 +76,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat public void controlResized(ControlEvent e) { fResized = true; } - + @Override public void controlMoved(ControlEvent e) { } @@ -117,7 +117,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat } return columnIds; } - + MyColumnPresentation(String[] columnIds) { this.columnIds = columnIds; } @@ -274,7 +274,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat Thread.sleep(0); } fResized = false; - + MyColumnPresentation colPre = new MyColumnPresentation(); makeModel(colPre, "m1"); //$NON-NLS-1$ Tree tree = fViewer.getTree(); @@ -290,7 +290,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat for (int i = 0; i < columns.length - 1; i++) { assertEquals(avgWidth, columns[i].getWidth()); } - // Checking of the width of the last column is not reliable. + // Checking of the width of the last column is not reliable. // I.e. it's handled differenty on different platforms. //int remainder = treeWidth % columns.length; //assertEquals(avgWidth + remainder, columns[columns.length - 1].getWidth()); @@ -312,12 +312,12 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat makeModel(colPre, "m2"); //$NON-NLS-1$ Tree tree = fViewer.getTree(); TreeColumn[] columns = tree.getColumns(); - + // Resizing the tree invalidates the test. if (fResized) { return; } - + for (int i = 0; i < columns.length; i++) { int width = colPre.repliedWidths[i]; if (width != -1) { @@ -411,14 +411,14 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat assertEquals(newWidths[i], columns[i].getWidth()); } } - + /** - * In this test: verify that tree viewer can handle the column presentation changing + * In this test: verify that tree viewer can handle the column presentation changing * its available column IDs between runs (bug 360015). */ public void testChangedColumnIds() throws InterruptedException { MyColumnPresentation colPre = new MyColumnPresentation(); - + makeModel(colPre, "m1"); //$NON-NLS-1$ TreeColumn[] columns = fViewer.getTree().getColumns(); // Select visible columns @@ -428,18 +428,18 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat Thread.sleep(0); } } while (fViewer.getTree().getColumns().length != 1); - + // get InternalTreeModelViewer to rebuild columns due to change of // model and presentation - first set to another model and column // presentation, then switch to a model with original presentation. makeModel(new MyColumnPresentation2(), "m2"); //$NON-NLS-1$ - + String[] newColumnIds = MyColumnPresentation.makeDefaultColumnIds(); newColumnIds[0] = "new_column_id"; //$NON-NLS-1$ colPre = new MyColumnPresentation(newColumnIds); - + makeModel(colPre, "m3"); //$NON-NLS-1$ - + // verify user resized widths are used instead of the initial widths from IColumnPresentation2 columns = fViewer.getTree().getColumns(); for (int i = 0; i < columns.length; i++) { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java index f7f9ae78d..4659ec17a 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - clean-up @@ -33,18 +33,18 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; /** - * Tests that verify that the viewer property retrieves all the content + * Tests that verify that the viewer property retrieves all the content * from the model. - * + * * @since 3.8 */ abstract public class FilterTests extends TestCase implements ITestModelUpdatesListenerConstants { - + Display fDisplay; Shell fShell; ITreeModelViewer fViewer; TestModelUpdatesListener fListener; - + public FilterTests(String name) { super(name); } @@ -60,14 +60,14 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL fShell.setLayout(new FillLayout()); fViewer = createViewer(fDisplay, fShell); - + fListener = new TestModelUpdatesListener(fViewer, true, true); fShell.open (); } abstract protected IInternalTreeModelViewer createViewer(Display display, Shell shell); - + /** * @throws java.lang.Exception */ @@ -75,7 +75,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL protected void tearDown() throws Exception { fListener.dispose(); fViewer.getPresentationContext().dispose(); - + // Close the shell and exit. fShell.close(); while (!fShell.isDisposed()) { @@ -93,27 +93,27 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); //$NON-NLS-1$ //$NON-NLS-2$ } } - + protected IInternalTreeModelViewer getInternalViewer() { return (IInternalTreeModelViewer)fViewer; } - + class TestViewerFilter extends ViewerFilter { - + Pattern fPattern; TestViewerFilter(String pattern) { fPattern = Pattern.compile(pattern); } - - + + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof TestElement) { TestElement te = (TestElement)element; return !fPattern.matcher(te.getLabel()).find(); } - + return true; } } @@ -125,7 +125,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL fPattern = Pattern.compile(pattern); fParentElement = parentElement; } - + @Override public boolean isApplicable(ITreeModelViewer viewer, Object parentElement) { if (fParentElement != null) { @@ -134,38 +134,38 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL return true; } - + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof TestElement) { TestElement te = (TestElement)element; return !fPattern.matcher(te.getLabel()).find(); } - + return true; } } - + public void testSimpleSingleLevel() throws InterruptedException { TestModel model = TestModel.simpleSingleLevel(); doTestSimpleLevel(model, new ViewerFilter[] { new TestViewerFilter("2") }); //$NON-NLS-1$ } - + public void testSimpleSingleLevelWithTMVFilter() throws InterruptedException { TestModel model = TestModel.simpleSingleLevel(); doTestSimpleLevel(model, new ViewerFilter[] { new TestTMVFilter("2", model.getRootElement()) }); //$NON-NLS-1$ } - + public void testSimpleSingleLevelWithMixedFilters() throws InterruptedException { TestModel model = TestModel.simpleSingleLevel(); doTestSimpleLevel(model, new ViewerFilter[] { new TestTMVFilter("2", model.getRootElement()), new TestViewerFilter("1") }); //$NON-NLS-1$ //$NON-NLS-2$ - } + } public void testSimpleMultiLevel() throws InterruptedException { TestModel model = TestModel.simpleMultiLevel(); doTestSimpleLevel(model, new ViewerFilter[] { new TestViewerFilter(".1"), new TestViewerFilter(".2") }); //$NON-NLS-1$ //$NON-NLS-2$ } - + public void testSimpleMultiLevelWithTMVFilter() throws InterruptedException { TestModel model = TestModel.simpleMultiLevel(); doTestSimpleLevel(model, new ViewerFilter[] { new TestTMVFilter(".1", null), new TestTMVFilter(".2", null) }); //$NON-NLS-1$ //$NON-NLS-2$ @@ -177,29 +177,29 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL } private void doTestSimpleLevel(TestModel model, ViewerFilter[] filters) throws InterruptedException { - + // Make sure that all elements are expanded fViewer.setAutoExpandLevel(-1); - + fViewer.setFilters(filters); - + // Create the listener which determines when the view is finished updating. // fListener.reset(TreePath.EMPTY, model.getRootElement(), filters, -1, false, false); fListener.reset(TreePath.EMPTY, model.getRootElement(), filters, -1, true, true); - + // Set the viewer input (and trigger updates). fViewer.setInput(model.getRootElement()); - + // Wait for the updates to complete. while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { Thread.sleep(0); } } - + model.validateData(fViewer, TreePath.EMPTY, false, filters); } - + public void testLargeSingleLevel() throws InterruptedException { doTestLargeSingleLevel(new ViewerFilter[] { new TestViewerFilter("2") }); //$NON-NLS-1$ } @@ -207,7 +207,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL public void testLargeSingleLevelWithTMVFilter() throws InterruptedException { doTestLargeSingleLevel(new ViewerFilter[] { new TestTMVFilter("2", null) }); //$NON-NLS-1$ } - + private void doTestLargeSingleLevel(ViewerFilter[] filters) throws InterruptedException { TestModel model = new TestModel(); model.setRoot(new TestElement(model, "root", new TestElement[0])); //$NON-NLS-1$ @@ -219,17 +219,17 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL fListener.setFailOnRedundantUpdates(false); //fListener.setFailOnMultipleLabelUpdateSequences(false); fListener.reset(); - + fViewer.setInput(model.getRootElement()); - + while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { Thread.sleep(0); } } } - - + + /** * Replace an element that is not visible but filtered out. With an element that is NOT filtered out. * Fire REPLACE delta. @@ -237,7 +237,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL public void testReplacedUnrealizedFilteredElement() throws InterruptedException { doTestReplacedUnrealizedFilteredElement(new ViewerFilter[] { new TestViewerFilter("2") }); //$NON-NLS-1$ } - + /** * Replace an element that is not visible but filtered out. With an element that is NOT filtered out. @@ -246,9 +246,9 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL public void testReplacedUnrealizedFilteredElementWithTMVFilter() throws InterruptedException { doTestReplacedUnrealizedFilteredElement(new ViewerFilter[] { new TestTMVFilter("2", null) }); //$NON-NLS-1$ } - + private void doTestReplacedUnrealizedFilteredElement(ViewerFilter[] filters) throws InterruptedException { - + // Populate a view with a large model (only first 100 elements will be visible in virtual viewer). TestModel model = new TestModel(); model.setRoot(new TestElement(model, "root", new TestElement[0])); //$NON-NLS-1$ @@ -261,14 +261,14 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL // Populate the view (all elements containing a "2" will be filtered out. fViewer.setInput(model.getRootElement()); - + while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { Thread.sleep(0); } } - - // Switch out element "201" which is filtered out, with a "replaced element" which should NOT be + + // Switch out element "201" which is filtered out, with a "replaced element" which should NOT be // filtered out. TestElement replacedElement = new TestElement(model, "replaced element", new TestElement[0]); //$NON-NLS-1$ IModelDelta replaceDelta = model.replaceElementChild(TreePath.EMPTY, 200, replacedElement); @@ -281,7 +281,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL } // Reposition the viewer to make element 100 the top element, making the replaced element visible. - fListener.reset(); + fListener.reset(); ((IInternalTreeModelViewer) fViewer).reveal(TreePath.EMPTY, 150); while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { @@ -320,14 +320,14 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL // Populate the view (all elements containing a "2" will be filtered out. fViewer.setInput(model.getRootElement()); - + while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { Thread.sleep(0); } } - - // Switch out element "201" which is filtered out, with a "replaced element" which should NOT be + + // Switch out element "201" which is filtered out, with a "replaced element" which should NOT be // filtered out. TestElement replacedElement = new TestElement(model, "replaced element", new TestElement[0]); //$NON-NLS-1$ model.replaceElementChild(TreePath.EMPTY, 200, replacedElement); @@ -340,7 +340,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL } // Reposition the viewer to make element 100 the top element, making the replaced element visible. - fListener.reset(); + fListener.reset(); ((IInternalTreeModelViewer) fViewer).reveal(TreePath.EMPTY, 150); while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { @@ -351,12 +351,12 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL // Verify that the replaced element is in viewer now (i.e. it's not filtered out. TreePath[] replacedElementPaths = fViewer.getElementPaths(replacedElement); assertTrue(replacedElementPaths.length != 0); - } + } public void testRefreshToUnfilterElements() throws InterruptedException { doTestRefreshToUnfilterElements(new ViewerFilter[] { new TestViewerFilter(".1"), new TestViewerFilter(".2") }); //$NON-NLS-1$ //$NON-NLS-2$ } - + public void testRefreshToUnfilterElementsWithTMVFilter() throws InterruptedException { doTestRefreshToUnfilterElements(new ViewerFilter[] { new TestTMVFilter(".1", null), new TestTMVFilter(".2", null) }); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -364,7 +364,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL public void testRefreshToUnfilterElementsWithMixedFilters() throws InterruptedException { doTestRefreshToUnfilterElements(new ViewerFilter[] { new TestViewerFilter(".1"), new TestTMVFilter(".2", null) }); //$NON-NLS-1$ //$NON-NLS-2$ } - + /** * Replace an element that is not visible but filtered out. With an element that is NOT filtered out. * Fire CONTENT delta on parent. @@ -381,10 +381,10 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL // Make sure that all elements are expanded fViewer.setAutoExpandLevel(-1); - + // Populate the view (all elements containing a "2" will be filtered out. fViewer.setInput(model.getRootElement()); - + while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { Thread.sleep(0); @@ -404,16 +404,16 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL } model.validateData(fViewer, TreePath.EMPTY, false, filters1); - } + } public void testPreserveExpandedOnMultLevelContent() throws InterruptedException { //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); TestModel model = StateTests.alternatingSubsreesModel(6); // NOTE: WE ARE NOT EXPANDING ANY CHILDREN - + // Create the listener, only check the first level - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); + fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); // Set the input into the view and update the view. fViewer.setInput(model.getRootElement()); @@ -425,7 +425,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL model.validateData(fViewer, TreePath.EMPTY, true); StateTests.expandAlternateElements(fListener, model, true); - + // Set a selection in view // Set a selection in view TreeSelection originalSelection = new TreeSelection( @@ -436,11 +436,11 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle // Set a filter to remove element "1" ViewerFilter[] filters = new ViewerFilter[] { new TestViewerFilter("^1$") }; //$NON-NLS-1$ fViewer.setFilters(filters); - + // Note: Re-expanding nodes causes redundant updates. fListener.reset(false, false); fListener.addUpdates(getInternalViewer(), TreePath.EMPTY, model.getRootElement(), filters, -1, ALL_UPDATES_COMPLETE); - + // Post the refresh delta model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) { @@ -459,11 +459,11 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true); //$NON-NLS-1$ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false); //$NON-NLS-1$ assertTrue( StateTests.areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - - // Note: in past it was observed sub-optimal coalescing in this test due + + // Note: in past it was observed sub-optimal coalescing in this test due // to scattered update requests from viewer. assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 6) ); - + // Clear the filter, to re-add the element filters = new ViewerFilter[0]; fViewer.setFilters(filters); @@ -488,7 +488,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true); //$NON-NLS-1$ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false); //$NON-NLS-1$ assertTrue( StateTests.areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - + } - + } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java index a5081cf5b..dc52f8b2f 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -20,7 +20,7 @@ import org.eclipse.jface.viewers.TreePath; * @since 3.3 */ public class FilterTransformTests extends TestCase { - + public Object root; public Object element0; public Object element1; @@ -30,16 +30,16 @@ public class FilterTransformTests extends TestCase { public Object element5; public Object element6; public Object element7; - + public FilterTransform transform; - + /** * @param name */ public FilterTransformTests(String name) { super(name); } - + /** * Builds a filter transform. Model has 8 elements, * and elements 0, 2, 3, 6, 7 are filtered. Elements @@ -64,7 +64,7 @@ public class FilterTransformTests extends TestCase { assertTrue(transform.addFilteredIndex(TreePath.EMPTY, 6, element6)); assertTrue(transform.addFilteredIndex(TreePath.EMPTY, 7, element7)); } - + protected boolean equals(int[] a, int[] b) { if (a.length == b.length) { for (int i = 0; i < b.length; i++) { @@ -83,13 +83,13 @@ public class FilterTransformTests extends TestCase { assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 3)); //$NON-NLS-1$ assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[] { 0, 2, 5, 6 })); //$NON-NLS-1$ } - + public void testRemoveFirstElementFromFilters() { assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 0)); //$NON-NLS-1$ transform.removeElementFromFilters(TreePath.EMPTY, element0); assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 0)); //$NON-NLS-1$ assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[] { 1, 2, 5, 6 })); //$NON-NLS-1$ - } + } public void testRemoveLastFromFilters() { assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 7)); //$NON-NLS-1$ @@ -97,45 +97,45 @@ public class FilterTransformTests extends TestCase { assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 7)); //$NON-NLS-1$ assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[] { 0, 2, 3, 6 })); //$NON-NLS-1$ } - + public void testClearMiddleElementFromFilters() { assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 3)); //$NON-NLS-1$ transform.clear(TreePath.EMPTY, 3); assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 3)); //$NON-NLS-1$ assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[] { 0, 2, 6, 7 })); //$NON-NLS-1$ } - + public void testClearFirstElementFromFilters() { assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 0)); //$NON-NLS-1$ transform.clear(TreePath.EMPTY, 0); assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 0)); //$NON-NLS-1$ assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[] { 2, 3, 6, 7 })); //$NON-NLS-1$ - } + } public void testClearLastFromFilters() { assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 7)); //$NON-NLS-1$ transform.clear(TreePath.EMPTY, 7); assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 7)); //$NON-NLS-1$ assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[] { 0, 2, 3, 6 })); //$NON-NLS-1$ - } - + } + public void testViewToModelCount() { assertEquals("Wrong model count", 8, transform.viewToModelCount(TreePath.EMPTY, 3)); //$NON-NLS-1$ } - + public void testViewToModelIndex() { assertEquals("Wrong model index", 1, transform.viewToModelIndex(TreePath.EMPTY, 0)); //$NON-NLS-1$ assertEquals("Wrong model index", 4, transform.viewToModelIndex(TreePath.EMPTY, 1)); //$NON-NLS-1$ assertEquals("Wrong model index", 5, transform.viewToModelIndex(TreePath.EMPTY, 2)); //$NON-NLS-1$ } - + public void testAddAlreadyFiltered() { assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 0)); //$NON-NLS-1$ boolean added = transform.addFilteredIndex(TreePath.EMPTY, 0, element0); assertFalse("Filter should not be added - should already have been there", added); //$NON-NLS-1$ } - - + + /** * Test to make sure that setModelChildCount() updates internal arrays appropriately. * See bug 200325. diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java index 3fc501bcc..bed64a16e 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation *******************************************************************************/ @@ -12,11 +12,11 @@ package org.eclipse.debug.tests.viewer.model; /** * Convenience interface with constants used by the test model update listener. - * + * * @since 3.6 */ public interface ITestModelUpdatesListenerConstants { - + public static final int LABEL_SEQUENCE_COMPLETE = 0X00000001; public static final int CONTENT_SEQUENCE_COMPLETE = 0X00000002; public static final int CONTENT_SEQUENCE_STARTED = 0X00020000; @@ -29,7 +29,7 @@ public interface ITestModelUpdatesListenerConstants { public static final int CHILDREN_UPDATES = 0X00000020; public static final int CHILDREN_UPDATES_STARTED = 0X00200000; public static final int CHILDREN_UPDATES_RUNNING = 0X00400000; - public static final int MODEL_CHANGED_COMPLETE = 0X00000040; + public static final int MODEL_CHANGED_COMPLETE = 0X00000040; public static final int MODEL_PROXIES_INSTALLED = 0X00000080; public static final int STATE_SAVE_COMPLETE = 0X00000100; public static final int STATE_SAVE_STARTED = 0X01000000; @@ -37,15 +37,15 @@ public interface ITestModelUpdatesListenerConstants { public static final int STATE_RESTORE_STARTED = 0X02000000; public static final int STATE_UPDATES = 0X00000400; public static final int STATE_UPDATES_STARTED = 0X04000000; - + public static final int VIEWER_UPDATES_RUNNING = 0X00001000; public static final int LABEL_UPDATES_RUNNING = 0X00002000; - public static final int ALL_VIEWER_UPDATES_STARTED = HAS_CHILDREN_UPDATES_STARTED | CHILD_COUNT_UPDATES_STARTED | CHILDREN_UPDATES_STARTED; + public static final int ALL_VIEWER_UPDATES_STARTED = HAS_CHILDREN_UPDATES_STARTED | CHILD_COUNT_UPDATES_STARTED | CHILDREN_UPDATES_STARTED; public static final int LABEL_COMPLETE = LABEL_SEQUENCE_COMPLETE | LABEL_UPDATES | LABEL_UPDATES_RUNNING; - public static final int CONTENT_COMPLETE = + public static final int CONTENT_COMPLETE = CONTENT_SEQUENCE_COMPLETE | HAS_CHILDREN_UPDATES | CHILD_COUNT_UPDATES | CHILDREN_UPDATES | VIEWER_UPDATES_RUNNING; - + public static final int ALL_UPDATES_COMPLETE = LABEL_COMPLETE | CONTENT_COMPLETE | MODEL_PROXIES_INSTALLED | LABEL_UPDATES_RUNNING | VIEWER_UPDATES_RUNNING; } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerCheckTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerCheckTests.java index b73dc4661..809ee738a 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerCheckTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerCheckTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class JFaceViewerCheckTests extends CheckTests { - + public JFaceViewerCheckTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerContentTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerContentTests.java index 9789eccc0..5d880ab52 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerContentTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerContentTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class JFaceViewerContentTests extends ContentTests { - + public JFaceViewerContentTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerDeltaTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerDeltaTests.java index 53433c746..c46bceacf 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerDeltaTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerDeltaTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class JFaceViewerDeltaTests extends DeltaTests { - + public JFaceViewerDeltaTests(String name) { super(name); } @@ -31,7 +31,7 @@ public class JFaceViewerDeltaTests extends DeltaTests { protected IInternalTreeModelViewer createViewer(Display display, Shell shell) { return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$ } - + /** * TODO: remove this method when bug 292322 gets fixed in TreeViewer */ diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerFilterTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerFilterTests.java index a5398fdd3..625d3d43b 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerFilterTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerFilterTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.8 */ public class JFaceViewerFilterTests extends FilterTests { - + public JFaceViewerFilterTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerLazyTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerLazyTests.java index 326cbf47b..1686324ef 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerLazyTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerLazyTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation *******************************************************************************/ @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class JFaceViewerLazyTests extends LazyTests { - + public JFaceViewerLazyTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPerformanceTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPerformanceTests.java index f45685ab2..fa86f087e 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPerformanceTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPerformanceTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation *******************************************************************************/ @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class JFaceViewerPerformanceTests extends PerformanceTests { - + public JFaceViewerPerformanceTests(String name) { super(name); } @@ -30,7 +30,7 @@ public class JFaceViewerPerformanceTests extends PerformanceTests { protected IInternalTreeModelViewer createViewer(Display display, Shell shell) { return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$ } - + @Override protected int getTestModelDepth() { return 5; diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPopupTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPopupTests.java index 976ebbab7..3d3fb981f 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPopupTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPopupTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class JFaceViewerPopupTests extends PopupTests { - + public JFaceViewerPopupTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerSelectionTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerSelectionTests.java index ed84dc7f2..e255f9003 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerSelectionTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerSelectionTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class JFaceViewerSelectionTests extends SelectionTests { - + public JFaceViewerSelectionTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerStateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerStateTests.java index a27183fbd..282f826c3 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerStateTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerStateTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class JFaceViewerStateTests extends StateTests { - + public JFaceViewerStateTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerUpdateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerUpdateTests.java index c76d02b0e..60865ece2 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerUpdateTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerUpdateTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class JFaceViewerUpdateTests extends UpdateTests { - + public JFaceViewerUpdateTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java index e30945c03..a19ae733a 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - clean-up @@ -27,18 +27,18 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; /** - * Tests that verify that the viewer property retrieves all the content + * Tests that verify that the viewer property retrieves all the content * from the model. - * + * * @since 3.6 */ abstract public class LazyTests extends TestCase implements ITestModelUpdatesListenerConstants { - + Display fDisplay; Shell fShell; IInternalTreeModelViewer fViewer; TestModelUpdatesListener fListener; - + public LazyTests(String name) { super(name); } @@ -54,7 +54,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis fShell.setLayout(new FillLayout()); fViewer = createViewer(fDisplay, fShell); - + fListener = new TestModelUpdatesListener(fViewer, true, true); fShell.open (); @@ -68,7 +68,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis protected void tearDown() throws Exception { fListener.dispose(); fViewer.getPresentationContext().dispose(); - + // Close the shell and exit. fShell.close(); while (!fShell.isDisposed()) { @@ -86,10 +86,10 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); //$NON-NLS-1$ //$NON-NLS-2$ } } - + /** * Creates a model in the pattern of: - * + * * root * 1 * 1.1 @@ -106,23 +106,23 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis } TestElement element = new TestElement(model, "1", children); //$NON-NLS-1$ model.setRoot(new TestElement(model, "root", new TestElement[] { element })); //$NON-NLS-1$ - + return model; } /** - * Test to make sure that if an element is expanded its children are + * Test to make sure that if an element is expanded its children are * not automatically materialized. * (bug 305739 and bug 304277) */ public void testExpandLargeSubTree() throws InterruptedException { // Create test model with lots of children. - TestModel model = largeSubtreeModel(1000); - + TestModel model = largeSubtreeModel(1000); + // NOTE: WE ARE NOT EXPANDING ANY CHILDREN // Populate initial view content - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, true); + fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, true); fViewer.setInput(model.getRootElement()); while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { @@ -138,7 +138,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis expandDelta.addNode(expandElement, 0, IModelDelta.EXPAND, expandElement.getChildren().length); // Add first 250 elements as acceptable to materialize - fListener.reset(); + fListener.reset(); fListener.setFailOnRedundantUpdates(true); TreePath expandElementPath = model.findElement("1"); //$NON-NLS-1$ fListener.addChildreCountUpdate(expandElementPath); @@ -159,23 +159,23 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis } /** - * Test to make sure that if an element that is previously selected, is + * Test to make sure that if an element that is previously selected, is * then selected and replaced, that no extra elements are retrieved. * (bug 304277 comment #24, and bug 305739 comment #9). */ public void testReplaceAndSelectInSubTreeTree() throws InterruptedException { // Create test model with lots of children. - TestModel model = largeSubtreeModel(1000); - + TestModel model = largeSubtreeModel(1000); + // Expand all children fViewer.setAutoExpandLevel(-1); - - // Populate initial view content, watch for all updates but only wait + + // Populate initial view content, watch for all updates but only wait // for the content update sequence to finish (elements off screen will // not be updated). // TODO: child count for element 1 is updated multiple times. fListener.reset(); - fListener.setFailOnMultipleModelUpdateSequences(true); + fListener.setFailOnMultipleModelUpdateSequences(true); fListener.setFailOnRedundantUpdates(false); fViewer.setInput(model.getRootElement()); fListener.addLabelUpdate(model.findElement("1.0")); //$NON-NLS-1$ @@ -187,7 +187,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis // Set selection so that the initial selection is not empty fViewer.setSelection(new TreeSelection(new TreePath[] { model.findElement("1.0") })); //$NON-NLS-1$ - + // Create delta to select the "1" element. TestElement rootElement = model.getRootElement(); ModelDelta rootDelta = new ModelDelta(rootElement, IModelDelta.NO_CHANGE); @@ -202,7 +202,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis _1Delta.addNode(_1_0_newElement, 0, IModelDelta.SELECT); // Add element label update and post the delta - fListener.reset(); + fListener.reset(); fListener.setFailOnRedundantUpdates(true); TreePath _1_0_newElementPath = model.findElement("1.0 - new"); //$NON-NLS-1$ fListener.addLabelUpdate(_1_0_newElementPath); @@ -222,13 +222,13 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis */ public void testContentRefresh() throws InterruptedException { // Create test model with lots of children. - TestModel model = largeSubtreeModel(1000); - + TestModel model = largeSubtreeModel(1000); + // Expand children all fViewer.setAutoExpandLevel(-1); // Populate initial view content - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, true); + fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, true); fViewer.setInput(model.getRootElement()); while (!fListener.isFinished(CONTENT_SEQUENCE_COMPLETE | LABEL_SEQUENCE_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { @@ -248,7 +248,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis Thread.sleep(0); } } - + // Create delta to refresh the "1" element. TestElement rootElement = model.getRootElement(); ModelDelta rootDelta = new ModelDelta(rootElement, IModelDelta.NO_CHANGE); @@ -256,11 +256,11 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis TestElement expandElement = rootElement.getChildren()[0]; expandDelta.addNode(expandElement, 0, IModelDelta.CONTENT, expandElement.getChildren().length); - // Rinse and repeast. The refresh in bug 335734 is only triggered + // Rinse and repeast. The refresh in bug 335734 is only triggered // only on the second time. for (int repeatCount = 0; repeatCount < 3; repeatCount++) { // Add first 250 elements (after element 500) as acceptable to materialize - fListener.reset(); + fListener.reset(); fListener.setFailOnRedundantUpdates(true); TreePath refreshElementPath = model.findElement("1"); //$NON-NLS-1$ fListener.addRedundantExceptionChildCount(refreshElementPath); @@ -276,7 +276,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis fListener.addHasChildrenUpdate(childPath); } model.postDelta(rootDelta); - + while (!fListener.isFinished(CONTENT_SEQUENCE_COMPLETE | MODEL_CHANGED_COMPLETE)) { if (!fDisplay.readAndDispatch ()) { Thread.sleep(0); diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java index 18d4cb4e0..6193f56ae 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -31,14 +31,14 @@ import org.eclipse.test.performance.PerformanceMeter; import org.eclipse.ui.PlatformUI; /** - * Tests to measure the performance of the viewer updates. + * Tests to measure the performance of the viewer updates. */ abstract public class PerformanceTests extends TestCase implements ITestModelUpdatesListenerConstants { Display fDisplay; Shell fShell; ITreeModelViewer fViewer; TestModelUpdatesListener fListener; - + public PerformanceTests(String name) { super(name); } @@ -55,14 +55,14 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd fVirtualItemValidator = new VisibleVirtualItemValidator(0, Integer.MAX_VALUE); fViewer = createViewer(fDisplay, fShell); - + fListener = new TestModelUpdatesListener(fViewer, false, false); fShell.open(); } abstract protected IInternalTreeModelViewer createViewer(Display display, Shell shell); - + /** * @throws java.lang.Exception */ @@ -70,7 +70,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd protected void tearDown() throws Exception { fListener.dispose(); fViewer.getPresentationContext().dispose(); - + // Close the shell and exit. fShell.close(); while (!fShell.isDisposed()) { @@ -79,7 +79,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd } } } - + @Override protected void runTest() throws Throwable { try { @@ -91,22 +91,22 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd /** * Depth (size) of the test model to be used in the tests. This number allows - * the jface based tests to use a small enough model to fit on the screen, and + * the jface based tests to use a small enough model to fit on the screen, and * for the virtual viewer to exercise the content provider to a greater extent. */ abstract protected int getTestModelDepth(); - + protected VisibleVirtualItemValidator fVirtualItemValidator; - + public void testRefreshStruct() throws InterruptedException { TestModel model = new TestModel(); model.setRoot(new TestElement(model, "root", new TestElement[0])); //$NON-NLS-1$ model.setElementChildren(TreePath.EMPTY, TestModel.makeMultiLevelElements(model, getTestModelDepth(), "model.")); //$NON-NLS-1$ - + fViewer.setAutoExpandLevel(-1); // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); + fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); // Set the input into the view and update the view. fViewer.setInput(model.getRootElement()); @@ -123,10 +123,10 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd for (int i = 0; i < 10; i++) { // Update the model model.setAllAppendix(" - pass " + i); //$NON-NLS-1$ - + TestElement element = model.getRootElement(); fListener.reset(TreePath.EMPTY, element, -1, false, false); - + meter.start(); model.postDelta(new ModelDelta(element, IModelDelta.CONTENT)); while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) { @@ -137,7 +137,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd meter.stop(); System.gc(); } - + meter.commit(); perf.assertPerformance(meter); } finally { @@ -149,12 +149,12 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd TestModel model = new TestModel(); model.setRoot(new TestElement(model, "root", new TestElement[0])); //$NON-NLS-1$ model.setElementChildren(TreePath.EMPTY, TestModel.makeMultiLevelElements2(model, new int[] { 2, 3000, 1 }, "model.")); //$NON-NLS-1$ - + fViewer.setAutoExpandLevel(2); // Create the listener - //fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); + //fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); fListener.reset(); - + // Set the input into the view and update the view. fViewer.setInput(model.getRootElement()); while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) @@ -165,20 +165,20 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd //model.validateData(fViewer, TreePath.EMPTY); } } - + fVirtualItemValidator.setVisibleRange(0, 50); - + Performance perf = Performance.getDefault(); PerformanceMeter meter = perf.createPerformanceMeter(perf.getDefaultScenarioId(this)); try { for (int i = 0; i < 100; i++) { // Update the model model.setAllAppendix(" - pass " + i); //$NON-NLS-1$ - + TestElement element = model.getRootElement(); //fListener.reset(TreePath.EMPTY, element, -1, false, false); fListener.reset(); - + meter.start(); model.postDelta(new ModelDelta(element, IModelDelta.CONTENT)); while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) { @@ -195,7 +195,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd meter.stop(); System.gc(); } - + meter.commit(); perf.assertPerformance(meter); } finally { @@ -208,11 +208,11 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd TestModel model = new TestModel(); model.setRoot(new TestElement(model, "root", new TestElement[0])); //$NON-NLS-1$ model.setElementChildren(TreePath.EMPTY, TestModel.makeMultiLevelElements(model, getTestModelDepth(), "model.")); //$NON-NLS-1$ - + fViewer.setAutoExpandLevel(-1); // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); + fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); // Set the input into the view and update the view. fViewer.setInput(model.getRootElement()); @@ -229,10 +229,10 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd for (int i = 0; i < 100; i++) { // Update the model model.setElementChildren(TreePath.EMPTY, TestModel.makeMultiLevelElements(model, getTestModelDepth(), "pass " + i + ".")); //$NON-NLS-1$ //$NON-NLS-2$ - + TestElement element = model.getRootElement(); fListener.reset(TreePath.EMPTY, element, -1, false, false); - + meter.start(); model.postDelta(new ModelDelta(element, IModelDelta.CONTENT)); while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) { @@ -243,7 +243,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd meter.stop(); System.gc(); } - + meter.commit(); perf.assertPerformance(meter); } finally { @@ -251,17 +251,17 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd } } - + public void testRefreshList() throws InterruptedException { TestModel model = new TestModel(); model.setRoot(new TestElement(model, "root", new TestElement[0])); //$NON-NLS-1$ int numElements = (int)Math.pow(2, getTestModelDepth()); model.setElementChildren(TreePath.EMPTY, TestModel.makeSingleLevelModelElements(model, numElements, "model.")); //$NON-NLS-1$ - + fViewer.setAutoExpandLevel(-1); // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); + fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); // Set the input into the view and update the view. fViewer.setInput(model.getRootElement()); @@ -278,10 +278,10 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd for (int i = 0; i < 100; i++) { // Update the model model.setAllAppendix(" - pass " + i); //$NON-NLS-1$ - + TestElement element = model.getRootElement(); fListener.reset(TreePath.EMPTY, element, -1, false, false); - + meter.start(); model.postDelta(new ModelDelta(element, IModelDelta.CONTENT)); while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) { @@ -292,7 +292,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd meter.stop(); System.gc(); } - + meter.commit(); perf.assertPerformance(meter); } finally { @@ -306,9 +306,9 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd // expand all elements fViewer.setAutoExpandLevel(-1); - + // Create the listener, only check the first level - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); + fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); // Set the input into the view and update the view. fViewer.setInput(model.getRootElement()); @@ -321,7 +321,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd // Set a selection in view fViewer.setSelection(new TreeSelection(model.findElement("3.2.3"))); //$NON-NLS-1$ - + // Turn off the auto-expand now since we want to text the auto-expand logic fViewer.setAutoExpandLevel(-1); @@ -334,7 +334,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd // Set the viewer input to null. This will trigger the view to save the viewer state. fListener.reset(true, false); - + meter.start(); fViewer.setInput(null); while (!fListener.isFinished(STATE_SAVE_COMPLETE)) { @@ -342,9 +342,9 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd Thread.sleep(0); } } - + // Set the viewer input back to the model. When view updates are complete - // the viewer + // the viewer // Note: disable redundant updates because the reveal delta triggers one. fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, false, false); // TODO: add state updates somehow? @@ -357,7 +357,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd meter.stop(); System.gc(); } - + meter.commit(); perf.assertPerformance(meter); } finally { @@ -371,11 +371,11 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd model.setRoot(new TestElement(model, "root", new TestElement[0])); //$NON-NLS-1$ int numElements = (int)Math.pow(2, getTestModelDepth()); model.setElementChildren(TreePath.EMPTY, TestModel.makeSingleLevelModelElements(model, numElements, "model.")); //$NON-NLS-1$ - + fViewer.setAutoExpandLevel(-1); // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); + fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); fViewer.addFilter(new ViewerFilter() { @Override @@ -392,7 +392,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd return true; } }); - + // Set the input into the view and update the view. fViewer.setInput(model.getRootElement()); while (!fListener.isFinished()) { @@ -408,10 +408,10 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd for (int i = 0; i < 100; i++) { // Update the model model.setAllAppendix(" - pass " + i); //$NON-NLS-1$ - + TestElement element = model.getRootElement(); fListener.reset(TreePath.EMPTY, element, -1, false, false); - + meter.start(); model.postDelta(new ModelDelta(element, IModelDelta.CONTENT)); while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) { @@ -422,12 +422,12 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd meter.stop(); System.gc(); } - + meter.commit(); perf.assertPerformance(meter); } finally { meter.dispose(); } } - + } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java index 0409c367e..d89a54f03 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM - moved to debug platform tests from JDT @@ -20,7 +20,7 @@ import org.eclipse.ui.XMLMemento; /** * Test the serialization of presentation context properties. - * + * * @since 3.4 */ public class PresentationContextTests extends TestCase { @@ -28,7 +28,7 @@ public class PresentationContextTests extends TestCase { public PresentationContextTests(String name) { super(name); } - + /** * Tests saving and restoring presentation context properties. */ @@ -41,7 +41,7 @@ public class PresentationContextTests extends TestCase { final XMLMemento memento = XMLMemento.createWriteRoot("TEST"); //$NON-NLS-1$ context.saveProperites(memento); - + context = new PresentationContext("test"); //$NON-NLS-1$ context.initProperties(memento); assertEquals("Wrong value restored", "string", context.getProperty("string")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -50,5 +50,5 @@ public class PresentationContextTests extends TestCase { assertEquals("Wrong value restored", ResourcesPlugin.getWorkspace().getRoot(), context.getProperty("persistable")); //$NON-NLS-1$ //$NON-NLS-2$ context.dispose(); } - + } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreePathWrapper.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreePathWrapper.java index 7adb27dbd..df8d04fe8 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreePathWrapper.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreePathWrapper.java @@ -15,9 +15,9 @@ import org.eclipse.jface.viewers.TreePath; import org.junit.Assert; /** - * Utility for comparing TreePath objects in unit tests. This wrapper prints the tree + * Utility for comparing TreePath objects in unit tests. This wrapper prints the tree * paths in exception showing contexts of the paths. - * + * * @since 3.7 */ public class TreePathWrapper { @@ -26,26 +26,26 @@ public class TreePathWrapper { public TreePathWrapper(TreePath path) { fPath = path; } - + @Override public int hashCode() { return fPath.hashCode(); } - + @Override public boolean equals(Object obj) { return obj instanceof TreePathWrapper && - fPath.equals( ((TreePathWrapper)obj).fPath ); + fPath.equals( ((TreePathWrapper)obj).fPath ); } - + @Override public String toString() { if (fPath.getSegmentCount() == 0) { return "TreePath:EMPTY"; //$NON-NLS-1$ } - + StringBuffer buf = new StringBuffer("TreePath:["); //$NON-NLS-1$ - + for (int i = 0; i < fPath.getSegmentCount(); i++) { if (i != 0) { buf.append(", "); //$NON-NLS-1$ @@ -55,14 +55,14 @@ public class TreePathWrapper { buf.append(']'); return buf.toString(); } - + /** - * Asserts that the two given tree paths are the same. In case of failure, the + * Asserts that the two given tree paths are the same. In case of failure, the * generated exception will contain a printout of the tree paths' contents. */ public static void assertEqual(TreePath expected, TreePath actual) { Assert.assertEquals( - expected != null ? new TreePathWrapper(expected) : null, + expected != null ? new TreePathWrapper(expected) : null, actual != null ? new TreePathWrapper(actual) : null); - } + } } \ No newline at end of file diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerContentTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerContentTests.java index 266980c6c..726aaceb5 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerContentTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerContentTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class VirtualViewerContentTests extends ContentTests { - + public VirtualViewerContentTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerDeltaTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerDeltaTests.java index fdc0a1701..a2287dbc2 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerDeltaTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerDeltaTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class VirtualViewerDeltaTests extends DeltaTests { - + public VirtualViewerDeltaTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerFilterTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerFilterTests.java index 1a5c67f80..e181fcea6 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerFilterTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerFilterTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.8 */ public class VirtualViewerFilterTests extends FilterTests { - + public VirtualViewerFilterTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java index e137ae77e..a695acf5d 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -26,7 +26,7 @@ import org.eclipse.ui.PlatformUI; * Tests which verify the operation of the virtual viewer in the lazy mode. * Note: the virtual viewer doesn't support lazy mode yet, so this class * is really just a big place holder. - * + * * @since 3.6 */ public class VirtualViewerLazyModeTests extends TestCase { @@ -34,7 +34,7 @@ public class VirtualViewerLazyModeTests extends TestCase { Shell fShell; ITreeModelViewer fViewer; TestModelUpdatesListener fListener; - + public VirtualViewerLazyModeTests(String name) { super(name); } @@ -50,7 +50,7 @@ public class VirtualViewerLazyModeTests extends TestCase { fShell.setLayout(new FillLayout()); fViewer = createViewer(fDisplay, fShell); - + fListener = new TestModelUpdatesListener(fViewer, false, false); fShell.open (); @@ -64,7 +64,7 @@ public class VirtualViewerLazyModeTests extends TestCase { protected ITreeModelViewer createViewer(Display display, Shell shell) { return new VirtualTreeModelViewer(display, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$ } - + /** * @throws java.lang.Exception */ @@ -72,7 +72,7 @@ public class VirtualViewerLazyModeTests extends TestCase { protected void tearDown() throws Exception { fListener.dispose(); fViewer.getPresentationContext().dispose(); - + // Close the shell and exit. fShell.close(); while (!fShell.isDisposed()) { diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPerformanceTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPerformanceTests.java index d74055478..7bdf09f99 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPerformanceTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPerformanceTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class VirtualViewerPerformanceTests extends PerformanceTests { - + public VirtualViewerPerformanceTests(String name) { super(name); } @@ -31,7 +31,7 @@ public class VirtualViewerPerformanceTests extends PerformanceTests { protected IInternalTreeModelViewer createViewer(Display display, Shell shell) { return new VirtualTreeModelViewer(fDisplay, SWT.VIRTUAL, new PresentationContext("TestViewer"), fVirtualItemValidator); //$NON-NLS-1$ } - + @Override protected int getTestModelDepth() { return 7; diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPopupTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPopupTests.java index 34988f138..cf0ef1c73 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPopupTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPopupTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class VirtualViewerPopupTests extends PopupTests { - + public VirtualViewerPopupTests(String name) { super(name); } @@ -30,6 +30,6 @@ public class VirtualViewerPopupTests extends PopupTests { protected ITreeModelViewer createViewer(Display display, Shell shell, int style) { return new VirtualTreeModelViewer(fDisplay, style, new PresentationContext("TestViewer")); //$NON-NLS-1$ } - - + + } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerSelectionTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerSelectionTests.java index 877791aa1..f2585dad8 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerSelectionTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerSelectionTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class VirtualViewerSelectionTests extends SelectionTests { - + public VirtualViewerSelectionTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerStateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerStateTests.java index 684dc1bcc..253027377 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerStateTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerStateTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class VirtualViewerStateTests extends StateTests { - + public VirtualViewerStateTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerUpdateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerUpdateTests.java index a300d0556..e0b2029fe 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerUpdateTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerUpdateTests.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation * IBM Corporation - bug fixing @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; * @since 3.6 */ public class VirtualViewerUpdateTests extends UpdateTests { - + public VirtualViewerUpdateTests(String name) { super(name); } diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java index 86c5461e8..74de44126 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Wind River Systems - initial API and implementation *******************************************************************************/ @@ -15,14 +15,14 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualItem; import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTree; /** - * Item validator for the virtual viewer which specifies that the given + * Item validator for the virtual viewer which specifies that the given * range of items should be treated as visible. */ public class VisibleVirtualItemValidator implements IVirtualItemValidator { private int fStart = 0; private int fEnd = 0; - + public VisibleVirtualItemValidator(int startPosition, int length) { setVisibleRange(startPosition, length); } @@ -31,15 +31,15 @@ public class VisibleVirtualItemValidator implements IVirtualItemValidator { fStart = startPosition; fEnd = startPosition + length; } - + public int getStartPosition() { return fStart; } - + public int getLength() { return fEnd - fStart; } - + @Override public boolean isItemVisible(VirtualItem item) { int position = 0; @@ -65,11 +65,11 @@ public class VisibleVirtualItemValidator implements IVirtualItemValidator { } return position; } - + private boolean isSelected(VirtualItem item) { VirtualItem[] selection = getSelection(item); for (int i = 0; i < selection.length; i++) { - VirtualItem selectionItem = selection[i]; + VirtualItem selectionItem = selection[i]; while (selectionItem != null) { if (item.equals(selectionItem)) { return true; @@ -79,7 +79,7 @@ public class VisibleVirtualItemValidator implements IVirtualItemValidator { } return false; } - + private VirtualItem[] getSelection(VirtualItem item) { VirtualTree tree = getTree(item); if (tree != null) { @@ -87,7 +87,7 @@ public class VisibleVirtualItemValidator implements IVirtualItemValidator { } return new VirtualItem[0]; } - + private VirtualTree getTree(VirtualItem item) { while (item != null && !(item instanceof VirtualTree)) { item = item.getParent(); -- cgit v1.2.3