2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.dom.adapter.test.util;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.mdsal.binding.runtime.api.ModuleInfoSnapshot;
12 import org.opendaylight.yangtools.util.ClassLoaderUtils;
13 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
14 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
15 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
17 public final class TestingModuleInfoSnapshot implements ModuleInfoSnapshot {
18 public static final TestingModuleInfoSnapshot INSTANCE = new TestingModuleInfoSnapshot();
20 private TestingModuleInfoSnapshot() {
25 public EffectiveModelContext getEffectiveModelContext() {
26 throw new UnsupportedOperationException();
30 public ListenableFuture<? extends YangTextSchemaSource> getSource(SourceIdentifier sourceIdentifier) {
31 throw new UnsupportedOperationException();
35 @SuppressWarnings("unchecked")
36 public <T> Class<T> loadClass(String fullyQualifiedName) throws ClassNotFoundException {
37 return (Class<T>) ClassLoaderUtils.loadClassWithTCCL(fullyQualifiedName);