Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Hall2008-08-28 16:23:21 +0000
committerMatthew Hall2008-08-28 16:23:21 +0000
commit2b7e52c40369d147bfd02db492e37858c70f101a (patch)
tree6f75f4e5bbe2c261224a4cf0c65ac6a7ad96f4f3
parente9439c686d31106ceb68d564b9f8b42dba51fece (diff)
downloadorg.eclipse.e4.databinding-20100304_34x_2.tar.gz
org.eclipse.e4.databinding-20100304_34x_2.tar.xz
org.eclipse.e4.databinding-20100304_34x_2.zip
https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableListDecoratorTest.java15
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableMapDecoratorTest.java14
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableSetDecoratorTest.java14
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableValueDecoratorTest.java14
4 files changed, 57 insertions, 0 deletions
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableListDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableListDecoratorTest.java
index 7d4ff061..c923d281 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableListDecoratorTest.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableListDecoratorTest.java
@@ -80,6 +80,21 @@ public class BeanObservableListDecoratorTest extends AbstractDefaultRealmTestCas
assertTrue(decorator.equals(decorator));
}
+ public void testEquals_SameClassDelegatesToDelegateObservables() {
+ IObservableList delegate = new WritableList() {
+ public boolean equals(Object o) {
+ return o == this;
+ }
+ };
+ Bean bean = new Bean();
+ decorator = new BeanObservableListDecorator(delegate, new WritableValue(
+ bean, Object.class), propertyDescriptor);
+ BeanObservableListDecorator otherDecorator = new BeanObservableListDecorator(
+ delegate, new WritableValue(bean, Object.class),
+ propertyDescriptor);
+ assertTrue(decorator.equals(otherDecorator));
+ }
+
public static Test suite() {
TestSuite suite = new TestSuite(BeanObservableListDecoratorTest.class.getName());
suite.addTestSuite(BeanObservableListDecoratorTest.class);
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableMapDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableMapDecoratorTest.java
index a8461075..514c29a3 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableMapDecoratorTest.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableMapDecoratorTest.java
@@ -70,4 +70,18 @@ public class BeanObservableMapDecoratorTest extends
new Bean(), Object.class), propertyDescriptor);
assertTrue(decorator.equals(decorator));
}
+
+ public void testEquals_SameClassDelegatesToDelegateObservables() {
+ IObservableMap delegate = new WritableMap() {
+ public boolean equals(Object o) {
+ return o == this;
+ }
+ };
+ Bean bean = new Bean();
+ decorator = new BeanObservableMapDecorator(delegate, bean,
+ propertyDescriptor);
+ BeanObservableMapDecorator otherDecorator = new BeanObservableMapDecorator(
+ delegate, bean, propertyDescriptor);
+ assertTrue(decorator.equals(otherDecorator));
+ }
}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableSetDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableSetDecoratorTest.java
index 72d02642..924b1395 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableSetDecoratorTest.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableSetDecoratorTest.java
@@ -72,4 +72,18 @@ public class BeanObservableSetDecoratorTest extends AbstractDefaultRealmTestCase
new Bean(), Object.class), propertyDescriptor);
assertTrue(decorator.equals(decorator));
}
+
+ public void testEquals_SameClassDelegatesToDelegateObservables() {
+ IObservableSet delegate = new WritableSet() {
+ public boolean equals(Object o) {
+ return o == this;
+ }
+ };
+ Bean bean = new Bean();
+ decorator = new BeanObservableSetDecorator(delegate, bean,
+ propertyDescriptor);
+ BeanObservableSetDecorator otherDecorator = new BeanObservableSetDecorator(
+ delegate, bean, propertyDescriptor);
+ assertTrue(decorator.equals(otherDecorator));
+ }
}
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableValueDecoratorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableValueDecoratorTest.java
index e1969da0..718688d0 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableValueDecoratorTest.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/beans/BeanObservableValueDecoratorTest.java
@@ -72,4 +72,18 @@ public class BeanObservableValueDecoratorTest extends AbstractDefaultRealmTestCa
decorator = new BeanObservableValueDecorator(delegate, new WritableValue(bean, Object.class), propertyDescriptor);
assertTrue(decorator.equals(decorator));
}
+
+ public void testEquals_SameClassDelegatesToDelegateObservables() {
+ IObservableValue delegate = new WritableValue() {
+ public boolean equals(Object o) {
+ return o == this;
+ }
+ };
+ decorator = new BeanObservableValueDecorator(delegate,
+ new WritableValue(bean, Object.class), propertyDescriptor);
+ BeanObservableValueDecorator otherDecorator = new BeanObservableValueDecorator(
+ delegate, new WritableValue(bean, Object.class),
+ propertyDescriptor);
+ assertTrue(decorator.equals(otherDecorator));
+ }
}

Back to the top