Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer')
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java60
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java66
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java30
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java122
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java34
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java16
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerCheckTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerContentTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerDeltaTests.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerFilterTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerLazyTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPerformanceTests.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPopupTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerSelectionTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerStateTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerUpdateTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java60
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java96
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreePathWrapper.java24
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerContentTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerDeltaTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerFilterTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java12
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPerformanceTests.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPopupTests.java8
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerSelectionTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerStateTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerUpdateTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java20
30 files changed, 316 insertions, 316 deletions
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. <br>
+ * 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. <br>
* 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();

Back to the top