X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Ftest%2Futil%2FMockSchemaService.java;h=5ec8aa80340171d9d1ba3a951962008df98cf8d2;hp=63a4ffb23a3930d4830ea3e300c168578172c39c;hb=3ec97cd0a86ad1b79f6854dc6924eb7b06e359a3;hpb=eb887b1c2c8cd2768f8b4c2ed2b5054f97798466 diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java index 63a4ffb23a..5ec8aa8034 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java @@ -7,26 +7,23 @@ */ package org.opendaylight.controller.sal.binding.test.util; -import org.opendaylight.controller.sal.core.api.model.SchemaService; -import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider; +import com.google.common.collect.ClassToInstanceMap; +import com.google.common.collect.ImmutableClassToInstanceMap; +import org.opendaylight.mdsal.dom.api.DOMSchemaService; +import org.opendaylight.mdsal.dom.api.DOMSchemaServiceExtension; import org.opendaylight.yangtools.concepts.ListenerRegistration; -import org.opendaylight.yangtools.concepts.util.ListenerRegistry; -import org.opendaylight.yangtools.yang.model.api.Module; +import org.opendaylight.yangtools.util.ListenerRegistry; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.api.SchemaContextListener; +import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider; -@SuppressWarnings("deprecation") -public final class MockSchemaService implements SchemaService, SchemaContextProvider { +@Deprecated +public final class MockSchemaService implements DOMSchemaService, SchemaContextProvider { private SchemaContext schemaContext; ListenerRegistry listeners = ListenerRegistry.create(); - @Override - public void addModule(final Module module) { - throw new UnsupportedOperationException(); - } - @Override public synchronized SchemaContext getGlobalContext() { return schemaContext; @@ -44,18 +41,18 @@ public final class MockSchemaService implements SchemaService, SchemaContextProv } @Override - public void removeModule(final Module module) { - throw new UnsupportedOperationException(); + public synchronized SchemaContext getSchemaContext() { + return schemaContext; } @Override - public synchronized SchemaContext getSchemaContext() { - return schemaContext; + public ClassToInstanceMap getExtensions() { + return ImmutableClassToInstanceMap.of(); } public synchronized void changeSchema(final SchemaContext newContext) { schemaContext = newContext; - for (ListenerRegistration listener : listeners) { + for (ListenerRegistration listener : listeners.getRegistrations()) { listener.getInstance().onGlobalContextUpdated(schemaContext); } }