diff options
author | Matthew Hall | 2008-08-28 16:23:21 +0000 |
---|---|---|
committer | Matthew Hall | 2008-08-28 16:23:21 +0000 |
commit | 2b7e52c40369d147bfd02db492e37858c70f101a (patch) | |
tree | 6f75f4e5bbe2c261224a4cf0c65ac6a7ad96f4f3 | |
parent | e9439c686d31106ceb68d564b9f8b42dba51fece (diff) | |
download | org.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 |
FIXED - bug 245183: [Databinding] ObservableList could do a == check before delegating to the wrapped listv20100304_34x_2v20100304_34xv20090423_34xv20081027_34xr342_v20110506-1600r342_v20110503-1700r342_v20110503-1300r342_v20110502-1100r342_v20091113-1600r342_v20090625R3_4_2M20101117-1000M20101110-1100M20100415-2030M20100414-0930M20100305-1230M20100304-1200M20090916-1400M20090831-1500M20090204-0800M20090127-1700M20090114-0800M20090107-0800M20081212-0800M20081203-0800M20081112-0800M20081022-0800M20081015-0800M20080910-0800M20080903-2000
https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183
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)); + } } |