1212
1313public class DeserializationUnitTest {
1414
15- private static final String serializedObj = "rO0ABXNyACljb20uYmFlbGR1bmcuZGVzZXJpYWxpemF0aW9uLkFwcGxlUHJvZHVjdAAAAAAAEtaHAgADTAANaGVhZHBob25lUG9ydHQAEkxqYXZhL2xhbmcvU3RyaW5nO0wADmxpZ2h0ZW5pbmdQb3J0cQB+AAFMAA90aHVuZGVyYm9sdFBvcnRxAH4AAXhwdAARaGVhZHBob25lUG9ydDIwMjBwdAATdGh1bmRlcmJvbHRQb3J0MjAyMA== " ;
15+ private static final String serializedObj = "rO0ABXNyACljb20uYmFlbGR1bmcuZGVzZXJpYWxpemF0aW9uLkFwcGxlUHJvZHVjdAAAAAAAdMuxAgADTAANaGVhZHBob25lUG9ydHQAEkxqYXZhL2xhbmcvU3RyaW5nO0wADWxpZ2h0bmluZ1BvcnRxAH4AAUwAD3RodW5kZXJib2x0UG9ydHEAfgABeHB0ABFoZWFkcGhvbmVQb3J0MjAyMHQAEWxpZ2h0bmluZ1BvcnQyMDIwdAATdGh1bmRlcmJvbHRQb3J0MjAyMA " ;
1616
1717 private static long userDefinedSerialVersionUID = 1234567L ;
1818
@@ -25,20 +25,22 @@ public class DeserializationUnitTest {
2525 public void testDeserializeObj_compatible () throws IOException , ClassNotFoundException {
2626
2727 assertEquals (userDefinedSerialVersionUID , AppleProduct .getSerialVersionUID ());
28-
28+
2929 AppleProduct macBook = new AppleProduct ();
3030 macBook .headphonePort = "headphonePort2020" ;
3131 macBook .thunderboltPort = "thunderboltPort2020" ;
32-
32+ macBook .lightningPort = "lightningPort2020" ;
33+
3334 // serializes the "AppleProduct" object
3435 String serializedProduct = SerializationUtility .serializeObjectToString (macBook );
3536
3637 // deserializes the "AppleProduct" object
3738 AppleProduct deserializedProduct = (AppleProduct ) DeserializationUtility .deSerializeObjectFromString (serializedProduct );
38-
39+
3940 assertTrue (deserializedProduct .headphonePort .equalsIgnoreCase (macBook .headphonePort ));
4041 assertTrue (deserializedProduct .thunderboltPort .equalsIgnoreCase (macBook .thunderboltPort ));
41-
42+ assertTrue (deserializedProduct .lightningPort .equalsIgnoreCase (macBook .lightningPort ));
43+
4244 }
4345
4446 /**
@@ -59,7 +61,6 @@ public void testDeserializeObj_compatible() throws IOException, ClassNotFoundExc
5961 public void testDeserializeObj_incompatible () throws ClassNotFoundException , IOException {
6062
6163 assertNotEquals (userDefinedSerialVersionUID , AppleProduct .getSerialVersionUID ());
62-
6364 // attempts to deserialize the "AppleProduct" object
6465 DeserializationUtility .deSerializeObjectFromString (serializedObj );
6566 }
0 commit comments