X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Ftest%2Futil%2FMockSchemaService.java;h=df192a75cb633470a6056c7fe9ed1eb5e7b87e9d;hb=f99bc16b0122d2e0577033c76207d358311f1d99;hp=c8acbcd994352d80c85d51c15035fb706af9251d;hpb=f0f2ca29ae8b5caa769a77854fc5ac883b0a2264;p=controller.git 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 c8acbcd994..df192a75cb 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,25 +7,21 @@ */ 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.SchemaServiceListener; +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 { +public final class MockSchemaService implements DOMSchemaService, SchemaContextProvider { private SchemaContext schemaContext; - ListenerRegistry listeners = ListenerRegistry.create(); - - @Override - public void addModule(final Module module) { - throw new UnsupportedOperationException(); - } + ListenerRegistry listeners = ListenerRegistry.create(); @Override public synchronized SchemaContext getGlobalContext() { @@ -38,25 +34,25 @@ public final class MockSchemaService implements SchemaService, SchemaContextProv } @Override - public ListenerRegistration registerSchemaServiceListener( - final SchemaServiceListener listener) { + public ListenerRegistration registerSchemaContextListener( + final SchemaContextListener listener) { return listeners.register(listener); } @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); } } -} \ No newline at end of file +}