/** * Verify that we don't get any erorrs for null input. * <p> * @throws ClassNotFoundException * @throws IOException */ public void testDeserialize_NullInput() throws IOException, ClassNotFoundException { // SETUP CompressingSerializer serializer = new CompressingSerializer(); // DO WORK Object result = serializer.deSerialize( null, null ); // VERIFY assertNull( "Should have nothing.", result ); }
/** * Verify that we don't get any erorrs for null input. * <p> * @throws ClassNotFoundException * @throws IOException */ public void testDeserialize_NullInput() throws IOException, ClassNotFoundException { // SETUP CompressingSerializer serializer = new CompressingSerializer(); // DO WORK Object result = serializer.deSerialize( null, null ); // VERIFY assertNull( "Should have nothing.", result ); }
/** * Test serialization with a null object. Verify that we don't get an error. * <p> * @throws Exception on error */ public void testSerialize_NullInput() throws Exception { // SETUP CompressingSerializer serializer = new CompressingSerializer(); String before = null; // DO WORK byte[] serialized = serializer.serialize( before ); String after = (String) serializer.deSerialize( serialized, null ); // VERIFY assertNull( "Should have nothing. after =" + after, after ); }
/** * Test simple back and forth with a string. * <p> * ))<=>(( * <p> * @throws Exception on error */ public void testSimpleBackAndForth() throws Exception { // SETUP CompressingSerializer serializer = new CompressingSerializer(); // DO WORK String before = "adsfdsafdsafdsafdsafdsafdsafdsagfdsafdsafdsfdsafdsafsa333 31231"; String after = (String) serializer.deSerialize( serializer.serialize( before ), null ); // VERIFY assertEquals( "Before and after should be the same.", before, after ); }
/** * Test serialization with a null object. Verify that we don't get an error. * <p> * @throws Exception on error */ public void testSerialize_NullInput() throws Exception { // SETUP CompressingSerializer serializer = new CompressingSerializer(); String before = null; // DO WORK byte[] serialized = serializer.serialize( before ); String after = (String) serializer.deSerialize( serialized, null ); // VERIFY assertNull( "Should have nothing. after =" + after, after ); }
/** * Test simple back and forth with a string. * <p> * ))<=>(( * <p> * @throws Exception on error */ public void testSimpleBackAndForth() throws Exception { // SETUP CompressingSerializer serializer = new CompressingSerializer(); // DO WORK String before = "adsfdsafdsafdsafdsafdsafdsafdsagfdsafdsafdsfdsafdsafsa333 31231"; String after = (String) serializer.deSerialize( serializer.serialize( before ), null ); // VERIFY assertEquals( "Before and after should be the same.", before, after ); }