Make Netty-3 dependency optional
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / messages / DataExistsTest.java
index 2c16e812ae660cdde7552a47fffcc3b908b50b00..bcd732215036152e8199ed79f28978e305ba4247 100644 (file)
@@ -8,21 +8,22 @@
 package org.opendaylight.controller.cluster.datastore.messages;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.io.Serializable;
-import org.apache.commons.lang.SerializationUtils;
+import org.apache.commons.lang3.SerializationUtils;
 import org.junit.Test;
 import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
-import org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils;
 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
-import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
 
 /**
  * Unit tests for DataExists.
  *
  * @author Thomas Pantelis
  */
+@Deprecated(since = "9.0.0", forRemoval = true)
 public class DataExistsTest {
-
     @Test
     public void testSerialization() {
         DataExists expected = new DataExists(TestModel.TEST_PATH, DataStoreVersions.CURRENT_VERSION);
@@ -35,25 +36,9 @@ public class DataExistsTest {
         assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, actual.getVersion());
     }
 
-    @Test
-    public void testSerializationWithPreBoronVersion() {
-        DataExists expected = new DataExists(TestModel.TEST_PATH, DataStoreVersions.LITHIUM_VERSION);
-
-        Object serialized = expected.toSerializable();
-        assertEquals("Serialized type", ShardTransactionMessages.DataExists.class, serialized.getClass());
-
-        DataExists actual = DataExists.fromSerializable(SerializationUtils.clone((Serializable) serialized));
-        assertEquals("getPath", expected.getPath(), actual.getPath());
-        assertEquals("getVersion", DataStoreVersions.LITHIUM_VERSION, actual.getVersion());
-    }
-
     @Test
     public void testIsSerializedType() {
-        assertEquals("isSerializedType", true, DataExists.isSerializedType(
-                ShardTransactionMessages.DataExists.newBuilder().setInstanceIdentifierPathArguments(
-                        InstanceIdentifierUtils.toSerializable(TestModel.TEST_PATH)).build()));
-
-        assertEquals("isSerializedType", true, DataExists.isSerializedType(new DataExists()));
-        assertEquals("isSerializedType", false, DataExists.isSerializedType(new Object()));
+        assertTrue("isSerializedType", DataExists.isSerializedType(new DataExists()));
+        assertFalse("isSerializedType", DataExists.isSerializedType(new Object()));
     }
 }