Merge "Bug 1027: Sort map of instance-identifiers and data by length."
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / modification / MergeModificationTest.java
1 package org.opendaylight.controller.cluster.datastore.modification;
2
3 import com.google.common.base.Optional;
4 import org.junit.Assert;
5 import org.junit.Test;
6 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
7 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
8 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
9 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
10
11 public class MergeModificationTest extends AbstractModificationTest{
12
13   @Test
14   public void testApply() throws Exception {
15     //TODO : Need to write a better test for this
16
17     //Write something into the datastore
18     DOMStoreReadWriteTransaction writeTransaction = store.newReadWriteTransaction();
19     MergeModification writeModification = new MergeModification(TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
20     writeModification.apply(writeTransaction);
21     commitTransaction(writeTransaction);
22
23     //Check if it's in the datastore
24     Optional<NormalizedNode<?,?>> data = readData(TestModel.TEST_PATH);
25     Assert.assertTrue(data.isPresent());
26
27   }
28 }