summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/serialization/LegacySerializerUITest.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-01-16 13:11:22 +0200
committerVaadin Code Review <review@vaadin.com>2016-01-21 08:18:35 +0000
commitbd7d085100f3739833151ea1b9b35bae48b3ddf4 (patch)
tree858199f0f2b9880e4b676b754003a3defea66711 /uitest/src/com/vaadin/tests/serialization/LegacySerializerUITest.java
parent8e255bd65e087cddc4ab27d9ffdfc1617a6d79a6 (diff)
downloadvaadin-framework-bd7d085100f3739833151ea1b9b35bae48b3ddf4.tar.gz
vaadin-framework-bd7d085100f3739833151ea1b9b35bae48b3ddf4.zip
Allow legacy components to paint infinity double values again (#19447)
JsonPaintTarget.addAttribute(String,double) converts infinity values to { "name": Infinity }. This is not valid JSON but has "always worked" and at least NumberField relies on being able to send infinity values. For state and RPC it's not possible to send 'infinity' as JsonNumber converts those to null. It is not possible to send 'infinity' back to the server using a legacy variable either as also in this case JsonNumber is used and the value becomes null. This fix should be reverted when legacy variable support is removed. Change-Id: I4b5366420e11915236eff447e3eeedc458cf8cea
Diffstat (limited to 'uitest/src/com/vaadin/tests/serialization/LegacySerializerUITest.java')
-rw-r--r--uitest/src/com/vaadin/tests/serialization/LegacySerializerUITest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/serialization/LegacySerializerUITest.java b/uitest/src/com/vaadin/tests/serialization/LegacySerializerUITest.java
new file mode 100644
index 0000000000..f3a5561e40
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/serialization/LegacySerializerUITest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.serialization;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class LegacySerializerUITest extends SingleBrowserTest {
+
+ @Test
+ public void testInfinity() {
+ openTestURL();
+ WebElement html = findElement(By.className("gwt-HTML"));
+ Assert.assertEquals("doubleInfinity: Infinity", html.getText());
+ // Can't send infinity back, never have been able to
+ Assert.assertEquals("1. doubleInfinity: null", getLogRow(0));
+ }
+
+}