Do not generate 'isFoo()' methods
[mdsal.git] / dom / mdsal-dom-broker / src / test / java / org / opendaylight / mdsal / dom / broker / ShardedDOMReadTransactionAdapterTest.java
index 96c1fe3b1a94abce8a0aa7c77e22cbae9a6bb338..02f97585e5fb1253bf2991d3d42436386fc68b24 100644 (file)
@@ -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<Optional<NormalizedNode<?, ?>>> 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<Class<? extends DOMDataTreeServiceExtension>, DOMDataTreeServiceExtension> getSupportedExtensions() {
-            return ImmutableMap.of();
+        public ClassToInstanceMap<DOMDataTreeServiceExtension> getExtensions() {
+            return ImmutableClassToInstanceMap.of();
         }
 
-        @Nonnull
         @Override
         public <T extends DOMDataTreeListener> ListenerRegistration<T>
-            registerListener(@Nonnull final T listener, @Nonnull final Collection<DOMDataTreeIdentifier> subtrees,
-                         final boolean allowRxMerges,
-                         @Nonnull final Collection<DOMDataTreeProducer> producers) throws DOMDataTreeLoopException {
-            final Map<DOMDataTreeIdentifier, NormalizedNode<?, ?>> subtree = Maps.newHashMap();
+            registerListener(final T listener, final Collection<DOMDataTreeIdentifier> subtrees,
+                    final boolean allowRxMerges, final Collection<DOMDataTreeProducer> producers)
+                            throws DOMDataTreeLoopException {
+            final Map<DOMDataTreeIdentifier, NormalizedNode<?, ?>> 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<DOMDataTreeIdentifier> subtrees) {
-            return null;
+        public DOMDataTreeProducer createProducer(final Collection<DOMDataTreeIdentifier> subtrees) {
+            throw new UnsupportedOperationException();
         }
     }
-}
\ No newline at end of file
+}