X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=dom%2Fmdsal-dom-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fdom%2Fbroker%2FShardedDOMReadTransactionAdapterTest.java;h=02f97585e5fb1253bf2991d3d42436386fc68b24;hb=daa4ba8ad3fcab5719257fdfc3edb4196697cec1;hp=96c1fe3b1a94abce8a0aa7c77e22cbae9a6bb338;hpb=8919f84e08c4230447fa98f4747945a4570c742d;p=mdsal.git diff --git a/dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/ShardedDOMReadTransactionAdapterTest.java b/dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/ShardedDOMReadTransactionAdapterTest.java index 96c1fe3b1a..02f97585e5 100644 --- a/dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/ShardedDOMReadTransactionAdapterTest.java +++ b/dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/ShardedDOMReadTransactionAdapterTest.java @@ -5,20 +5,20 @@ * 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.mdsal.dom.broker; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import com.google.common.base.Optional; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; +import com.google.common.collect.ClassToInstanceMap; +import com.google.common.collect.ImmutableClassToInstanceMap; import com.google.common.util.concurrent.ListenableFuture; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; +import java.util.Optional; +import java.util.concurrent.ExecutionException; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -49,7 +49,7 @@ public class ShardedDOMReadTransactionAdapterTest { } @Test - public void testRead() throws Exception { + public void testRead() throws InterruptedException, ExecutionException { final ListenableFuture>> readResult = readTx.read(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH); assertTrue(readTx.exists(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH).get()); @@ -57,24 +57,22 @@ public class ShardedDOMReadTransactionAdapterTest { } @After - public void close() throws Exception { + public void close() { readTx.close(); } private static class TestTreeService implements DOMDataTreeService { - @Override - public Map, DOMDataTreeServiceExtension> getSupportedExtensions() { - return ImmutableMap.of(); + public ClassToInstanceMap getExtensions() { + return ImmutableClassToInstanceMap.of(); } - @Nonnull @Override public ListenerRegistration - registerListener(@Nonnull final T listener, @Nonnull final Collection subtrees, - final boolean allowRxMerges, - @Nonnull final Collection producers) throws DOMDataTreeLoopException { - final Map> subtree = Maps.newHashMap(); + registerListener(final T listener, final Collection subtrees, + final boolean allowRxMerges, final Collection producers) + throws DOMDataTreeLoopException { + final Map> subtree = new HashMap<>(); subtree.put(new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, TestModel.TEST_PATH), TestUtils.TEST_CONTAINER); @@ -94,10 +92,9 @@ public class ShardedDOMReadTransactionAdapterTest { }; } - @Nonnull @Override - public DOMDataTreeProducer createProducer(@Nonnull final Collection subtrees) { - return null; + public DOMDataTreeProducer createProducer(final Collection subtrees) { + throw new UnsupportedOperationException(); } } -} \ No newline at end of file +}