< prev index next >

modules/base/src/test/java/javafx/beans/property/ReadOnlyObjectWrapperTest.java

Print this page
rev 9213 : 8089557: bindBidirection works for ReadOnly*Wrapper incorrectly

*** 152,162 **** // set value once property.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // set same value again property.set(VALUE_1); --- 152,162 ---- // set value once property.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // set same value again property.set(VALUE_1);
*** 169,179 **** // set value twice without reading property.set(VALUE_2); property.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test --- 169,179 ---- // set value twice without reading property.set(VALUE_2); property.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test
*** 182,192 **** // set value once property.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalChangeListener.check(readOnlyProperty, DEFAULT, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); // set same value again property.set(VALUE_1); assertEquals(VALUE_1, property.get()); --- 182,192 ---- // set value once property.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalChangeListener.check(property, DEFAULT, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); // set same value again property.set(VALUE_1); assertEquals(VALUE_1, property.get());
*** 197,207 **** // set value twice without reading property.set(VALUE_2); property.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(2); ! internalChangeListener.check(readOnlyProperty, VALUE_2, VALUE_1, 2); assertEquals(VALUE_1, readOnlyProperty.get()); } @Test public void testPublicEagerSet() { --- 197,207 ---- // set value twice without reading property.set(VALUE_2); property.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(2); ! internalChangeListener.check(property, VALUE_2, VALUE_1, 2); assertEquals(VALUE_1, readOnlyProperty.get()); } @Test public void testPublicEagerSet() {
*** 236,246 **** // set value once property.setValue(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // set same value again property.setValue(VALUE_1); --- 236,246 ---- // set value once property.setValue(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // set same value again property.setValue(VALUE_1);
*** 253,263 **** // set value twice without reading property.setValue(VALUE_2); property.setValue(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test --- 253,263 ---- // set value twice without reading property.setValue(VALUE_2); property.setValue(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test
*** 266,276 **** // set value once property.setValue(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalChangeListener.check(readOnlyProperty, DEFAULT, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); // set same value again property.setValue(VALUE_1); assertEquals(VALUE_1, property.get()); --- 266,276 ---- // set value once property.setValue(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalChangeListener.check(property, DEFAULT, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); // set same value again property.setValue(VALUE_1); assertEquals(VALUE_1, property.get());
*** 281,291 **** // set value twice without reading property.setValue(VALUE_2); property.setValue(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(2); ! internalChangeListener.check(readOnlyProperty, VALUE_2, VALUE_1, 2); assertEquals(VALUE_1, readOnlyProperty.get()); } @Test public void testPublicEagerSetValue() { --- 281,291 ---- // set value twice without reading property.setValue(VALUE_2); property.setValue(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(2); ! internalChangeListener.check(property, VALUE_2, VALUE_1, 2); assertEquals(VALUE_1, readOnlyProperty.get()); } @Test public void testPublicEagerSetValue() {
*** 328,364 **** property.bind(v); assertEquals(VALUE_1, property.get()); assertTrue(property.isBound()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding once v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding twice without reading v.set(VALUE_1); v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding twice to same value v.set(VALUE_1); v.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test --- 328,364 ---- property.bind(v); assertEquals(VALUE_1, property.get()); assertTrue(property.isBound()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding once v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding twice without reading v.set(VALUE_1); v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding twice to same value v.set(VALUE_1); v.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test
*** 368,401 **** property.bind(v); assertEquals(VALUE_1, property.get()); assertTrue(property.isBound()); property.check(1); ! internalChangeListener.check(readOnlyProperty, DEFAULT, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); // change binding once v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalChangeListener.check(readOnlyProperty, VALUE_1, VALUE_2, 1); assertEquals(VALUE_2, readOnlyProperty.get()); // change binding twice without reading v.set(VALUE_1); v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(2); ! internalChangeListener.check(readOnlyProperty, VALUE_1, VALUE_2, 2); assertEquals(VALUE_2, readOnlyProperty.get()); // change binding twice to same value v.set(VALUE_1); v.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(2); ! internalChangeListener.check(readOnlyProperty, VALUE_2, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); } @Test public void testPublicEagerBind_primitive() { --- 368,401 ---- property.bind(v); assertEquals(VALUE_1, property.get()); assertTrue(property.isBound()); property.check(1); ! internalChangeListener.check(property, DEFAULT, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); // change binding once v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalChangeListener.check(property, VALUE_1, VALUE_2, 1); assertEquals(VALUE_2, readOnlyProperty.get()); // change binding twice without reading v.set(VALUE_1); v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(2); ! internalChangeListener.check(property, VALUE_1, VALUE_2, 2); assertEquals(VALUE_2, readOnlyProperty.get()); // change binding twice to same value v.set(VALUE_1); v.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(2); ! internalChangeListener.check(property, VALUE_2, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); } @Test public void testPublicEagerBind_primitive() {
*** 440,476 **** property.bind(v); assertEquals(VALUE_1, property.get()); assertTrue(property.isBound()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding once v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding twice without reading v.set(VALUE_1); v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding twice to same value v.set(VALUE_1); v.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test --- 440,476 ---- property.bind(v); assertEquals(VALUE_1, property.get()); assertTrue(property.isBound()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding once v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding twice without reading v.set(VALUE_1); v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change binding twice to same value v.set(VALUE_1); v.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test
*** 480,513 **** property.bind(v); assertEquals(VALUE_1, property.get()); assertTrue(property.isBound()); property.check(1); ! internalChangeListener.check(readOnlyProperty, DEFAULT, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); // change binding once v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalChangeListener.check(readOnlyProperty, VALUE_1, VALUE_2, 1); assertEquals(VALUE_2, readOnlyProperty.get()); // change binding twice without reading v.set(VALUE_1); v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(2); ! internalChangeListener.check(readOnlyProperty, VALUE_1, VALUE_2, 2); assertEquals(VALUE_2, readOnlyProperty.get()); // change binding twice to same value v.set(VALUE_1); v.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(2); ! internalChangeListener.check(readOnlyProperty, VALUE_2, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); } @Test public void testPublicEagerBind_generic() { --- 480,513 ---- property.bind(v); assertEquals(VALUE_1, property.get()); assertTrue(property.isBound()); property.check(1); ! internalChangeListener.check(property, DEFAULT, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); // change binding once v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalChangeListener.check(property, VALUE_1, VALUE_2, 1); assertEquals(VALUE_2, readOnlyProperty.get()); // change binding twice without reading v.set(VALUE_1); v.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(2); ! internalChangeListener.check(property, VALUE_1, VALUE_2, 2); assertEquals(VALUE_2, readOnlyProperty.get()); // change binding twice to same value v.set(VALUE_1); v.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(2); ! internalChangeListener.check(property, VALUE_2, VALUE_1, 1); assertEquals(VALUE_1, readOnlyProperty.get()); } @Test public void testPublicEagerBind_generic() {
*** 565,583 **** // rebind causes invalidation event property.bind(v2); assertEquals(VALUE_2, property.get()); assertTrue(property.isBound()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change new binding v2.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change old binding v1.set(VALUE_2); --- 565,583 ---- // rebind causes invalidation event property.bind(v2); assertEquals(VALUE_2, property.get()); assertTrue(property.isBound()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change new binding v2.set(VALUE_1); assertEquals(VALUE_1, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_1, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); // change old binding v1.set(VALUE_2);
*** 620,630 **** // set value property.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(readOnlyProperty, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test --- 620,630 ---- // set value property.set(VALUE_2); assertEquals(VALUE_2, property.get()); property.check(1); ! internalInvalidationListener.check(property, 1); assertEquals(VALUE_2, readOnlyProperty.get()); publicInvalidationListener.check(readOnlyProperty, 1); } @Test
*** 638,648 **** // setting the property,checking internal property.set(VALUE_1); property.addListener(internalListener2); internalListener2.reset(); property.set(VALUE_2); ! internalListener2.check(readOnlyProperty, 1); // setting the property, checking public property.set(VALUE_1); readOnlyProperty.addListener(publicListener2); publicListener2.reset(); --- 638,648 ---- // setting the property,checking internal property.set(VALUE_1); property.addListener(internalListener2); internalListener2.reset(); property.set(VALUE_2); ! internalListener2.check(property, 1); // setting the property, checking public property.set(VALUE_1); readOnlyProperty.addListener(publicListener2); publicListener2.reset();
*** 654,664 **** v.set(VALUE_2); property.addListener(internalListener3); v.get(); internalListener3.reset(); v.set(VALUE_1); ! internalListener3.check(readOnlyProperty, 1); // binding the property, checking public property.bind(v); v.set(VALUE_2); readOnlyProperty.addListener(publicListener3); --- 654,664 ---- v.set(VALUE_2); property.addListener(internalListener3); v.get(); internalListener3.reset(); v.set(VALUE_1); ! internalListener3.check(property, 1); // binding the property, checking public property.bind(v); v.set(VALUE_2); readOnlyProperty.addListener(publicListener3);
< prev index next >