Migrate YANG inputs for yang-data-api 35/106035/3
authormatus.matok <matus.matok@pantheon.tech>
Thu, 18 May 2023 13:54:12 +0000 (15:54 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 22 May 2023 10:16:37 +0000 (12:16 +0200)
Migrated all YANG testfiles counting 50 lines or less.

JIRA: YANGTOOLS-1506
Change-Id: Ib274b98ff58e79f2c3a84d222c17c9b2f21b3d99
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
data/yang-data-api/src/test/java/org/opendaylight/yangtools/yang/data/api/schema/stream/YT1433Test.java
data/yang-data-api/src/test/java/org/opendaylight/yangtools/yang/data/api/schema/stream/YangInstanceIdentifierWriterTest.java
data/yang-data-api/src/test/resources/YT1392/augment.yang [deleted file]
data/yang-data-api/src/test/resources/YT1392/test.yang [deleted file]
data/yang-data-api/src/test/resources/YT1433/bar.yang [deleted file]
data/yang-data-api/src/test/resources/YT1433/foo.yang [deleted file]

index 4ba1ae3ecf8eaa88698cf31c920052da1daac777..8ca34ac25990aa0fedcc9e92f70e5f3fb86e7540 100644 (file)
@@ -22,7 +22,35 @@ public class YT1433Test {
 
     @BeforeAll
     public static void beforeAll() {
-        CONTEXT = YangParserTestUtils.parseYangResourceDirectory("/YT1433");
+        CONTEXT = YangParserTestUtils.parseYang("""
+            module foo {
+              namespace foo;
+              prefix foo;
+
+              container foo;
+
+              augment /foo {
+                container bar;
+              }
+
+              augment /foo/bar {
+                container baz;
+              }
+            }""", """
+            module bar {
+              namespace bar;
+              prefix bar;
+
+              choice foo;
+
+              augment /foo {
+                container bar;
+              }
+
+              augment /foo/bar/bar {
+                container baz;
+              }
+            }""");
     }
 
     @Test
index 316b1b3dd52f951dc2816a2fffe618f37e6c855e..cd4b1a6f6de2158057002a2af84871adbbd4095f 100644 (file)
@@ -34,7 +34,53 @@ public class YangInstanceIdentifierWriterTest {
 
     @BeforeAll
     public static void beforeAll() {
-        CONTEXT = YangParserTestUtils.parseYangResourceDirectory("/YT1392");
+        CONTEXT = YangParserTestUtils.parseYang("""
+            module test {
+              namespace test;
+              prefix test;
+
+              container container-1 {
+                container container-2 {
+                  container container-3 {
+                    container payload-container {
+                      leaf payload-leaf {
+                        type string;
+                      }
+                    }
+                  }
+                }
+              }
+
+              choice choice-node {
+                container container-in-case;
+              }
+
+              list list-1 {
+                key list-1-key;
+                leaf list-1-key {
+                  type string;
+                }
+                container container-1;
+              }
+
+              leaf-list list-list {
+                type string;
+              }
+            }""", """
+            module augment {
+              namespace augment-namespace;
+              prefix aug;
+
+              import test {
+                prefix test;
+              }
+
+              augment /test:container-1 {
+                container augmented-container {
+                  container container-2;
+                }
+              }
+            }""");
     }
 
     @Test
diff --git a/data/yang-data-api/src/test/resources/YT1392/augment.yang b/data/yang-data-api/src/test/resources/YT1392/augment.yang
deleted file mode 100644 (file)
index 65a0273..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-module augment {
-  namespace augment-namespace;
-  prefix aug;
-
-  import test {
-    prefix test;
-  }
-
-  augment /test:container-1 {
-    container augmented-container {
-      container container-2;
-    }
-  }
-}
diff --git a/data/yang-data-api/src/test/resources/YT1392/test.yang b/data/yang-data-api/src/test/resources/YT1392/test.yang
deleted file mode 100644 (file)
index 05fa3a8..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-module test {
-  namespace test;
-  prefix test;
-
-  container container-1 {
-    container container-2 {
-      container container-3 {
-        container payload-container {
-          leaf payload-leaf {
-            type string;
-          }
-        }
-      }
-    }
-  }
-
-  choice choice-node {
-    container container-in-case;
-  }
-
-  list list-1 {
-    key list-1-key;
-
-    leaf list-1-key {
-      type string;
-    }
-
-    container container-1;
-  }
-
-  leaf-list list-list {
-    type string;
-  }
-}
diff --git a/data/yang-data-api/src/test/resources/YT1433/bar.yang b/data/yang-data-api/src/test/resources/YT1433/bar.yang
deleted file mode 100644 (file)
index 81ef6d5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-module bar {
-  namespace bar;
-  prefix bar;
-
-  choice foo;
-
-  augment /foo {
-    container bar;
-  }
-
-  augment /foo/bar/bar {
-    container baz;
-  }
-}
diff --git a/data/yang-data-api/src/test/resources/YT1433/foo.yang b/data/yang-data-api/src/test/resources/YT1433/foo.yang
deleted file mode 100644 (file)
index 129bc8b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-module foo {
-  namespace foo;
-  prefix foo;
-
-  container foo;
-
-  augment /foo {
-    container bar;
-  }
-
-  augment /foo/bar {
-    container baz;
-  }
-}