Merge "BUG 1839 - HTTP delete of non existing data"
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / messages / WriteDataTest.java
1 /*
2  * Copyright (c) 2014 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 org.junit.Assert;
11 import org.junit.Test;
12 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
13 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
14 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
15
16 /**
17  * Unit tests for WriteData.
18  *
19  * @author Thomas Pantelis
20  */
21 public class WriteDataTest {
22
23     @Test
24     public void testSerialization() {
25         SchemaContext schemaContext = TestModel.createTestContext();
26         WriteData expected = new WriteData(TestModel.TEST_PATH, ImmutableNodes
27             .containerNode(TestModel.TEST_QNAME), schemaContext);
28
29         WriteData actual = WriteData.fromSerializable(expected.toSerializable(), schemaContext);
30         Assert.assertEquals("getPath", expected.getPath(), actual.getPath());
31         Assert.assertEquals("getData", expected.getData(), actual.getData());
32     }
33 }