import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactory;
-import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceFilter;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.parser.util.ASTSchemaSource;
-import org.opendaylight.yangtools.yang.parser.util.TextToASTTransformer;
+import org.opendaylight.yangtools.yang.parser.rfc7950.repo.ASTSchemaSource;
+import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToASTTransformer;
public class SharedSchemaRepositoryWithFeaturesTest {
@Test
public void testSharedSchemaRepositoryWithSomeFeaturesSupported() throws Exception {
- final Set<QName> supportedFeatures = ImmutableSet.of(QName.create("foobar-namespace", "1970-01-01", "test-feature-1"));
+ final Set<QName> supportedFeatures = ImmutableSet.of(QName.create("foobar-namespace", "test-feature-1"));
final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
"shared-schema-repo-with-features-test");
- final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource
- ("/if-feature-resolution-test/shared-schema-repository/foobar.yang");
+ final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
+ "/if-feature-resolution-test/shared-schema-repository/foobar.yang");
foobar.register(sharedSchemaRepository);
foobar.setResult();
- final SchemaContextFactory fact = sharedSchemaRepository
- .createSchemaContextFactory(SchemaSourceFilter.ALWAYS_ACCEPT);
-
+ final SchemaContextFactory fact = sharedSchemaRepository.createSchemaContextFactory();
final ListenableFuture<SchemaContext> testSchemaContextFuture =
fact.createSchemaContext(ImmutableList.of(foobar.getId()), supportedFeatures);
assertTrue(testSchemaContextFuture.isDone());
final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
"shared-schema-repo-with-features-test");
- final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource
- ("/if-feature-resolution-test/shared-schema-repository/foobar.yang");
+ final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
+ "/if-feature-resolution-test/shared-schema-repository/foobar.yang");
foobar.register(sharedSchemaRepository);
foobar.setResult();
- final SchemaContextFactory fact = sharedSchemaRepository
- .createSchemaContextFactory(SchemaSourceFilter.ALWAYS_ACCEPT);
-
+ final SchemaContextFactory fact = sharedSchemaRepository.createSchemaContextFactory();
final ListenableFuture<SchemaContext> testSchemaContextFuture =
fact.createSchemaContext(ImmutableList.of(foobar.getId()));
assertTrue(testSchemaContextFuture.isDone());
final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
"shared-schema-repo-with-features-test");
- final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource
- ("/if-feature-resolution-test/shared-schema-repository/foobar.yang");
+ final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
+ "/if-feature-resolution-test/shared-schema-repository/foobar.yang");
foobar.register(sharedSchemaRepository);
foobar.setResult();
- final SchemaContextFactory fact = sharedSchemaRepository
- .createSchemaContextFactory(SchemaSourceFilter.ALWAYS_ACCEPT);
-
+ final SchemaContextFactory fact = sharedSchemaRepository.createSchemaContextFactory();
final ListenableFuture<SchemaContext> testSchemaContextFuture =
fact.createSchemaContext(ImmutableList.of(foobar.getId()), supportedFeatures);
assertTrue(testSchemaContextFuture.isDone());