Fix CS warnings in sal-clustering-commons and enable enforcement
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / test / java / org / opendaylight / controller / protobuff / messages / AbstractMessagesTest.java
index bef1f41b0acd8cdda0f5d954acdce48cd91feb3b..d3c5f97881b2d0fc40f4b7e03ff0833f887484b7 100644 (file)
@@ -18,60 +18,50 @@ import java.io.FileOutputStream;
  * @author: syedbahm Date: 7/31/14
  */
 public abstract class AbstractMessagesTest {
-  public final String VERSION_COMPATIBILTY_TEST_DATA_PATH = "."
-      + File.separator + "src" + File.separator + "test" + File.separator
-      + "resources" + File.separator + "version-compatibility-serialized-data";
-  private File file;
-  private File testDataFile;
-
-  protected AbstractMessagesTest() {
-    init();
-  }
-
-  protected void init() {
-    file = new File(getTestFileName());
-    testDataFile =
-        new File(VERSION_COMPATIBILTY_TEST_DATA_PATH + File.separator
-            + getTestFileName() + "Data");
-  }
-
-
-
-  abstract public void verifySerialization() throws Exception;
-
-
-  protected void writeToFile(
-      com.google.protobuf.GeneratedMessage.Builder<?> builder) throws Exception {
-
-    FileOutputStream output = new FileOutputStream(file);
-    builder.build().writeTo(output);
-    output.close();
-
-  }
-
-  protected com.google.protobuf.GeneratedMessage readFromFile(
-      com.google.protobuf.Parser<?> parser) throws Exception {
-    com.google.protobuf.GeneratedMessage message =
-        (com.google.protobuf.GeneratedMessage) parser
-            .parseFrom(new FileInputStream(file));
-
-    /*Note: we will delete only the test file -- comment below if you want to capture the
-       version-compatibility-serialized-data test data file.The file will be generated at root of the
-       sal-protocolbuffer-encoding
-       and you need to move it to test/resources/version-compatbility-serialized-data folder renaming the file to include suffix <TestFileName>"Data"
-    */
-     file.delete();
-    return message;
-  }
-
-  protected com.google.protobuf.GeneratedMessage readFromTestDataFile(
-      com.google.protobuf.Parser<?> parser) throws Exception {
-    return (com.google.protobuf.GeneratedMessage) parser
-        .parseFrom(new FileInputStream(testDataFile));
-  }
-
-
-  public abstract String getTestFileName();
-
-
+    public final String VERSION_COMPATIBILTY_TEST_DATA_PATH = "." + File.separator + "src" + File.separator + "test"
+            + File.separator + "resources" + File.separator + "version-compatibility-serialized-data";
+    private File file;
+    private File testDataFile;
+
+    protected AbstractMessagesTest() {
+        init();
+    }
+
+    protected void init() {
+        file = new File(getTestFileName());
+        testDataFile = new File(VERSION_COMPATIBILTY_TEST_DATA_PATH + File.separator + getTestFileName() + "Data");
+    }
+
+    abstract public void verifySerialization() throws Exception;
+
+    protected void writeToFile(com.google.protobuf.GeneratedMessage.Builder<?> builder) throws Exception {
+
+        FileOutputStream output = new FileOutputStream(file);
+        builder.build().writeTo(output);
+        output.close();
+
+    }
+
+    protected com.google.protobuf.GeneratedMessage readFromFile(com.google.protobuf.Parser<?> parser) throws Exception {
+        com.google.protobuf.GeneratedMessage message = (com.google.protobuf.GeneratedMessage) parser
+                .parseFrom(new FileInputStream(file));
+
+        /*
+         * Note: we will delete only the test file -- comment below if you want
+         * to capture the version-compatibility-serialized-data test data
+         * file.The file will be generated at root of the
+         * sal-protocolbuffer-encoding and you need to move it to
+         * test/resources/version-compatbility-serialized-data folder renaming
+         * the file to include suffix <TestFileName>"Data"
+         */
+        file.delete();
+        return message;
+    }
+
+    protected com.google.protobuf.GeneratedMessage readFromTestDataFile(com.google.protobuf.Parser<?> parser)
+            throws Exception {
+        return (com.google.protobuf.GeneratedMessage) parser.parseFrom(new FileInputStream(testDataFile));
+    }
+
+    public abstract String getTestFileName();
 }