X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-inmemory-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FSchemaUpdateForTransactionTest.java;h=9910039e2e187f012b235ea43fb3afb4e64d932a;hp=ee62c0bfbfa8e27d9d2103057aa5173b0e5c4b3d;hb=db89afdefb3cfa4454dfdc6008e1d54d3ede66fb;hpb=f8225a74b7c11db1ebf77ab9de998c2e953f8ed8 diff --git a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaUpdateForTransactionTest.java b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaUpdateForTransactionTest.java index ee62c0bfbf..9910039e2e 100644 --- a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaUpdateForTransactionTest.java +++ b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaUpdateForTransactionTest.java @@ -8,48 +8,45 @@ package org.opendaylight.controller.md.sal.dom.store.impl; import static org.junit.Assert.assertNotNull; - +import com.google.common.base.Throwables; +import com.google.common.util.concurrent.MoreExecutors; import java.util.concurrent.ExecutionException; - import org.junit.Before; import org.junit.Test; import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction; +import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.bi.ba.rpcservice.rev140701.RockTheHouseInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top; -import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext; import org.opendaylight.yangtools.yang.binding.YangModuleInfo; import org.opendaylight.yangtools.yang.binding.util.BindingReflections; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.opendaylight.yangtools.yang.model.api.SchemaContext; -import com.google.common.base.Throwables; -import com.google.common.util.concurrent.MoreExecutors; - public class SchemaUpdateForTransactionTest { - private static final InstanceIdentifier TOP_PATH = InstanceIdentifier.of(Top.QNAME); + private static final YangInstanceIdentifier TOP_PATH = YangInstanceIdentifier.of(Top.QNAME); private SchemaContext schemaContext; private InMemoryDOMDataStore domStore; @Before public void setupStore() { - domStore = new InMemoryDOMDataStore("TEST", MoreExecutors.sameThreadExecutor()); + this.domStore = new InMemoryDOMDataStore("TEST", MoreExecutors.newDirectExecutorService()); loadSchemas(RockTheHouseInput.class); } public void loadSchemas(final Class... classes) { YangModuleInfo moduleInfo; try { - ModuleInfoBackedContext context = ModuleInfoBackedContext.create(); - for (Class clz : classes) { + final ModuleInfoBackedContext context = ModuleInfoBackedContext.create(); + for (final Class clz : classes) { moduleInfo = BindingReflections.getModuleInfo(clz); context.registerModuleInfo(moduleInfo); } - schemaContext = context.tryToCreateSchemaContext().get(); - domStore.onGlobalContextUpdated(schemaContext); - } catch (Exception e) { + this.schemaContext = context.tryToCreateSchemaContext().get(); + this.domStore.onGlobalContextUpdated(this.schemaContext); + } catch (final Exception e) { Throwables.propagateIfPossible(e); } } @@ -71,11 +68,11 @@ public class SchemaUpdateForTransactionTest { @Test public void testTransactionSchemaUpdate() throws InterruptedException, ExecutionException { - assertNotNull(domStore); + assertNotNull(this.domStore); // We allocate transaction, initial schema context does not // contain Lists model - DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction(); + final DOMStoreReadWriteTransaction writeTx = this.domStore.newReadWriteTransaction(); assertNotNull(writeTx); // we trigger schema context update to contain Lists model