test/java/time/tck/java/time/AbstractTCKTest.java
Print this page
*** 55,64 ****
--- 55,65 ----
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package tck.java.time;
import static org.testng.Assert.assertEquals;
+ import static org.testng.Assert.assertSame;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
*** 87,96 ****
--- 88,103 ----
assertEquals(object instanceof Serializable, true);
Object deserializedObject = writeThenRead(object);
assertEquals(deserializedObject, object);
}
+ protected static void assertSerializableSame(Object object) throws IOException, ClassNotFoundException {
+ assertEquals(object instanceof Serializable, true);
+ Object deserializedObject = writeThenRead(object);
+ assertSame(deserializedObject, object);
+ }
+
private static Object writeThenRead(Object object) throws IOException, ClassNotFoundException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (ObjectOutputStream oos = new ObjectOutputStream(baos) ) {
oos.writeObject(object);
}