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;
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;
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());
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) {