Remove deprecated SchemaRepository.createSchemaContextFactory()
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / repo / SharedSchemaRepositoryWithFeaturesTest.java
index 0312047ff8f1abe3558a0bb52a77f1c599073fef..f6832e463a92996825226316bff2037bd2bd6626 100644 (file)
@@ -24,28 +24,25 @@ import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 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());
@@ -79,14 +76,12 @@ public class SharedSchemaRepositoryWithFeaturesTest {
         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());
@@ -125,14 +120,12 @@ public class SharedSchemaRepositoryWithFeaturesTest {
         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());