1 package org.opendaylight.controller.cluster.datastore.modification;
3 import com.google.common.base.Optional;
4 import org.junit.Assert;
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;
11 public class WriteModificationTest extends AbstractModificationTest{
14 public void testApply() throws Exception {
15 //Write something into the datastore
16 DOMStoreReadWriteTransaction writeTransaction = store.newReadWriteTransaction();
17 WriteModification writeModification = new WriteModification(TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
18 writeModification.apply(writeTransaction);
19 commitTransaction(writeTransaction);
21 //Check if it's in the datastore
22 Optional<NormalizedNode<?,?>> data = readData(TestModel.TEST_PATH);
23 Assert.assertTrue(data.isPresent());