< prev index next >
modules/base/src/test/java/javafx/beans/property/ReadOnlyFloatWrapperTest.java
Print this page
rev 9213 : 8089557: bindBidirection works for ReadOnly*Wrapper incorrectly
@@ -154,11 +154,11 @@
// set value once
property.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// set same value again
property.set(VALUE_1);
@@ -171,11 +171,11 @@
// set value twice without reading
property.set(VALUE_2);
property.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
}
@Test
@@ -184,11 +184,11 @@
// set value once
property.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(1);
- internalChangeListener.check(readOnlyProperty, DEFAULT, VALUE_1, 1);
+ internalChangeListener.check(property, DEFAULT, VALUE_1, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
// set same value again
property.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
@@ -199,11 +199,11 @@
// set value twice without reading
property.set(VALUE_2);
property.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(2);
- internalChangeListener.check(readOnlyProperty, VALUE_2, VALUE_1, 2);
+ internalChangeListener.check(property, VALUE_2, VALUE_1, 2);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
}
@Test
public void testPublicEagerSet() {
@@ -238,11 +238,11 @@
// set value once
property.setValue(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// set same value again
property.setValue(VALUE_1);
@@ -255,11 +255,11 @@
// set value twice without reading
property.setValue(VALUE_2);
property.setValue(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
}
@Test
@@ -268,11 +268,11 @@
// set value once
property.setValue(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(1);
- internalChangeListener.check(readOnlyProperty, DEFAULT, VALUE_1, 1);
+ internalChangeListener.check(property, DEFAULT, VALUE_1, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
// set same value again
property.setValue(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
@@ -283,11 +283,11 @@
// set value twice without reading
property.setValue(VALUE_2);
property.setValue(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(2);
- internalChangeListener.check(readOnlyProperty, VALUE_2, VALUE_1, 2);
+ internalChangeListener.check(property, VALUE_2, VALUE_1, 2);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
}
@Test
public void testPublicEagerSetValue() {
@@ -330,37 +330,37 @@
property.bind(v);
assertEquals(VALUE_1, property.get(), EPSILON);
assertTrue(property.isBound());
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// change binding once
v.set(VALUE_2);
assertEquals(VALUE_2, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// change binding twice without reading
v.set(VALUE_1);
v.set(VALUE_2);
assertEquals(VALUE_2, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// change binding twice to same value
v.set(VALUE_1);
v.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
}
@Test
@@ -370,34 +370,34 @@
property.bind(v);
assertEquals(VALUE_1, property.get(), EPSILON);
assertTrue(property.isBound());
property.check(1);
- internalChangeListener.check(readOnlyProperty, DEFAULT, VALUE_1, 1);
+ internalChangeListener.check(property, DEFAULT, VALUE_1, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
// change binding once
v.set(VALUE_2);
assertEquals(VALUE_2, property.get(), EPSILON);
property.check(1);
- internalChangeListener.check(readOnlyProperty, VALUE_1, VALUE_2, 1);
+ internalChangeListener.check(property, VALUE_1, VALUE_2, 1);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
// change binding twice without reading
v.set(VALUE_1);
v.set(VALUE_2);
assertEquals(VALUE_2, property.get(), EPSILON);
property.check(2);
- internalChangeListener.check(readOnlyProperty, VALUE_1, VALUE_2, 2);
+ internalChangeListener.check(property, VALUE_1, VALUE_2, 2);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
// change binding twice to same value
v.set(VALUE_1);
v.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(2);
- internalChangeListener.check(readOnlyProperty, VALUE_2, VALUE_1, 1);
+ internalChangeListener.check(property, VALUE_2, VALUE_1, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
}
@Test
public void testPublicEagerBind_primitive() {
@@ -442,37 +442,37 @@
property.bind(v);
assertEquals(VALUE_1, property.get(), EPSILON);
assertTrue(property.isBound());
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// change binding once
v.set(VALUE_2);
assertEquals(VALUE_2, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// change binding twice without reading
v.set(VALUE_1);
v.set(VALUE_2);
assertEquals(VALUE_2, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// change binding twice to same value
v.set(VALUE_1);
v.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
}
@Test
@@ -482,34 +482,34 @@
property.bind(v);
assertEquals(VALUE_1, property.get(), EPSILON);
assertTrue(property.isBound());
property.check(1);
- internalChangeListener.check(readOnlyProperty, DEFAULT, VALUE_1, 1);
+ internalChangeListener.check(property, DEFAULT, VALUE_1, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
// change binding once
v.set(VALUE_2);
assertEquals(VALUE_2, property.get(), EPSILON);
property.check(1);
- internalChangeListener.check(readOnlyProperty, VALUE_1, VALUE_2, 1);
+ internalChangeListener.check(property, VALUE_1, VALUE_2, 1);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
// change binding twice without reading
v.set(VALUE_1);
v.set(VALUE_2);
assertEquals(VALUE_2, property.get(), EPSILON);
property.check(2);
- internalChangeListener.check(readOnlyProperty, VALUE_1, VALUE_2, 2);
+ internalChangeListener.check(property, VALUE_1, VALUE_2, 2);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
// change binding twice to same value
v.set(VALUE_1);
v.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(2);
- internalChangeListener.check(readOnlyProperty, VALUE_2, VALUE_1, 1);
+ internalChangeListener.check(property, VALUE_2, VALUE_1, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
}
@Test
public void testPublicEagerBind_generic() {
@@ -567,19 +567,19 @@
// rebind causes invalidation event
property.bind(v2);
assertEquals(VALUE_2, property.get(), EPSILON);
assertTrue(property.isBound());
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// change new binding
v2.set(VALUE_1);
assertEquals(VALUE_1, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_1, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
// change old binding
v1.set(VALUE_2);
@@ -622,11 +622,11 @@
// set value
property.set(VALUE_2);
assertEquals(VALUE_2, property.get(), EPSILON);
property.check(1);
- internalInvalidationListener.check(readOnlyProperty, 1);
+ internalInvalidationListener.check(property, 1);
assertEquals(VALUE_2, readOnlyProperty.get(), EPSILON);
publicInvalidationListener.check(readOnlyProperty, 1);
}
@Test
@@ -640,11 +640,11 @@
// setting the property,checking internal
property.set(VALUE_1);
property.addListener(internalListener2);
internalListener2.reset();
property.set(VALUE_2);
- internalListener2.check(readOnlyProperty, 1);
+ internalListener2.check(property, 1);
// setting the property, checking public
property.set(VALUE_1);
readOnlyProperty.addListener(publicListener2);
publicListener2.reset();
@@ -656,11 +656,11 @@
v.set(VALUE_2);
property.addListener(internalListener3);
v.get();
internalListener3.reset();
v.set(VALUE_1);
- internalListener3.check(readOnlyProperty, 1);
+ internalListener3.check(property, 1);
// binding the property, checking public
property.bind(v);
v.set(VALUE_2);
readOnlyProperty.addListener(publicListener3);
< prev index next >