"alesj" wrote:"adrian@jboss.org" wrote:
But you'll probably need to introduce a Reflection* subclass for
each to make the serialization work,
I did a quick change - moved readResolve() from ClassInfoImpl to ReflectClassInfoImpl.
How come all the tests still work?
Not covering all the corner cases?
139 DEBUG [IntrospectionArrayUnitTestCase] Type: class [Lorg.jboss.test.classinfo.support.ClassInfoAnnotationClass; BEFORE ======> ArrayInfoImpl@17653ae{name=[Lorg.jboss.test.classinfo.support.ClassInfoAnnotationClass;} AFTER ======> ArrayInfoImpl@134f69a{name=[Lorg.jboss.test.classinfo.support.ClassInfoAnnotationClass;}
"adrian@jboss.org" wrote:
i.e. add readResolve() into the introspection factory.
What about if I add a super class for all Reflection* subclases with readResolve there?
You should really be asserting that you get the same object back.
Also these tests are inadequete. You are only testing the ClassInfo parts
of the serialized objects.
Each test must serialize and deserialize its own object and test ALL its fields.
e.g. does the array have the correct component type, etc. Has it been
readResolved properly?
"adrian@jboss.org" wrote:
Well actually if you test they are the same object then it is really redundant
to test all fields. The same object can't have different values to the original. :-)