X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-api%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fapi%2FAbstractDOMDataTreeServiceTestSuite.java;fp=opendaylight%2Fmd-sal%2Fsal-dom-api%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fapi%2FAbstractDOMDataTreeServiceTestSuite.java;h=0000000000000000000000000000000000000000;hp=c48b4b89ba9076e171d1636888bbb0da705eee08;hb=751776589ce049c9c1c611d06335599b92087ee6;hpb=0b161730fd648bfa4c953e84b2d6a66972bc4da2 diff --git a/opendaylight/md-sal/sal-dom-api/src/test/java/org/opendaylight/controller/md/sal/dom/api/AbstractDOMDataTreeServiceTestSuite.java b/opendaylight/md-sal/sal-dom-api/src/test/java/org/opendaylight/controller/md/sal/dom/api/AbstractDOMDataTreeServiceTestSuite.java deleted file mode 100644 index c48b4b89ba..0000000000 --- a/opendaylight/md-sal/sal-dom-api/src/test/java/org/opendaylight/controller/md/sal/dom/api/AbstractDOMDataTreeServiceTestSuite.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.md.sal.dom.api; - -import static org.junit.Assert.assertNotNull; - -import com.google.common.util.concurrent.CheckedFuture; -import java.net.URI; -import java.util.Collections; -import javax.annotation.Nonnull; -import org.junit.Test; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; -import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; -import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.common.QNameModule; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder; - -/** - * Abstract test suite demonstrating various access patterns on how a {@link DOMDataTreeService} - * can be used. - */ -public abstract class AbstractDOMDataTreeServiceTestSuite { - protected static final QNameModule TEST_MODULE = QNameModule.create(URI.create( - "urn:opendaylight:params:xml:ns:yang:controller:md:sal:test:store")); - - protected static final YangInstanceIdentifier UNORDERED_CONTAINER_IID = YangInstanceIdentifier.create( - new NodeIdentifier(QName.create(TEST_MODULE, "lists")), - new NodeIdentifier(QName.create(TEST_MODULE, "unordered-container"))); - protected static final DOMDataTreeIdentifier UNORDERED_CONTAINER_TREE = - new DOMDataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, UNORDERED_CONTAINER_IID); - - /** - * Return a reference to the service used in this test. The instance - * needs to be reused within the same test and must be isolated between - * tests. - * - * @return {@link DOMDataTreeService} instance. - */ - protected abstract @Nonnull DOMDataTreeService service(); - - /** - * A simple unbound producer. It write some basic things into the data store based on the - * test model. - */ - @Test - public final void testBasicProducer() throws DOMDataTreeProducerException, TransactionCommitFailedException { - // Create a producer. It is an AutoCloseable resource, hence the try-with pattern - try (DOMDataTreeProducer prod = service().createProducer(Collections.singleton(UNORDERED_CONTAINER_TREE))) { - assertNotNull(prod); - - final DOMDataWriteTransaction tx = prod.createTransaction(true); - assertNotNull(tx); - - tx.put(LogicalDatastoreType.OPERATIONAL, UNORDERED_CONTAINER_IID, - ImmutableContainerNodeBuilder.create().build()); - - final CheckedFuture f = tx.submit(); - assertNotNull(f); - - f.checkedGet(); - } - } - - // TODO: simple listener -}