diff options
author | Artur Signell <artur@vaadin.com> | 2012-09-24 16:19:41 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-10-23 14:42:57 +0300 |
commit | 0121af0c28d92db37dea94050f3453ecf46556b9 (patch) | |
tree | ba8397bcfbf5747708f040fee76a6dd5cb8bc515 /server/tests | |
parent | ce0640100a3892a1e36d25df1b85de73b6e2d1d0 (diff) | |
download | vaadin-framework-0121af0c28d92db37dea94050f3453ecf46556b9.tar.gz vaadin-framework-0121af0c28d92db37dea94050f3453ecf46556b9.zip |
Changed Property.setValue(Object) to setValue(T) (#8791)
Change-Id: I9f0e6bd62102c5adc461884b1f3b2cbe69f19259
Diffstat (limited to 'server/tests')
5 files changed, 9 insertions, 43 deletions
diff --git a/server/tests/src/com/vaadin/data/util/filter/AbstractFilterTest.java b/server/tests/src/com/vaadin/data/util/filter/AbstractFilterTest.java index 6f96c3a51a..96673ff608 100644 --- a/server/tests/src/com/vaadin/data/util/filter/AbstractFilterTest.java +++ b/server/tests/src/com/vaadin/data/util/filter/AbstractFilterTest.java @@ -30,7 +30,7 @@ public abstract class AbstractFilterTest<FILTERTYPE extends Filter> extends } @Override - public void setValue(Object newValue) throws ReadOnlyException { + public void setValue(String newValue) throws ReadOnlyException { throw new ReadOnlyException(); } diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java index 8d4cdc3c7c..73f6063fdd 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java @@ -67,40 +67,6 @@ public class AbstractFieldValueConversions extends TestCase { assertEquals("abc", paulaBean.getFirstName()); } - public void testFailingConversion() { - TextField tf = new TextField(); - tf.setConverter(new Converter<String, Integer>() { - - @Override - public Integer convertToModel(String value, Locale locale) { - throw new ConversionException("Failed"); - } - - @Override - public String convertToPresentation(Integer value, Locale locale) { - throw new ConversionException("Failed"); - } - - @Override - public Class<Integer> getModelType() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Class<String> getPresentationType() { - // TODO Auto-generated method stub - return null; - } - }); - try { - tf.setValue(1); - fail("setValue(Integer) should throw an exception"); - } catch (Converter.ConversionException e) { - // OK, expected - } - } - public void testIntegerStringConversion() { TextField tf = new TextField(); diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java index 83bb7c4613..e81f4ac6f7 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java @@ -63,20 +63,20 @@ public class RemoveListenersOnDetach { }; }; - Property property = new AbstractProperty() { + Property<String> property = new AbstractProperty<String>() { @Override - public Object getValue() { + public String getValue() { return null; } @Override - public void setValue(Object newValue) throws ReadOnlyException, + public void setValue(String newValue) throws ReadOnlyException, ConversionException { fireValueChange(); } @Override - public Class<?> getType() { + public Class<String> getType() { return String.class; } }; diff --git a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java index b969bf5e53..d1dd87d923 100644 --- a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java @@ -10,12 +10,12 @@ public class SliderTest extends TestCase { public void testOutOfBounds() { Slider s = new Slider(0, 10); - s.setValue(0); + s.setValue(0.0); Assert.assertEquals(0.0, s.getValue()); - s.setValue(10); + s.setValue(10.0); Assert.assertEquals(10.0, s.getValue()); try { - s.setValue(20); + s.setValue(20.0); fail("Should throw out of bounds exception"); } catch (ValueOutOfBoundsException e) { // TODO: handle exception diff --git a/server/tests/src/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java b/server/tests/src/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java index f2de4f3c04..c8d6ecce9c 100644 --- a/server/tests/src/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java +++ b/server/tests/src/com/vaadin/tests/server/components/AbstractTestFieldValueChange.java @@ -123,7 +123,7 @@ public abstract class AbstractTestFieldValueChange<T> extends TestCase { * Override in subclasses to set value with changeVariables(). */ protected void setValue(AbstractField<T> field) { - field.setValue("newValue"); + field.setValue((T) "newValue"); } } |