X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fsal-netconf-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Fconnect%2Fnetconf%2FLibraryModulesSchemasTest.java;h=32aa12870af321114159838b11f4a6ecf156970d;hb=refs%2Fchanges%2F23%2F39923%2F3;hp=26e48c6f8e1513f3a966dae8815c70680ecd8a96;hpb=990f1c0d249e9f27e192cf6c1300e516ace81087;p=netconf.git diff --git a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/LibraryModulesSchemasTest.java b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/LibraryModulesSchemasTest.java index 26e48c6f8e..32aa12870a 100644 --- a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/LibraryModulesSchemasTest.java +++ b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/LibraryModulesSchemasTest.java @@ -13,10 +13,9 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.Collections; import java.util.Map; -import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.junit.Test; -import org.opendaylight.netconf.sal.connect.netconf.LibraryModulesSchemas; +import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier; import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier; public class LibraryModulesSchemasTest { @@ -41,20 +40,22 @@ public class LibraryModulesSchemasTest { final Map resolvedModulesSchema = libraryModulesSchemas.getAvailableModels(); Assert.assertThat(resolvedModulesSchema.size(), is(3)); - Assert.assertTrue(resolvedModulesSchema.containsKey(new SourceIdentifier("module-with-revision", "2014-04-08"))); + Assert.assertTrue(resolvedModulesSchema.containsKey(RevisionSourceIdentifier.create("module-with-revision", + "2014-04-08"))); Assert.assertThat(resolvedModulesSchema.get( - new SourceIdentifier("module-with-revision", "2014-04-08")), + RevisionSourceIdentifier.create("module-with-revision", "2014-04-08")), is(new URL("http://localhost:8181/yanglib/schemas/module-with-revision/2014-04-08"))); Assert.assertTrue(resolvedModulesSchema.containsKey( - new SourceIdentifier("another-module-with-revision", "2013-10-21"))); + RevisionSourceIdentifier.create("another-module-with-revision", "2013-10-21"))); Assert.assertThat(resolvedModulesSchema.get( - new SourceIdentifier("another-module-with-revision", "2013-10-21")), + RevisionSourceIdentifier.create("another-module-with-revision", "2013-10-21")), is(new URL("http://localhost:8181/yanglib/schemas/another-module-with-revision/2013-10-21"))); - Assert.assertTrue(resolvedModulesSchema.containsKey(new SourceIdentifier("module-without-revision"))); + Assert.assertTrue(resolvedModulesSchema.containsKey( + RevisionSourceIdentifier.create("module-without-revision"))); Assert.assertThat(resolvedModulesSchema.get( - new SourceIdentifier("module-without-revision")), + RevisionSourceIdentifier.create("module-without-revision")), is(new URL("http://localhost:8181/yanglib/schemas/module-without-revision/"))); } @@ -66,10 +67,12 @@ public class LibraryModulesSchemasTest { final Map resolvedModulesSchema = libraryModulesSchemas.getAvailableModels(); Assert.assertThat(resolvedModulesSchema.size(), is(1)); - Assert.assertFalse(resolvedModulesSchema.containsKey(new SourceIdentifier("module-with-bad-url"))); Assert.assertFalse(resolvedModulesSchema.containsKey( - new SourceIdentifier("module-with-bad-revision", "bad-revision"))); - Assert.assertTrue(resolvedModulesSchema.containsKey(new SourceIdentifier("good-ol-module"))); + RevisionSourceIdentifier.create("module-with-bad-url"))); + Assert.assertFalse(resolvedModulesSchema.containsKey( + RevisionSourceIdentifier.create("module-with-bad-revision", "bad-revision"))); + Assert.assertTrue(resolvedModulesSchema.containsKey( + RevisionSourceIdentifier.create("good-ol-module"))); }