- SchemaContext parseTestSchema(final String... yangPath) throws IOException, YangSyntaxErrorException {
- YangParserImpl yangParserImpl = new YangParserImpl();
- return yangParserImpl.parseSources(getTestYangs(yangPath));
- }
-
- List<ByteSource> getTestYangs(final String... yangPaths) {
-
- return Lists.newArrayList(Collections2.transform(Lists.newArrayList(yangPaths),
- new Function<String, ByteSource>() {
- @Override
- public ByteSource apply(final String input) {
- ByteSource resourceAsStream = Resources.asByteSource(getClass().getResource(input));
- Preconditions.checkNotNull(resourceAsStream, "File %s was null", resourceAsStream);
- return resourceAsStream;
- }
- }));
- }
-