import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.common.Revision;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
assertFalse(schemaService.hasListeners());
final SchemaContextHolder actualSchemaCtx = new SchemaContextHolder();
- final SchemaContextListener listener = actualSchemaCtx::setSchemaContext;
- final ListenerRegistration<SchemaContextListener> registerSchemaContextListener =
+ final EffectiveModelContextListener listener = actualSchemaCtx::setSchemaContext;
+ final ListenerRegistration<EffectiveModelContextListener> registerSchemaContextListener =
schemaService.registerSchemaContextListener(listener);
assertEquals(registerSchemaContextListener.getInstance(), listener);
assertEquals(schemaService.getSchemaContext(), actualSchemaCtx.getSchemaContext());
@Test
public void notifyListenersTest() {
- final SchemaContext baseSchemaCtx = schemaService.getGlobalContext();
+ final EffectiveModelContext baseSchemaCtx = schemaService.getGlobalContext();
assertNotNull(baseSchemaCtx);
assertTrue(baseSchemaCtx.getModules().size() == 1);
final SchemaContextHolder actualSchemaCtx = new SchemaContextHolder();
- final SchemaContextListener schemaCtxListener = actualSchemaCtx::setSchemaContext;
- final ListenerRegistration<SchemaContextListener> registerSchemaContextListener =
+ final EffectiveModelContextListener schemaCtxListener = actualSchemaCtx::setSchemaContext;
+ final ListenerRegistration<EffectiveModelContextListener> registerSchemaContextListener =
schemaService.registerSchemaContextListener(schemaCtxListener);
assertEquals(registerSchemaContextListener.getInstance(), schemaCtxListener);
assertNotNull(actualSchemaCtx.getSchemaContext());
addYang("/empty-test1.yang");
addYangs(schemaService);
- final SchemaContext nextSchemaCtx = schemaService.getGlobalContext();
+ final EffectiveModelContext nextSchemaCtx = schemaService.getGlobalContext();
assertNotNull(nextSchemaCtx);
assertTrue(nextSchemaCtx.getModules().size() == 2);
addYang("/empty-test2.yang");
addYangs(schemaService);
- final SchemaContext unregistredListenerSchemaCtx = schemaService.getGlobalContext();
+ final EffectiveModelContext unregistredListenerSchemaCtx = schemaService.getGlobalContext();
assertNotNull(unregistredListenerSchemaCtx);
assertTrue(unregistredListenerSchemaCtx.getModules().size() == 3);
private class SchemaContextHolder {
- private SchemaContext schemaCtx;
+ private EffectiveModelContext schemaCtx;
- public void setSchemaContext(final SchemaContext ctx) {
+ public void setSchemaContext(final EffectiveModelContext ctx) {
schemaCtx = ctx;
}
- public SchemaContext getSchemaContext() {
+ public EffectiveModelContext getSchemaContext() {
return schemaCtx;
}
}