BUG-9043: Remove use of CheckedFuture from YANG components
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / repo / SharedSchemaRepositoryTest.java
index 8bbbd7e1ac10c8c01a3a2d83a88b137854341b5f..93ea3cd3c9d694e99e237c0fc55c8a66063ce220 100644 (file)
@@ -26,7 +26,6 @@ import com.google.common.base.MoreObjects.ToStringHelper;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 import com.google.common.io.Files;
-import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -47,7 +46,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException;
 import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactory;
-import org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
@@ -167,12 +165,12 @@ public class SharedSchemaRepositoryTest {
         final Throwable ex = new IllegalStateException("failed schema");
         remoteInetTypesYang.setException(ex);
 
-        final CheckedFuture<SchemaContext, SchemaResolutionException> schemaContextFuture =
-                fact.createSchemaContext(ImmutableList.of(remoteInetTypesYang.getId()));
+        final ListenableFuture<SchemaContext> schemaContextFuture = fact.createSchemaContext(
+            ImmutableList.of(remoteInetTypesYang.getId()));
 
         try {
-            schemaContextFuture.checkedGet();
-        } catch (final SchemaResolutionException e) {
+            schemaContextFuture.get();
+        } catch (final ExecutionException e) {
             assertNotNull(e.getCause());
             assertNotNull(e.getCause().getCause());
             assertSame(ex, e.getCause().getCause());
@@ -274,7 +272,7 @@ public class SharedSchemaRepositoryTest {
 
         final SourceIdentifier runningId = RevisionSourceIdentifier.create("running", Optional.of("2012-12-12"));
 
-        sharedSchemaRepository.registerSchemaSource(sourceIdentifier -> Futures.immediateCheckedFuture(
+        sharedSchemaRepository.registerSchemaSource(sourceIdentifier -> Futures.immediateFuture(
             new YangTextSchemaSource(runningId) {
                 @Override
                 protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {