*/
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 {
+public final class MockSchemaService implements DOMSchemaService, SchemaContextProvider {
private SchemaContext schemaContext;
ListenerRegistry<SchemaContextListener> listeners = ListenerRegistry.create();
- @Override
- public void addModule(final Module module) {
- throw new UnsupportedOperationException();
- }
-
@Override
public synchronized SchemaContext getGlobalContext() {
return schemaContext;
}
@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<DOMSchemaServiceExtension> getExtensions() {
+ return ImmutableClassToInstanceMap.of();
}
public synchronized void changeSchema(final SchemaContext newContext) {
schemaContext = newContext;
- for (ListenerRegistration<SchemaContextListener> listener : listeners) {
+ for (ListenerRegistration<? extends SchemaContextListener> listener : listeners.getRegistrations()) {
listener.getInstance().onGlobalContextUpdated(schemaContext);
}
}