<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-repo-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>odlext-model-api</artifactId>
<artifactId>yang-parser-rfc7950</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-repo-api</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-xpath-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.odlext.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.odlext.parser.support {
+ exports org.opendaylight.yangtools.odlext.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.odlext.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
.build();
final var foo = reactor.newBuild()
- .addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource("/yang-ext.yang")))
- .addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ctxref.yang")))
+ .addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ ContextReferenceTest.class, "/yang-ext.yang")))
+ .addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ ContextReferenceTest.class, "/ctxref.yang")))
.buildEffective()
.getModuleStatements()
.get(FOO);
new MountStatementSupport(YangParserConfiguration.DEFAULT))
.build();
final var foo = reactor.newBuild()
- .addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource("/yang-ext.yang")))
- .addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource("/mount.yang")))
+ .addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ MountTest.class, "/yang-ext.yang")))
+ .addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ MountTest.class, "/mount.yang")))
.buildEffective()
.getModuleStatements()
.get(FOO);
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.openconfig.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.openconfig.parser.support {
+ exports org.opendaylight.yangtools.openconfig.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.openconfig.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
- <artifactId>rfc6241-model-api</artifactId>
+ <artifactId>yang-repo-api</artifactId>
</dependency>
-
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-repo-api</artifactId>
- <scope>test</scope>
+ <artifactId>rfc6241-model-api</artifactId>
</dependency>
+
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-reactor</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.rfc6241.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.rfc6241.parser.support {
+ exports org.opendaylight.yangtools.rfc6241.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.rfc6241.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
.build();
final var context = reactor.newBuild()
.addLibSources(YangStatementStreamSource.create(
- YangTextSchemaSource.forResource("/ietf-inet-types@2013-07-15.yang")))
+ YangTextSchemaSource.forResource(NetconfTest.class, "/ietf-inet-types@2013-07-15.yang")))
.addSource(YangStatementStreamSource.create(
- YangTextSchemaSource.forResource("/ietf-netconf@2011-06-01.yang")))
+ YangTextSchemaSource.forResource(NetconfTest.class, "/ietf-netconf@2011-06-01.yang")))
.buildEffective();
final var module = context.findModule(NetconfConstants.RFC6241_MODULE).orElseThrow();
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-repo-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>rfc6536-model-api</artifactId>
<artifactId>yang-parser-rfc7950</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-repo-api</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-xpath-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.rfc6536.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.rfc6536.parser.support {
+ exports org.opendaylight.yangtools.rfc6536.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.rfc6536.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
final var context = reactor.newBuild()
.addSources(
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-netconf-acm@2012-02-22.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-yang-types@2013-07-15.yang")))
+ YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(NACMTest.class, "/ietf-netconf-acm@2012-02-22.yang")),
+ YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(NACMTest.class, "/ietf-yang-types@2013-07-15.yang")))
.buildEffective();
final var module = context.findModule(NACMConstants.RFC6536_MODULE).orElseThrow();
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-repo-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>rfc6643-model-api</artifactId>
<artifactId>yang-parser-rfc7950</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-repo-api</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-xpath-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.rfc6643.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.rfc6643.parser.support {
+ exports org.opendaylight.yangtools.rfc6643.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.rfc6643.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-repo-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>rfc7952-model-api</artifactId>
<artifactId>yang-parser-rfc7950</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-repo-api</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-xpath-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.rfc7952.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.rfc7952.parser.support {
+ exports org.opendaylight.yangtools.rfc7952.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.rfc7952.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.ri;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
import org.opendaylight.yangtools.yang.parser.spi.meta.BoundStmtCtx;
import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport.StatementPolicy;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
new AnnotationStatementSupport(YangParserConfiguration.DEFAULT))
.build();
final var context = reactor.newBuild()
- .addSources(YangStatementStreamSource.create(
- YangTextSchemaSource.forResource("/ietf-yang-metadata@2016-08-05.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/example-last-modified.yang")))
+ .addSources(
+ YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(AnnotationTest.class, "/ietf-yang-metadata@2016-08-05.yang")),
+ YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(AnnotationTest.class, "/example-last-modified.yang")))
.buildEffective();
final var annotations = AnnotationSchemaNode.findAll(context);
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.rfc8040.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.rfc8040.parser.support {
+ exports org.opendaylight.yangtools.rfc8040.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.rfc8040.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
static StatementStreamSource sourceForResource(final String resourceName) {
try {
- return YangStatementStreamSource.create(YangTextSchemaSource.forResource(resourceName));
+ return YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(AbstractYangDataTest.class, resourceName));
} catch (IOException | YangSyntaxErrorException e) {
throw new IllegalArgumentException("Failed to create source", e);
}
}
-
}
@Test
void testAddedLeaves() throws Exception {
final var restconf = assertInstanceOf(ContainerEffectiveStatement.class, REACTOR.newBuild()
- .addSources(IETF_RESTCONF_MODULE, sourceForResource("/yt1338/foo.yang"))
+ .addSources(IETF_RESTCONF_MODULE, sourceForResource("/yt1338.yang"))
.buildEffective()
.findModuleStatement(YangDataConstants.RFC8040_MODULE)
.orElseThrow()
.orElseThrow()
.findFirstEffectiveSubstatement(LeafEffectiveStatement.class)
.orElseThrow();
- assertEquals(QName.create("foo", "foo"), leaf.argument());
+ assertEquals(QName.create("yt1338", "foo"), leaf.argument());
assertEquals(StatementOrigin.CONTEXT, leaf.statementOrigin());
assertNull(leaf.getDeclared());
--- /dev/null
+module yt1338 {
+ namespace yt1338;
+ prefix yt1338;
+
+ rpc foo;
+}
+++ /dev/null
-module foo {
- namespace foo;
- prefix foo;
-
- rpc foo;
-}
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-repo-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>rfc8528-model-api</artifactId>
<artifactId>yang-parser-rfc7950</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-repo-api</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-xpath-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.rfc8528.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.rfc8528.parser.support {
+ exports org.opendaylight.yangtools.rfc8528.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.rfc8528.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
final var context = reactor.newBuild()
.addLibSources(
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-inet-types@2013-07-15.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource(
- "/ietf-yang-schema-mount@2019-01-14.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-yang-types@2013-07-15.yang")))
+ YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(MountPointTest.class, "/ietf-inet-types@2013-07-15.yang")),
+ YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(MountPointTest.class, "/ietf-yang-schema-mount@2019-01-14.yang")),
+ YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(MountPointTest.class, "/ietf-yang-types@2013-07-15.yang")))
.addSources(
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/example-grp.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/example-uses.yang")))
+ YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(MountPointTest.class, "/example-grp.yang")),
+ YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(MountPointTest.class, "/example-uses.yang")))
.buildEffective();
assertEquals(5, context.getModules().size());
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-repo-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>rfc8639-model-api</artifactId>
<artifactId>yang-parser-rfc7950</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-repo-api</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-xpath-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.rfc8639.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.rfc8639.parser.support {
+ exports org.opendaylight.yangtools.rfc8639.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.rfc8639.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
public void testSubscribedNotifications() throws ReactorException, IOException, YangSyntaxErrorException {
final var context = reactor.newBuild()
.addLibSources(
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-inet-types@2013-07-15.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-interfaces@2018-02-20.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-ip@2018-02-22.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-netconf-acm@2018-02-14.yang")),
YangStatementStreamSource.create(YangTextSchemaSource.forResource(
- "/ietf-network-instance@2019-01-21.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-restconf@2017-01-26.yang")),
+ SubscribedNotificationsTest.class, "/ietf-inet-types@2013-07-15.yang")),
YangStatementStreamSource.create(YangTextSchemaSource.forResource(
- "/ietf-yang-schema-mount@2019-01-14.yang")),
- YangStatementStreamSource.create(YangTextSchemaSource.forResource("/ietf-yang-types@2013-07-15.yang")))
+ SubscribedNotificationsTest.class, "/ietf-interfaces@2018-02-20.yang")),
+ YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ SubscribedNotificationsTest.class, "/ietf-ip@2018-02-22.yang")),
+ YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ SubscribedNotificationsTest.class, "/ietf-netconf-acm@2018-02-14.yang")),
+ YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ SubscribedNotificationsTest.class, "/ietf-network-instance@2019-01-21.yang")),
+ YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ SubscribedNotificationsTest.class, "/ietf-restconf@2017-01-26.yang")),
+ YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ SubscribedNotificationsTest.class, "/ietf-yang-schema-mount@2019-01-14.yang")),
+ YangStatementStreamSource.create(YangTextSchemaSource.forResource(
+ SubscribedNotificationsTest.class, "/ietf-yang-types@2013-07-15.yang")))
.addSources(
YangStatementStreamSource.create(YangTextSchemaSource.forResource(
- "/ietf-subscribed-notifications@2019-09-09.yang")))
+ SubscribedNotificationsTest.class, "/ietf-subscribed-notifications@2019-09-09.yang")))
.buildEffective();
final var notifications = context.getModuleStatement(SubscribedNotificationsConstants.RFC8639_MODULE)
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-repo-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>rfc8819-model-api</artifactId>
<artifactId>yang-parser-rfc7950</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-repo-api</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-xpath-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.rfc8819.parser.support</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+module org.opendaylight.yangtools.rfc8819.parser.support {
+ exports org.opendaylight.yangtools.rfc8819.parser;
+
+ requires transitive com.google.common;
+ requires transitive org.opendaylight.yangtools.yang.parser.api;
+ requires transitive org.opendaylight.yangtools.rfc8819.model.api;
+ requires org.opendaylight.yangtools.yang.common;
+ requires org.opendaylight.yangtools.yang.model.api;
+ requires org.opendaylight.yangtools.yang.model.spi;
+ requires org.opendaylight.yangtools.yang.parser.spi;
+ requires org.slf4j;
+
+ // Annotations
+ requires static transitive org.eclipse.jdt.annotation;
+}
+
private static YangStatementStreamSource moduleFromResources(final String resourceName) {
try {
- return YangStatementStreamSource.create(YangTextSchemaSource.forResource(resourceName));
+ return YangStatementStreamSource.create(
+ YangTextSchemaSource.forResource(ModuleTagTest.class, resourceName));
} catch (final YangSyntaxErrorException | IOException e) {
throw new IllegalStateException("Failed to find resource " + resourceName, e);
}