Introduce SimpleNormalizedNodeMessage for serialization of NormalizedNode using protobuff
[controller.git] / opendaylight / md-sal / sal-protocolbuffer-encoding / src / test / java / org / opendaylight / controller / cluster / datastore / messages / ShardManagerMessagesTest.java
index f57cfc9f10509103b0e311853d5848bb062cd70a..353afe992c0ad1a7ede3c2774f6a67e2f8c39e8e 100644 (file)
@@ -1,15 +1,12 @@
 package org.opendaylight.controller.cluster.datastore.messages;
 
 /**
- * This test case is present to ensure that if others have
- * used proper version of protocol buffer.
+ * This test case is present to ensure that if others have used proper version of protocol buffer.
  *
- * If a different version of protocol buffer is used then it would
- * generate different java sources and would result in
- * breaking of this test case.
+ * If a different version of protocol buffer is used then it would generate different java sources
+ * and would result in breaking of this test case.
  *
- * @author: syedbahm
- * Date: 6/20/14
+ * @author: syedbahm Date: 6/20/14
  *
  */
 
@@ -24,17 +21,19 @@ import java.io.FileOutputStream;
 public class ShardManagerMessagesTest {
 
   @Test
-  public void verifySerialization()throws Exception{
-   ShardManagerMessages.FindPrimary.Builder builder = ShardManagerMessages.FindPrimary.newBuilder();
-   builder.setShardName("Inventory");
-   File testFile = new File("./test");
-   FileOutputStream output = new FileOutputStream(testFile);
-   builder.build().writeTo(output);
-   output.close();
-
-   //Here we will read the same and check we got back what we had saved
-    ShardManagerMessages.FindPrimary findPrimary
-             =  ShardManagerMessages.FindPrimary.parseFrom(new FileInputStream(testFile));
+  public void verifySerialization() throws Exception {
+    ShardManagerMessages.FindPrimary.Builder builder =
+        ShardManagerMessages.FindPrimary.newBuilder();
+    builder.setShardName("Inventory");
+    File testFile = new File("./test");
+    FileOutputStream output = new FileOutputStream(testFile);
+    builder.build().writeTo(output);
+    output.close();
+
+    // Here we will read the same and check we got back what we had saved
+    ShardManagerMessages.FindPrimary findPrimary =
+        ShardManagerMessages.FindPrimary
+            .parseFrom(new FileInputStream(testFile));
     Assert.assertEquals("Inventory", findPrimary.getShardName());
 
     testFile.delete();