address review comment

Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/cdc041e0
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/cdc041e0
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/cdc041e0

Branch: refs/heads/master
Commit: cdc041e0e590059cb81dcb038139b297c6f21e9c
Parents: 43ca795
Author: Jark Wu <[email protected]>
Authored: Sun Mar 6 11:14:40 2016 +0800
Committer: Jark Wu <[email protected]>
Committed: Sun Mar 6 11:14:40 2016 +0800

----------------------------------------------------------------------
 .../storm/serialization/SerializationTest.java  | 28 +++++++-------------
 1 file changed, 9 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/cdc041e0/storm-core/test/jvm/org/apache/storm/serialization/SerializationTest.java
----------------------------------------------------------------------
diff --git 
a/storm-core/test/jvm/org/apache/storm/serialization/SerializationTest.java 
b/storm-core/test/jvm/org/apache/storm/serialization/SerializationTest.java
index a5501ed..e485518 100644
--- a/storm-core/test/jvm/org/apache/storm/serialization/SerializationTest.java
+++ b/storm-core/test/jvm/org/apache/storm/serialization/SerializationTest.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ * <p/>
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p/>
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,8 +23,6 @@ import org.apache.storm.testing.TestSerObject;
 import org.apache.storm.utils.Utils;
 import org.junit.Assert;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 import java.util.HashMap;
@@ -33,10 +31,8 @@ import java.util.Map;
 
 public class SerializationTest {
 
-    private static final Logger LOG = 
LoggerFactory.getLogger(SerializationTest.class);
-
     @Test
-    public void testJavaSerialization() {
+    public void testJavaSerialization() throws IOException {
         Object obj = new TestSerObject(1, 2);
         List<Object> vals = Lists.newArrayList(obj);
 
@@ -57,7 +53,7 @@ public class SerializationTest {
     }
 
     @Test
-    public void testKryoDecorator() {
+    public void testKryoDecorator() throws IOException {
         Object obj = new TestSerObject(1, 2);
         List<Object> vals = Lists.newArrayList(obj);
 
@@ -74,7 +70,7 @@ public class SerializationTest {
     }
 
     @Test
-    public void testStringSerialization() {
+    public void testStringSerialization() throws IOException {
         isRoundtrip(Lists.newArrayList("a", "bb", "cbe"));
         isRoundtrip(Lists.newArrayList(mkString(64 * 1024)));
         isRoundtrip(Lists.newArrayList(mkString(1024 * 1024)));
@@ -97,18 +93,12 @@ public class SerializationTest {
         return deserializer.deserialize(bytes);
     }
 
-    private List roundtrip(List vals) {
+    private List roundtrip(List vals) throws IOException {
         return roundtrip(vals, new HashMap());
     }
 
-    private List roundtrip(List vals, Map conf) {
-        List ret = null;
-        try {
-            ret = deserialize(serialize(vals, conf), conf);
-        } catch (IOException e) {
-            LOG.error("Exception when serialize/deserialize ", e);
-        }
-        return ret;
+    private List roundtrip(List vals, Map conf) throws IOException {
+        return deserialize(serialize(vals, conf), conf);
     }
 
     private String mkString(int size) {
@@ -119,7 +109,7 @@ public class SerializationTest {
         return sb.toString();
     }
 
-    public void isRoundtrip(List vals) {
+    public void isRoundtrip(List vals) throws IOException {
         Assert.assertEquals(vals, roundtrip(vals));
     }
 }
\ No newline at end of file

Reply via email to