Convert parser extensions into JPMS modules 94/108094/3
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 1 Oct 2023 16:04:11 +0000 (18:04 +0200)
committerRobert Varga <nite@hq.sk>
Sun, 1 Oct 2023 22:37:01 +0000 (22:37 +0000)
These are some of of the final pieces of conversion, perform the trivial
conversion.

Change-Id: I9e2f08b428948faec8949fae175d0f04ee7c9484
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
33 files changed:
parser/odlext-parser-support/pom.xml
parser/odlext-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/odlext-parser-support/src/test/java/org/opendaylight/yangtools/odlext/parser/ContextReferenceTest.java
parser/odlext-parser-support/src/test/java/org/opendaylight/yangtools/odlext/parser/MountTest.java
parser/openconfig-parser-support/pom.xml
parser/openconfig-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/rfc6241-parser-support/pom.xml
parser/rfc6241-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/rfc6241-parser-support/src/test/java/org/opendaylight/yangtools/rfc6241/parser/NetconfTest.java
parser/rfc6536-parser-support/pom.xml
parser/rfc6536-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/rfc6536-parser-support/src/test/java/org/opendaylight/yangtools/rfc6536/parser/NACMTest.java
parser/rfc6643-parser-support/pom.xml
parser/rfc6643-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/rfc7952-parser-support/pom.xml
parser/rfc7952-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/rfc7952-parser-support/src/main/java/org/opendaylight/yangtools/rfc7952/parser/AnnotationStatementSupport.java
parser/rfc7952-parser-support/src/test/java/org/opendaylight/yangtools/rfc7952/parser/AnnotationTest.java
parser/rfc8040-parser-support/pom.xml
parser/rfc8040-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/rfc8040-parser-support/src/test/java/org/opendaylight/yangtools/rfc8040/parser/AbstractYangDataTest.java
parser/rfc8040-parser-support/src/test/java/org/opendaylight/yangtools/rfc8040/parser/YT1338Test.java
parser/rfc8040-parser-support/src/test/resources/yt1338.yang [new file with mode: 0644]
parser/rfc8040-parser-support/src/test/resources/yt1338/foo.yang [deleted file]
parser/rfc8528-parser-support/pom.xml
parser/rfc8528-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/rfc8528-parser-support/src/test/java/org/opendaylight/yangtools/rfc8528/parser/MountPointTest.java
parser/rfc8639-parser-support/pom.xml
parser/rfc8639-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/rfc8639-parser-support/src/test/java/org/opendaylight/yangtools/rfc8639/parser/SubscribedNotificationsTest.java
parser/rfc8819-parser-support/pom.xml
parser/rfc8819-parser-support/src/main/java/module-info.java [new file with mode: 0644]
parser/rfc8819-parser-support/src/test/java/org/opendaylight/yangtools/rfc8819/parser/ModuleTagTest.java

index 5f119a533a82870150d50f5cfa881e3cb31886d3..1af206200701d6b9b72a68d454451f9102669157 100644 (file)
             <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>
diff --git a/parser/odlext-parser-support/src/main/java/module-info.java b/parser/odlext-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..4ca2a87
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+}
+
index df42d4543161914b6b422b5ea20683a95a8ca94c..cfe0b54f5e4ee64a85b06c23399169723134b2b3 100644 (file)
@@ -42,8 +42,10 @@ class ContextReferenceTest {
             .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);
index 68d72b32d2cffa4e42f1363304d1d9cb12cb9eaf..8668f49ebda623c5ab3a1dc1912eb1626e21b3e9 100644 (file)
@@ -30,8 +30,10 @@ class MountTest {
                 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);
index 7145dda15f7f28196c224d6640def02a0e506fae..b7c54645773b3b0917dbf262eb451974ef10549a 100644 (file)
             <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>
diff --git a/parser/openconfig-parser-support/src/main/java/module-info.java b/parser/openconfig-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..ce06ecc
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+}
+
index baf59e1e7c90d88b32aa1e30a1c0256059585b50..4b6d60f89aaf264078fe771427cc507594be5f95 100644 (file)
         </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>
diff --git a/parser/rfc6241-parser-support/src/main/java/module-info.java b/parser/rfc6241-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..8437a56
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+}
+
index 450fc51ce79c54ba27ae118c7fb141d882fc2bfc..44f8b834ceac0536ee28166267b9ebdc88a007da 100644 (file)
@@ -34,9 +34,9 @@ class NetconfTest {
             .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();
index 01faba960dc49be0da46fb372093fad1b607cd91..12ba8bd00977f686ead65c66686ed94e55b114ff 100644 (file)
             <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>
diff --git a/parser/rfc6536-parser-support/src/main/java/module-info.java b/parser/rfc6536-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..6c32f29
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+}
+
index 4204c598159590baa2abe792374ba4faf2d2163d..32e00f1a4a9cd03d8a5e55a5a8dbaa4f5ddc0b8b 100644 (file)
@@ -33,8 +33,10 @@ class NACMTest {
 
         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();
index 46e1864445d3a62eff884aec8587c65ed8706ec9..092c64dadab564ff815ba5913d1a74790d8cb6a3 100644 (file)
             <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>
diff --git a/parser/rfc6643-parser-support/src/main/java/module-info.java b/parser/rfc6643-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..d0bd293
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+}
+
index 5439b7d44af24a086d5d0c36bf400cde86670631..89ce10b9d2976a39a0b6c96812034591ef63efbe 100644 (file)
             <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>
diff --git a/parser/rfc7952-parser-support/src/main/java/module-info.java b/parser/rfc7952-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..efb85ec
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * 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;
+}
+
index 92be01ba0fec3059336d5d16d33a86d506063c86..18b4a94227a5a545aafe3217f61c172fc6b555f6 100644 (file)
@@ -22,7 +22,6 @@ import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
 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;
index 514eeb04d6856807a830e485c0c98f4915a2aeb0..aece6c7023fce8ea56316493b82b7f7d4f3c09ac 100644 (file)
@@ -35,9 +35,11 @@ class AnnotationTest {
                 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);
index 1fd4a53f43a37d1c1ee478dabf5431110a275701..61ff1296a1ba374b5ee0f22f32905277416916fd 100644 (file)
             <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>
diff --git a/parser/rfc8040-parser-support/src/main/java/module-info.java b/parser/rfc8040-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..29b3cc5
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+}
+
index d618910aa10f3730fb6ae38d882a5dc7224deab6..420625ae2210ec86a3da6512dc96336070a0cb77 100644 (file)
@@ -40,10 +40,10 @@ abstract class AbstractYangDataTest {
 
     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);
         }
     }
-
 }
index 180863f82af4fc6c3873e9947f932f488c7367de..0ef7b551e4a793e3b914a3e0ae6c2a383a402984 100644 (file)
@@ -25,7 +25,7 @@ class YT1338Test extends AbstractYangDataTest {
     @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()
@@ -40,7 +40,7 @@ class YT1338Test extends AbstractYangDataTest {
             .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());
 
diff --git a/parser/rfc8040-parser-support/src/test/resources/yt1338.yang b/parser/rfc8040-parser-support/src/test/resources/yt1338.yang
new file mode 100644 (file)
index 0000000..d81aa47
--- /dev/null
@@ -0,0 +1,6 @@
+module yt1338 {
+  namespace yt1338;
+  prefix yt1338;
+
+  rpc foo;
+}
diff --git a/parser/rfc8040-parser-support/src/test/resources/yt1338/foo.yang b/parser/rfc8040-parser-support/src/test/resources/yt1338/foo.yang
deleted file mode 100644 (file)
index 669998c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-module foo {
-  namespace foo;
-  prefix foo;
-
-  rpc foo;
-}
index e781a932af93cb6b01aeec7cba86cf8250b62340..c8be5f94a812c43f209e9b462fba483718aed4ae 100644 (file)
             <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>
diff --git a/parser/rfc8528-parser-support/src/main/java/module-info.java b/parser/rfc8528-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..e88a70b
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+}
+
index 8231b916418870d6c0161f4a5408e5a6d821c4dc..0b327953bcc34202d1e070731c005e7b64321136 100644 (file)
@@ -40,13 +40,17 @@ class MountPointTest {
 
         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());
index 3dc53da3b87d75168378c595dfc98cff66d4d1bb..3b34f4d361119dc302b065a0636b1b1734221709 100644 (file)
             <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>
diff --git a/parser/rfc8639-parser-support/src/main/java/module-info.java b/parser/rfc8639-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..7f66359
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+}
+
index c13d8dc57d465b099e10b30b46c5c189203a8b24..09000fcd89d083c59ee04680036a40ea89d6cf50 100644 (file)
@@ -47,19 +47,25 @@ public class SubscribedNotificationsTest {
     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)
index d14b0de43172cded7557e158e8d68d306ac1df75..62a9dff6344c87dc4cc80f49f6a05e813cb4b41e 100644 (file)
             <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>
diff --git a/parser/rfc8819-parser-support/src/main/java/module-info.java b/parser/rfc8819-parser-support/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..bda1403
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+}
+
index 79a9e88259182efe8350ba3b1e7cc94d7282d1a8..26a7ef629d43992c2835227afb66dc7a65a3f57a 100644 (file)
@@ -89,7 +89,8 @@ public class ModuleTagTest {
 
     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);
         }