summaryrefslogtreecommitdiffstats
path: root/server/tests/src/com
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-08-19 12:37:52 +0300
committerArtur Signell <artur@vaadin.com>2013-08-19 12:37:52 +0300
commitacc12f857d04d9b341dec700ffa469ca96d30ad8 (patch)
tree43e4583b45f1ef96d9fc2919746c56f8dfff7317 /server/tests/src/com
parent1420d23cef01bbc4e07dba693fe4717b531cd951 (diff)
parent99c7d0b3cde116bf31b00bd31f62f9f4920b1762 (diff)
downloadvaadin-framework-acc12f857d04d9b341dec700ffa469ca96d30ad8.tar.gz
vaadin-framework-acc12f857d04d9b341dec700ffa469ca96d30ad8.zip
Merge changes from origin/7.1
7cb49d1 Fix invisible calendar actions menu #12181 44aacf4 Clarify Embedded javadoc (#12290) 59a043b Fix actions in action menu appearing in random order #12250 5d57129 Fix calendar click events on context menu #12297 f5e3663 Document multiple load semantics in @StyleSheet and @JavaScript (#12200) 17bb700 Add optional OSGi Import-Package for javax.validation (#12301) ea148c8 Disable all logging if production mode is enabled (#12299) 326bbb5 Fixes parsing of multiple push messages in streaming mode (#12197) 7fc1054 Ensure StringToIntegerConverter rejects values outside range of int (#12230) f587298 Improve URI fragment listener javadocs (#12296) d97cfbc Refine handling of null and empty URI fragments (#12207) 99c7d0b Show tooltips for ordered layout captions (#10046) Change-Id: Ifb2e0131fde769e2620b7ba03755a5ba324d8aaf
Diffstat (limited to 'server/tests/src/com')
-rw-r--r--server/tests/src/com/vaadin/tests/data/converter/TestStringToIntegerConverter.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/tests/data/converter/TestStringToIntegerConverter.java b/server/tests/src/com/vaadin/tests/data/converter/TestStringToIntegerConverter.java
index c73853578e..e810106631 100644
--- a/server/tests/src/com/vaadin/tests/data/converter/TestStringToIntegerConverter.java
+++ b/server/tests/src/com/vaadin/tests/data/converter/TestStringToIntegerConverter.java
@@ -2,6 +2,7 @@ package com.vaadin.tests.data.converter;
import junit.framework.TestCase;
+import com.vaadin.data.util.converter.Converter.ConversionException;
import com.vaadin.data.util.converter.StringToIntegerConverter;
public class TestStringToIntegerConverter extends TestCase {
@@ -16,6 +17,23 @@ public class TestStringToIntegerConverter extends TestCase {
assertEquals(null, converter.convertToModel("", Integer.class, null));
}
+ public void testValueOutOfRange() {
+ Double[] values = new Double[] { Integer.MAX_VALUE * 2.0,
+ Integer.MIN_VALUE * 2.0, Long.MAX_VALUE * 2.0,
+ Long.MIN_VALUE * 2.0 };
+
+ boolean accepted = false;
+ for (Number value : values) {
+ try {
+ converter.convertToModel(String.format("%.0f", value),
+ Integer.class, null);
+ accepted = true;
+ } catch (ConversionException expected) {
+ }
+ }
+ assertFalse("Accepted value outside range of int", accepted);
+ }
+
public void testValueConversion() {
assertEquals(Integer.valueOf(10),
converter.convertToModel("10", Integer.class, null));