From c5df7f5bf60cea004e146cf559f4f36de6e9c48b Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 8 Jul 2014 18:19:28 +0300 Subject: Box and unbox long values in state fields (#14176) We actually want to pass around the primitive long values emulated by GWT even though JavaScript code can't do anything with the values. Skipping the unboxing caused long fields to always be 0 since that's how JavaScript converts an object into a number. This patch also makes the test assert that the expected state values are received and updates those values to actually make sense in some situations. Change-Id: Id9c3696d699593bd9e59e249c5daf077873b85fc --- .../tests/serialization/SerializerTestTest.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java') diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java index 5ca1e9ce6a..47bb212347 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java @@ -77,5 +77,36 @@ public class SerializerTestTest extends MultiBrowserTest { "sendBoolean: false, false, [false, false, true, false, true, true]", getLogRow(logRow++)); Assert.assertEquals("sendBeanSubclass: 43", getLogRow(logRow++)); + Assert.assertEquals( + "state.doubleArray: [1.7976931348623157e+308, 5e-324]", + getLogRow(logRow++)); + Assert.assertEquals("state.doubleObjectValue: -2.718281828459045", + getLogRow(logRow++)); + Assert.assertEquals("state.doubleValue: 3.141592653589793", + getLogRow(logRow++)); + Assert.assertEquals("state.floatArray: [57, 0, -12]", + getLogRow(logRow++)); + Assert.assertEquals("state.floatObjectValue: 1.0000001", + getLogRow(logRow++)); + Assert.assertEquals("state.floatValue: 3.14159", getLogRow(logRow++)); + Assert.assertEquals("state.longArray: [-57841235865, 57]", + getLogRow(logRow++)); + Assert.assertEquals("state.longObjectValue: 577431841360", + getLogRow(logRow++)); + Assert.assertEquals("state.longValue: 577431841359", + getLogRow(logRow++)); + Assert.assertEquals("state.intArray: [5, 7]", getLogRow(logRow++)); + Assert.assertEquals("state.intObjectValue: 42", getLogRow(logRow++)); + Assert.assertEquals("state.intValue: 2147483647", getLogRow(logRow++)); + Assert.assertEquals("state.charArray: aBcD", getLogRow(logRow++)); + Assert.assertEquals("state.charObjectValue: å", getLogRow(logRow++)); + Assert.assertEquals("state.charValue: ∫", getLogRow(logRow++)); + Assert.assertEquals("state.byteArray: [3, 1, 2]", getLogRow(logRow++)); + Assert.assertEquals("state.byteObjectValue: -12", getLogRow(logRow++)); + Assert.assertEquals("state.byteValue: 5", getLogRow(logRow++)); + Assert.assertEquals( + "state.booleanArray: [true, true, false, true, false, false]", + getLogRow(logRow++)); + } } -- cgit v1.2.3