0

我有實現java.io.Serializable接口(用於串行化目的)幾個模型類,它們在DEVMODE和webmode完美地工作,但是當我想在運行測試後使用這些數據在GWTTestCase我得到這個錯誤:爲什麼GWTTestCase只接受序列化Java對象的IsSerializable接口?

Type 'com.saeed.test.model.MyModel' was not assignable to 
'com.google.gwt.user.client.rpc.IsSerializable' 
and did not have a custom field serializer. 
For security purposes, this type will not be deserialized. 

我提到MyModel類沒有默認構造函數(但在devmode和webmode中完美工作)。

我該如何解決這個問題?

+0

http://sscce.org/ –

+0

無論您是否能夠解決問題,請發佈更新。如果通過選擇答案或發佈自己的答案來解決問題,這是一個很好的做法。 – SSR

回答

0

請通過GWT RPC的用戶測試套件here和RPC測試套件here

您可能還需要遵循GWT如何設置其RPC測試。