diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-22 20:14:30 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-22 20:14:30 +0300 |
commit | 38358ae25543433f8cc381101bc340adc7e5c67f (patch) | |
tree | e494d807e1031c04a3d07a0c56dd60be9ae6578a /tests | |
parent | 02878bd07a38dc69fe415c7f60238817d2a7c434 (diff) | |
download | vaadin-framework-38358ae25543433f8cc381101bc340adc7e5c67f.tar.gz vaadin-framework-38358ae25543433f8cc381101bc340adc7e5c67f.zip |
Support using public fields in state classes (#9324)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java b/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java index 16cc0ede98..7775b667a1 100644 --- a/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java +++ b/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java @@ -1,7 +1,7 @@ package com.vaadin.terminal.gwt.server; /* - * Copyright 2011 Vaadin Ltd. + * Copyright 2011 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 @@ -15,9 +15,6 @@ package com.vaadin.terminal.gwt.server; * License for the specific language governing permissions and limitations under * the License. */ -import java.beans.BeanInfo; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; import java.lang.reflect.Type; import java.util.Collection; import java.util.HashMap; @@ -28,6 +25,7 @@ import junit.framework.TestCase; import com.vaadin.shared.ui.splitpanel.AbstractSplitPanelState; import com.vaadin.terminal.gwt.client.communication.JsonDecoder; import com.vaadin.terminal.gwt.client.communication.JsonEncoder; +import com.vaadin.terminal.gwt.server.JsonCodec.BeanProperty; /** * Tests for {@link JsonCodec}, {@link JsonEncoder}, {@link JsonDecoder} @@ -118,15 +116,9 @@ public class JSONSerializerTest extends TestCase { } private boolean equalsBean(Object o1, Object o2) throws Exception { - BeanInfo beanInfo = Introspector.getBeanInfo(o1.getClass()); - for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) { - String fieldName = JsonCodec.getTransportFieldName(pd); - if (fieldName == null) { - continue; - } - - Object c1 = pd.getReadMethod().invoke(o1); - Object c2 = pd.getReadMethod().invoke(o2); + for (BeanProperty property : JsonCodec.getProperties(o1.getClass())) { + Object c1 = property.getValue(o1); + Object c2 = property.getValue(o2); if (!equals(c1, c2)) { return false; } |