X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-parser-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Frepo%2FSharedSchemaRepositoryTest.java;h=f9dff888633ea5be2aefeda2488fc485ede15044;hb=a84f141fe3633d5380ca1fb8b41afc4cd770dcfd;hp=b8fca69ffb9d05f56c1606aca8e6622099586372;hpb=e403e34bcb508c48aa606a1cd81a386fb73c5db6;p=yangtools.git diff --git a/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaRepositoryTest.java b/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaRepositoryTest.java index b8fca69ffb..f9dff88863 100644 --- a/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaRepositoryTest.java +++ b/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaRepositoryTest.java @@ -21,9 +21,6 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier; - -import com.google.common.base.Charsets; import com.google.common.base.Function; import com.google.common.base.MoreObjects; import com.google.common.base.Optional; @@ -37,12 +34,14 @@ import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; import java.util.concurrent.ExecutionException; import org.junit.Test; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException; +import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier; import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactory; import org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException; import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException; @@ -226,16 +225,16 @@ public class SharedSchemaRepositoryTest { sharedSchemaRepository.registerSchemaSourceListener(listener); final File test = new File(storageDir, "test.yang"); - Files.write("content-test", test, Charsets.UTF_8); + Files.write("content-test", test, StandardCharsets.UTF_8); final File test2 = new File(storageDir, "test@2012-12-12.yang"); - Files.write("content-test-2012", test2, Charsets.UTF_8); + Files.write("content-test-2012", test2, StandardCharsets.UTF_8); final File test3 = new File(storageDir, "test@2013-12-12.yang"); - Files.write("content-test-2013", test3, Charsets.UTF_8); + Files.write("content-test-2013", test3, StandardCharsets.UTF_8); final File test4 = new File(storageDir, "module@2010-12-12.yang"); - Files.write("content-module-2010", test4, Charsets.UTF_8); + Files.write("content-module-2010", test4, StandardCharsets.UTF_8); final FilesystemSchemaSourceCache cache = new FilesystemSchemaSourceCache<>(sharedSchemaRepository, YangTextSchemaSource.class, storageDir); @@ -243,12 +242,8 @@ public class SharedSchemaRepositoryTest { assertEquals(4, listener.registeredSources.size()); - final Function, SourceIdentifier> potSourceToSID = new Function, SourceIdentifier>() { - @Override - public SourceIdentifier apply(final PotentialSchemaSource input) { - return input.getSourceIdentifier(); - } - }; + final Function, SourceIdentifier> potSourceToSID = + PotentialSchemaSource::getSourceIdentifier; assertThat(Collections2.transform(listener.registeredSources, potSourceToSID), both(hasItem(RevisionSourceIdentifier.create("test", Optional.absent()))) .and(hasItem(RevisionSourceIdentifier.create("test", Optional.of("2012-12-12")))) @@ -279,7 +274,7 @@ public class SharedSchemaRepositoryTest { @Override public InputStream openStream() throws IOException { - return new ByteArrayInputStream("running".getBytes(Charsets.UTF_8)); + return new ByteArrayInputStream("running".getBytes(StandardCharsets.UTF_8)); } }); }