diff options
author | Artur Signell <artur@vaadin.com> | 2012-08-22 21:57:12 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-08-22 22:24:31 +0300 |
commit | af2638fc57cf3d9f6dc84957bb6ee4b256ec60e7 (patch) | |
tree | 20081d6ad4bcd90b9fe42814f9fe8c61d643cfae /tests/server-side/com | |
parent | 098957c08507449e34fd64618d4964ee0b030eba (diff) | |
download | vaadin-framework-af2638fc57cf3d9f6dc84957bb6ee4b256ec60e7.tar.gz vaadin-framework-af2638fc57cf3d9f6dc84957bb6ee4b256ec60e7.zip |
Removed readThrough/writeThrough in favor of buffered (#8180)
Diffstat (limited to 'tests/server-side/com')
-rw-r--r-- | tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java | 50 | ||||
-rw-r--r-- | tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java | 53 |
2 files changed, 5 insertions, 98 deletions
diff --git a/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java b/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java index 3512f555c9..f2de4f3c04 100644 --- a/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java +++ b/tests/server-side/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java @@ -42,8 +42,7 @@ public abstract class AbstractTestFieldValueChange<T> extends TestCase { */ public void testRemoveListener() { getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(true); - getField().setReadThrough(true); + getField().setBuffered(false); // Expectations and start test listener.valueChange(EasyMock.isA(ValueChangeEvent.class)); @@ -76,10 +75,9 @@ public abstract class AbstractTestFieldValueChange<T> extends TestCase { * Field value change notifications closely mirror value changes of the data * source behind the field. */ - public void testWriteThroughReadThrough() { + public void testNonBuffered() { getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(true); - getField().setReadThrough(true); + getField().setBuffered(false); expectValueChangeFromSetValueNotCommit(); } @@ -91,47 +89,9 @@ public abstract class AbstractTestFieldValueChange<T> extends TestCase { * Field value change notifications reflect the buffered value in the field, * not the original data source value changes. */ - public void testNoWriteThroughNoReadThrough() { + public void testBuffered() { getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(false); - getField().setReadThrough(false); - - expectValueChangeFromSetValueNotCommit(); - } - - /** - * Less common partly buffered case: writeThrough (auto-commit) is on and - * readThrough is off. Calling commit() should not cause notifications. - * - * Without readThrough activated, changes to the data source that do not - * cause notifications are not reflected by the field value. - * - * Field value change notifications correspond to changes made to the data - * source value through the text field or the (notifying) property. - */ - public void testWriteThroughNoReadThrough() { - getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(true); - getField().setReadThrough(false); - - expectValueChangeFromSetValueNotCommit(); - } - - /** - * Partly buffered use where the data source is read but not nor modified - * during editing, and is updated at commit(). - * - * When used like this, a field is updated from the data source if necessary - * when its value is requested and the property value has changed but the - * field has not been modified in its buffer. - * - * Field value change notifications reflect the buffered value in the field, - * not the original data source value changes. - */ - public void testNoWriteThroughReadThrough() { - getField().setPropertyDataSource(new ObjectProperty<String>("")); - getField().setWriteThrough(false); - getField().setReadThrough(true); + getField().setBuffered(true); expectValueChangeFromSetValueNotCommit(); } diff --git a/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java b/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java index f5db67be97..de838e339c 100644 --- a/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java +++ b/tests/server-side/com/vaadin/tests/server/components/TestTextFieldValueChange.java @@ -78,59 +78,6 @@ public class TestTextFieldValueChange extends } /** - * If read through is on and value has been modified, but not committed, the - * value should not propagate similar to - * {@link #testValueChangeEventPropagationWithReadThrough()} - * - * TODO make test field type agnostic (eg. combobox) - */ - public void testValueChangePropagationWithReadThroughWithModifiedValue() { - final String initialValue = "initial"; - ObjectProperty<String> property = new ObjectProperty<String>( - initialValue); - getField().setPropertyDataSource(property); - - // write buffering on, read buffering off - getField().setWriteThrough(false); - getField().setReadThrough(true); - - // Expect no value changes calls to listener - EasyMock.replay(getListener()); - - // first set the value (note, write through false -> not forwarded to - // property) - setValue(getField()); - - Assert.assertTrue(getField().isModified()); - - // Add listener and set the value -> should end up in listener once - getField().addListener(getListener()); - - // modify property value, should not fire value change in field as the - // field has uncommitted value (aka isModified() == true) - property.setValue("Foo"); - - // Ensure listener was called once - EasyMock.verify(getListener()); - - // get value should not fire value change again - Object value = getField().getValue(); - // Ensure listener still has been called only once - EasyMock.verify(getListener()); - - // field value should be different from the original value and current - // proeprty value - boolean isValueEqualToInitial = value.equals(initialValue); - Assert.assertFalse(isValueEqualToInitial); - boolean isValueEqualToPropertyValue = value.equals(property.getValue()); - Assert.assertFalse(isValueEqualToPropertyValue); - - // Ensure listener has not been called - EasyMock.verify(getListener()); - - } - - /** * Value change events from property should not propagate if read through is * false. Execpt when the property is being set. * |