Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java12
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java30
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java44
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java30
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java24
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java208
7 files changed, 177 insertions, 177 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java
index 4eb52e6f7..98b884064 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - clean-up
*******************************************************************************/
package org.eclipe.debug.tests.viewer.model;
@@ -14,7 +15,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipe.debug.tests.viewer.model.TestModel.TestElement;
@@ -108,7 +108,7 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
model.validateData(fViewer, TreePath.EMPTY);
- Assert.assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 6) );
+ assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 6) );
}
public void testSimpleMultiLevel() throws InterruptedException {
@@ -125,7 +125,7 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
model.validateData(fViewer, TreePath.EMPTY);
- Assert.assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 3) );
+ assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 3) );
}
/**
@@ -214,7 +214,7 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
// Then complete the first set.
for (int i = 0; i < firstUpdates.size(); i++) {
ILabelUpdate capturedUpdate = (ILabelUpdate)firstUpdates.get(i);
- Assert.assertTrue(capturedUpdate.isCanceled());
+ assertTrue(capturedUpdate.isCanceled());
capturedUpdate.done();
}
@@ -269,7 +269,7 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
// Then complete the first set.
for (int i = 0; i < firstUpdates.size(); i++) {
ILabelUpdate capturedUpdate = (ILabelUpdate)firstUpdates.get(i);
- Assert.assertTrue(capturedUpdate.isCanceled());
+ assertTrue(capturedUpdate.isCanceled());
capturedUpdate.done();
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java
index e53f17bdc..86b86ab44 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,13 +7,13 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - clean-up
*******************************************************************************/
package org.eclipe.debug.tests.viewer.model;
import java.util.Arrays;
import java.util.List;
-import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipe.debug.tests.viewer.model.TestModel.TestElement;
@@ -217,7 +217,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
model.validateData(fViewer, TreePath.EMPTY);
- Assert.assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 6) );
+ assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 6) );
}
@@ -566,9 +566,9 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
// Validate the expansion state BEFORE posting the delta.
IInternalTreeModelViewer contentProviderViewer = (IInternalTreeModelViewer)fViewer;
- Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3));
- Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3_2));
- Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3_2_2));
+ assertFalse(contentProviderViewer.getExpandedState(path_root_3));
+ assertFalse(contentProviderViewer.getExpandedState(path_root_3_2));
+ assertFalse(contentProviderViewer.getExpandedState(path_root_3_2_2));
model.postDelta(deltaRoot);
while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE))
@@ -576,17 +576,17 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
model.validateData(fViewer, TreePath.EMPTY, true);
// Validate the expansion state AFTER posting the delta.
- Assert.assertTrue(contentProviderViewer.getExpandedState(path_root_3));
- Assert.assertTrue(contentProviderViewer.getExpandedState(path_root_3_2));
- Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3_2_2));
+ assertTrue(contentProviderViewer.getExpandedState(path_root_3));
+ assertTrue(contentProviderViewer.getExpandedState(path_root_3_2));
+ assertFalse(contentProviderViewer.getExpandedState(path_root_3_2_2));
// Verify selection
ISelection selection = fViewer.getSelection();
if (selection instanceof ITreeSelection) {
List selectionPathsList = Arrays.asList( ((ITreeSelection)selection).getPaths() );
- Assert.assertTrue(selectionPathsList.contains(path_root_3_2_2));
+ assertTrue(selectionPathsList.contains(path_root_3_2_2));
} else {
- Assert.fail("Not a tree selection");
+ fail("Not a tree selection");
}
}
@@ -621,7 +621,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
// Validate the expansion state BEFORE posting the delta.
IInternalTreeModelViewer contentProviderViewer = (IInternalTreeModelViewer)fViewer;
- Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3));
+ assertFalse(contentProviderViewer.getExpandedState(path_root_3));
model.postDelta(deltaRoot);
while (true) {
@@ -635,15 +635,15 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
model.validateData(fViewer, TreePath.EMPTY, true);
// Validate the expansion state AFTER posting the delta.
- Assert.assertTrue(contentProviderViewer.getExpandedState(path_root_3));
+ assertTrue(contentProviderViewer.getExpandedState(path_root_3));
// Verify selection
ISelection selection = fViewer.getSelection();
if (selection instanceof ITreeSelection) {
List selectionPathsList = Arrays.asList( ((ITreeSelection)selection).getPaths() );
- Assert.assertTrue(selectionPathsList.contains(path_root_3));
+ assertTrue(selectionPathsList.contains(path_root_3));
} else {
- Assert.fail("Not a tree selection");
+ fail("Not a tree selection");
}
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java
index 46eb8e7e8..7c6d8d45a 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java
@@ -1,18 +1,18 @@
/*******************************************************************************
+ * Copyright (c) 2009, 2013 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* 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
*
- * Copyright (c) 2009, 2011 Wind River Systems and others.
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - clean-up
*******************************************************************************/
package org.eclipe.debug.tests.viewer.model;
import java.util.regex.Pattern;
-import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipe.debug.tests.viewer.model.TestModel.TestElement;
@@ -261,7 +261,7 @@ 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);
- Assert.assertTrue(replacedElementPaths.length != 0);
+ assertTrue(replacedElementPaths.length != 0);
}
@@ -308,7 +308,7 @@ 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);
- Assert.assertTrue(replacedElementPaths.length != 0);
+ assertTrue(replacedElementPaths.length != 0);
}
public void testRefreshToUnfilterElements() throws InterruptedException {
@@ -375,7 +375,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
TreeSelection originalSelection = new TreeSelection(
new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findElement("6") });
fViewer.setSelection(originalSelection);
- Assert.assertTrue( StateTests.areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue( StateTests.areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Set a filter to remove element "1"
ViewerFilter[] filters = new ViewerFilter[] { new TestViewerFilter("^1$") };
@@ -392,18 +392,18 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true, filters);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( StateTests.areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( StateTests.areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Note: in past it was observed sub-optimal coalescing in this test due
// to scattered update requests from viewer.
- Assert.assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 6) );
+ assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 6) );
// Clear the filter, to re-add the element
filters = new ViewerFilter[0];
@@ -418,14 +418,14 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true, filters);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( StateTests.areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( StateTests.areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java
index 51597c8a8..f1c57adc3 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Wind River Systems and others.
+ * Copyright (c) 2010, 2013 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,10 +8,10 @@
* Contributors:
* Wind River Systems - initial API and implementation
* Dorin Ciuca - Top index fix (Bug 324100)
+ * IBM Corporation - clean-up
*******************************************************************************/
package org.eclipe.debug.tests.viewer.model;
-import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipe.debug.tests.viewer.model.TestModel.TestElement;
@@ -129,9 +129,9 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
getCTargetViewer().reveal(TreePath.EMPTY, indexRevealElem);
while(fDisplay.readAndDispatch()) {}
final TreePath originalTopPath = getCTargetViewer().getTopElementPath();
- Assert.assertNotNull("Top item should not be null!", originalTopPath);
+ assertNotNull("Top item should not be null!", originalTopPath);
// Bug 116105: On a Mac the reveal call is not reliable. Use the viewer returned path instead.
- // Assert.assertEquals(elements[indexRevealElem], originalTopPath.getLastSegment());
+ // assertEquals(elements[indexRevealElem], originalTopPath.getLastSegment());
// Extract the original state from viewer
ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
@@ -153,7 +153,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
while (fDisplay.readAndDispatch ()) {}
// check if REVEAL was restored OK
final TreePath topPath = getCTargetViewer().getTopElementPath();
- Assert.assertNotNull("Top item should not be null!", topPath);
+ assertNotNull("Top item should not be null!", topPath);
TreePathWrapper.assertEqual(originalTopPath, topPath);
}
@@ -215,7 +215,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
// Validate that the first node is expanded
- Assert.assertTrue(getCTargetViewer().getExpandedState(firstElemPath) == true);
+ assertTrue(getCTargetViewer().getExpandedState(firstElemPath) == true);
// Stop forcing view updates.
autopopulateAgent.dispose();
@@ -224,9 +224,9 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
getCTargetViewer().reveal(TreePath.EMPTY, 1);
while(fDisplay.readAndDispatch()) {}
final TreePath originalTopPath = getCTargetViewer().getTopElementPath();
- Assert.assertNotNull("Top item should not be null!", originalTopPath);
+ assertNotNull("Top item should not be null!", originalTopPath);
// Bug 116105: On a Mac the reveal call is not reliable. Use the viewer returned path instead.
- //Assert.assertEquals(elements[1], originalTopPath.getLastSegment());
+ //assertEquals(elements[1], originalTopPath.getLastSegment());
// Extract the original state from viewer
ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
@@ -246,7 +246,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
while (fDisplay.readAndDispatch ()) {}
// check if REVEAL was restored OK
final TreePath topPath = getCTargetViewer().getTopElementPath();
- Assert.assertNotNull("Top item should not be null!", topPath);
+ assertNotNull("Top item should not be null!", topPath);
TreePathWrapper.assertEqual(originalTopPath, topPath);
}
@@ -296,7 +296,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
TreePath lastElemePath = model.findElement(lastElem.getLabel());
// Validate that the last node is expanded
- Assert.assertTrue(getCTargetViewer().getExpandedState(lastElemePath) == true);
+ assertTrue(getCTargetViewer().getExpandedState(lastElemePath) == true);
// Stop forcing view updates.
fViewer.setAutoExpandLevel(0);
@@ -306,7 +306,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
getCTargetViewer().reveal(TreePath.EMPTY, indexLastElem-1);
while(fDisplay.readAndDispatch()) {}
final TreePath originalTopPath = getCTargetViewer().getTopElementPath();
- Assert.assertNotNull("Top item should not be null!", originalTopPath);
+ assertNotNull("Top item should not be null!", originalTopPath);
// Extract the original state from viewer
ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
@@ -328,7 +328,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
while (fDisplay.readAndDispatch ()) {}
// check if REVEAL was restored OK
final TreePath topPath = getCTargetViewer().getTopElementPath();
- Assert.assertNotNull("Top item should not be null!", topPath);
+ assertNotNull("Top item should not be null!", topPath);
TreePathWrapper.assertEqual(originalTopPath, topPath);
}
@@ -461,7 +461,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
// check if REVEAL was triggered by the delta and not by the
// state restore operation
TreePath topPath = getCTargetViewer().getTopElementPath();
- Assert.assertNotNull("Top item should not be null!", topPath);
+ assertNotNull("Top item should not be null!", topPath);
TreePathWrapper.assertEqual(pathToBeRevealed, topPath);
}
@@ -496,7 +496,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
getCTargetViewer().reveal(model.findElement("3.6.3.16.16.16.16.16"), 1);
while(fDisplay.readAndDispatch()) {}
final TreePath originalTopPath = getCTargetViewer().getTopElementPath();
- Assert.assertNotNull("Top item should not be null!", originalTopPath);
+ assertNotNull("Top item should not be null!", originalTopPath);
// Extract the original state from viewer
ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
@@ -517,7 +517,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
while (fDisplay.readAndDispatch ()) {}
// check if REVEAL was restored OK
final TreePath topPath = getCTargetViewer().getTopElementPath();
- Assert.assertNotNull("Top item should not be null!", topPath);
+ assertNotNull("Top item should not be null!", topPath);
TreePathWrapper.assertEqual(originalTopPath, topPath);
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java
index 986868bee..c47cb0ad6 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,10 +7,10 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - clean-up
*******************************************************************************/
package org.eclipe.debug.tests.viewer.model;
-import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipe.debug.tests.viewer.model.TestModel.TestElement;
@@ -194,7 +194,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis
if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
- Assert.assertEquals(((IStructuredSelection)fViewer.getSelection()).getFirstElement(), _1_0_newElement);
+ assertEquals(((IStructuredSelection)fViewer.getSelection()).getFirstElement(), _1_0_newElement);
}
/**
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java
index e760cd39c..e50a3fa23 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - clean-up
*******************************************************************************/
package org.eclipe.debug.tests.viewer.model;
@@ -15,7 +16,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipe.debug.tests.viewer.model.TestModel.TestElement;
@@ -148,7 +148,7 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
// Validate the expansion state BEFORE posting the delta.
IInternalTreeModelViewer contentProviderViewer = (IInternalTreeModelViewer)fViewer;
- Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3));
+ assertFalse(contentProviderViewer.getExpandedState(path_root_3));
model.postDelta(deltaRoot);
while (true) {
@@ -166,15 +166,15 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
model.validateData(fViewer, TreePath.EMPTY, true);
// Validate the expansion state AFTER posting the delta.
- Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3));
+ assertFalse(contentProviderViewer.getExpandedState(path_root_3));
// Verify selection
ISelection selection = fViewer.getSelection();
if (selection instanceof ITreeSelection) {
List selectionPathsList = Arrays.asList( ((ITreeSelection)selection).getPaths() );
- Assert.assertFalse(selectionPathsList.contains(path_root_3));
+ assertFalse(selectionPathsList.contains(path_root_3));
} else {
- Assert.fail("Not a tree selection");
+ fail("Not a tree selection");
}
}
@@ -222,13 +222,13 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true);
- Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true);
// On windows, getExpandedState() may return true for an element with no children:
- // Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.0 - new")) == false);
- Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.2")) == true);
- Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.3")) == true);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ // assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.0 - new")) == false);
+ assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.2")) == true);
+ assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.3")) == true);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
private boolean areTreeSelectionsEqual(ITreeSelection sel1, ITreeSelection sel2) {
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java
index 9a6ac7950..bef7245cb 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - clean-up
*******************************************************************************/
package org.eclipe.debug.tests.viewer.model;
@@ -14,7 +15,6 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
-import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipe.debug.tests.viewer.model.TestModel.TestElement;
@@ -146,7 +146,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
fViewer.saveElementState(path0, savedDelta, IModelDelta.EXPAND | IModelDelta.SELECT);
if (!deltaMatches(updateDelta, savedDelta) ) {
- Assert.fail("Expected:\n" + updateDelta.toString() + "\nGot:\n" + savedDelta);
+ fail("Expected:\n" + updateDelta.toString() + "\nGot:\n" + savedDelta);
}
}
@@ -282,14 +282,14 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
public void testPreserveExpandedOnInsert() throws InterruptedException {
@@ -326,16 +326,16 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("1.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("1.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
public void testPreserveExpandedOnMultLevelContent() throws InterruptedException {
@@ -359,7 +359,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
TreeSelection originalSelection = new TreeSelection(
new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findElement("6") });
fViewer.setSelection(originalSelection);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Update the model
model.removeElementChild(TreePath.EMPTY, 0);
@@ -380,18 +380,18 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Note: in past it was observed sub-optimal coalescing in this test due
// to scattered update requests from viewer.
- Assert.assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 5) );
+ assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 5) );
}
@@ -437,13 +437,13 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
// On windows, getExpandedState() may return true for an element with no children:
- // Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.0 - new")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.2")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.3")) == true);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ // assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.0 - new")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.2")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.3")) == true);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
public void testPreserveExpandedOnContentStress() throws InterruptedException {
@@ -467,7 +467,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findElement("6") });
TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1"));
fViewer.setSelection(originalSelection);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Run this test ten times as we've seen intermittent failures related
// to timing in it.
@@ -484,14 +484,14 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Update the model again
model.addElementChild(TreePath.EMPTY, null, 0, new TestElement(model, "1", new TestElement[0]));
@@ -505,14 +505,14 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
}
@@ -535,7 +535,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1"));
fViewer.setSelection(originalSelection);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Update the model
model.removeElementChild(TreePath.EMPTY, 0);
@@ -546,14 +546,14 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
while (!fListener.isFinished(CONTENT_SEQUENCE_COMPLETE)) if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
// Validate data
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Update the model again
model.addElementChild(TreePath.EMPTY, null, 0, new TestElement(model, "1", new TestElement[0]));
@@ -564,14 +564,14 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
while (!fListener.isFinished(CONTENT_SEQUENCE_COMPLETE)) if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
// Validate data
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
/**
@@ -621,7 +621,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
// Check to make sure that the state restore didn't change the selection.
- Assert.assertEquals(new TreeSelection(model.findElement("2.1")), fViewer.getSelection());
+ assertEquals(new TreeSelection(model.findElement("2.1")), fViewer.getSelection());
}
public void testPreserveCollapseDeltaAfterContent() throws InterruptedException {
@@ -679,7 +679,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
// Check to make sure that the state restore didn't change the selection.
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == false);
}
public void testPreserveExpandDeltaAfterContent() throws InterruptedException {
@@ -720,7 +720,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
// Check to make sure that the state restore didn't change the selection.
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
}
@@ -768,7 +768,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
fViewer.saveElementState(TreePath.EMPTY, restoredState, IModelDelta.EXPAND | IModelDelta.SELECT);
if (!deltaMatches(originalState, restoredState)) {
- Assert.fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState);
+ fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState);
}
}
@@ -819,7 +819,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
fViewer.saveElementState(TreePath.EMPTY, restoredState, IModelDelta.EXPAND | IModelDelta.SELECT);
if (!deltaMatches(originalState, restoredState)) {
- Assert.fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState);
+ fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState);
}
}
@@ -861,7 +861,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
fViewer.saveElementState(TreePath.EMPTY, restoredState, IModelDelta.EXPAND | IModelDelta.SELECT);
if (!deltaMatches(originalState, restoredState)) {
- Assert.fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState);
+ fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState);
}
}
@@ -906,7 +906,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
fViewer.saveElementState(TreePath.EMPTY, restoredState, IModelDelta.EXPAND | IModelDelta.SELECT);
if (!deltaMatches(originalState, restoredState)) {
- Assert.fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState);
+ fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState);
}
}
@@ -929,7 +929,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1"));
fViewer.setSelection(originalSelection);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Extract the original state from viewer
ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
@@ -951,16 +951,16 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
while (!fListener.isFinished(CONTENT_SEQUENCE_COMPLETE)) if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
// Validate data (only select visible elements).
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("1.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("1.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
/**
@@ -986,7 +986,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1"));
fViewer.setSelection(originalSelection);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
// Extract the original state from viewer
ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
@@ -1016,16 +1016,16 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
while (!fListener.isFinished(CONTENT_SEQUENCE_COMPLETE| STATE_RESTORE_COMPLETE)) if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
// Validate data
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("1.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
- Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("1.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("4")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false);
+ assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
public void testPreserveCollapseAndSelectDeltaAfterSaveAndRestore() throws InterruptedException {
@@ -1092,9 +1092,9 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
// Check to make sure that the state restore didn't change the selection.
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
- Assert.assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == false);
- Assert.assertEquals(new TreeSelection(model.findElement("1")), fViewer.getSelection());
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false);
+ assertTrue(getInternalViewer().getExpandedState(model.findElement("3")) == false);
+ assertEquals(new TreeSelection(model.findElement("1")), fViewer.getSelection());
}
/**
@@ -1127,7 +1127,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
while (!fListener.isFinished(STATE_RESTORE_STARTED)) {
if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
}
- Assert.assertTrue("RESTORE started before SAVE to complete", fListener.isFinished(STATE_SAVE_COMPLETE));
+ assertTrue("RESTORE started before SAVE to complete", fListener.isFinished(STATE_SAVE_COMPLETE));
}
/**

Back to the top