I have been trying to test my application to make sure that all the important classes can serialize/reload themselves properly (especially those which implement IExternalizable
):
[Test]
public function testMyObjectSerialization():void {
var myobj:MyObject = new MyObject();
var ba:ByteArray = new ByteArray();
ba.writeObject(myobj);
ba.position = 0;
var loadedObj:MyObject = ba.readObject();
assertMyObjectEqual(myobj, loadedObj);
}
And I would like to be warned when I try to serialize a strongly-typed object which does not have a [RemoteClass]
set (because that almost certainly represents a bug in my code).
So, is there any way to configure the AMF serializer to give warnings?
Also, it seems like this might be possible using services-config.xml
… But the documentation seems to imply that services-config
is channel-level, and I'd really like it if my unit tests could run without talking to the server (and I'm not using LCDS, so a bunch of the services-config
wouldn't apply to me anyway).