BUG-5280: remove support for talking to pre-Boron clients
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / messages / CommitTransactionReplyTest.java
1 /*
2  * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.datastore.messages;
9
10 import static org.junit.Assert.assertEquals;
11 import java.io.Serializable;
12 import org.apache.commons.lang.SerializationUtils;
13 import org.junit.Test;
14 import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
15
16 /**
17  * Unit tests for CommitTransactionReply.
18  *
19  * @author Thomas Pantelis
20  */
21 public class CommitTransactionReplyTest {
22
23     @Test
24     public void testSerialization() {
25         CommitTransactionReply expected = CommitTransactionReply.instance(DataStoreVersions.CURRENT_VERSION);
26
27         Object serialized = expected.toSerializable();
28         assertEquals("Serialized type", CommitTransactionReply.class, serialized.getClass());
29
30         CommitTransactionReply actual = (CommitTransactionReply)SerializationUtils.clone((Serializable) serialized);
31         assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, actual.getVersion());
32     }
33
34     @Test
35     public void testIsSerializedType() {
36         assertEquals("isSerializedType", true, CommitTransactionReply.isSerializedType(new CommitTransactionReply()));
37         assertEquals("isSerializedType", false, CommitTransactionReply.isSerializedType(new Object()));
38     }
39 }