1 package org.opendaylight.controller.cluster.datastore.modification;
3 import com.google.common.base.Optional;
4 import junit.framework.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 MutableCompositeModificationTest extends AbstractModificationTest {
14 public void testApply() throws Exception {
16 MutableCompositeModification compositeModification = new MutableCompositeModification();
17 compositeModification.addModification(new WriteModification(TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME)));
19 DOMStoreReadWriteTransaction transaction = store.newReadWriteTransaction();
20 compositeModification.apply(transaction);
21 commitTransaction(transaction);
23 Optional<NormalizedNode<?,?>> data = readData(TestModel.TEST_PATH);
25 Assert.assertNotNull(data.get());
26 Assert.assertEquals(TestModel.TEST_QNAME, data.get().getNodeType());