rzanner commented on code in PR #430:
URL: https://github.com/apache/commons-beanutils/pull/430#discussion_r3665661952


##########
src/test/java/org/apache/commons/beanutils/DynaPropertyTest.java:
##########
@@ -96,4 +105,33 @@ public void testHashCode() {
         assertEquals(testPropertyWithNameAndTypeAndContentType.hashCode(), 
testProperty3Duplicate.hashCode());
         assertEquals(initialHashCode, 
testPropertyWithNameAndTypeAndContentType.hashCode());
     }
+
+    /**
+     * Tests basic serialization and deserialization mechanism.
+     */
+    public void testSerialization() throws Exception {
+        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+        ObjectOutputStream oos = new ObjectOutputStream(buffer);
+        oos.writeObject(testPropertyWithNameAndTypeAndContentType);
+        oos.flush();
+        oos.close();
+
+        ObjectInputStream ois = new ObjectInputStream(new 
ByteArrayInputStream(buffer.toByteArray()));
+        Object obj = ois.readObject();
+
+        assertEquals(testPropertyWithNameAndTypeAndContentType, obj);
+    }

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to