Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSergey Prigogin2016-07-19 20:13:25 -0400
committerSergey Prigogin2016-07-19 20:18:45 -0400
commit759decd10c0d9ef46376d9c09b2d58ec7dae29ba (patch)
tree3f936ee498f916da36ccb330490998cbcd8df193 /tests
parentd1a02b5588da41cf909755d308bae2f640998ce3 (diff)
downloadeclipse.platform.team-759decd10c0d9ef46376d9c09b2d58ec7dae29ba.tar.gz
eclipse.platform.team-759decd10c0d9ef46376d9c09b2d58ec7dae29ba.tar.xz
eclipse.platform.team-759decd10c0d9ef46376d9c09b2d58ec7dae29ba.zip
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java19
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java2
2 files changed, 16 insertions, 5 deletions
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java
index c5cf39567..d5716cabc 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/ContentMergeViewerTest.java
@@ -10,17 +10,16 @@
*******************************************************************************/
package org.eclipse.compare.tests;
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.contentmergeviewer.ContentMergeViewer;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.widgets.Composite;
+import org.junit.Assert;
-public class ContentMergeViewerTest extends TestCase {
+import junit.framework.TestCase;
+public class ContentMergeViewerTest extends TestCase {
private MyContentMergeViewer myContentMergeViewer;
/**
* result[0]-event occurred or not; result[1]-new state that was set
@@ -44,52 +43,64 @@ public class ContentMergeViewerTest extends TestCase {
public boolean leftDirty = false;
public boolean rightDirty = false;
+ @Override
protected boolean isLeftDirty() {
return leftDirty;
}
+ @Override
protected boolean isRightDirty() {
return rightDirty;
}
+ @Override
protected void setLeftDirty(boolean dirty) {
super.setLeftDirty(dirty);
}
+ @Override
protected void setRightDirty(boolean dirty) {
super.setRightDirty(dirty);
}
+ @Override
protected void copy(boolean leftToRight) {
// nothing here
}
+ @Override
protected void createControls(Composite composite) {
// nothing here
}
+ @Override
protected byte[] getContents(boolean left) {
return null;
}
+ @Override
protected void handleResizeAncestor(int x, int y, int width, int height) {
// nothing here
}
+ @Override
protected void handleResizeLeftRight(int x, int y, int leftWidth,
int centerWidth, int rightWidth, int height) {
// nothing here
}
+ @Override
protected void updateContent(Object ancestor, Object left, Object right) {
// nothing here
}
}
+ @Override
protected void setUp() throws Exception {
result = new boolean[] { false, false };
myContentMergeViewer = new MyContentMergeViewer();
myContentMergeViewer.addPropertyChangeListener(new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
result[0] = true;
result[1] = ((Boolean) event.getNewValue()).booleanValue();
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java
index f7c068f3a..4369193bf 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/TextMergeViewerTest.java
@@ -246,7 +246,7 @@ public class TextMergeViewerTest extends TestCase {
char leg = left ? MergeViewerContentProvider.LEFT_CONTRIBUTOR : MergeViewerContentProvider.RIGHT_CONTRIBUTOR;
IDocument document = Utilities.getDocument(leg, viewer.getInput(), true, true);
if (document == null) {
- return ((IMergeViewerTestAdapter)viewer.getAdapter(IMergeViewerTestAdapter.class)).getDocument(leg);
+ return viewer.getAdapter(IMergeViewerTestAdapter.class).getDocument(leg);
}
return document;
}

Back to the top