Fix invalid yang models 53/69553/3
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 14 Mar 2018 14:12:24 +0000 (15:12 +0100)
committerTom Pantelis <tompantelis@gmail.com>
Sat, 17 Mar 2018 11:41:47 +0000 (11:41 +0000)
This patch eliminates bad test models, which use constructs which
are not valid YANG identifiers.

Change-Id: If0fbf08226d64b76def98421eb4d68e781e97b98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/yang/types/TypeProviderTest.java
binding/mdsal-binding-generator-impl/src/test/resources/base-yang-types.yang
binding/mdsal-binding-generator-impl/src/test/resources/test-type-provider.yang
binding/mdsal-binding-test-model/src/main/yang/opendaylight-default-value-test.yang
binding2/mdsal-binding2-generator-impl/src/test/resources/anydata/test-anydata.yang
binding2/mdsal-binding2-generator-impl/src/test/resources/anyxml/test-anyxml.yang
binding2/mdsal-binding2-generator-impl/src/test/resources/base/with_import/test-typedef-with-import.yang
binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test-typedef.yang
binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test.yang
binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-import.yang
binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-typedef-with-import.yang

index 32dd7394e1584f3affc82f3911997584b0c7d270..187b74a709ab48608ced8100edcc2b14981dc8dd 100644 (file)
@@ -926,14 +926,14 @@ public class TypeProviderTest {
         result = provider.getTypeDefaultConstruction(leaf);
         assertNotNull(result);
         assertTrue(!result.isEmpty());
-        assertEquals("new org.opendaylight.yang.gen.v1.urn.opendaylight.org.test.type.provider.model.rev140912.TestTypeProviderData.RootBitsLeaf(false, true, false)",
+        assertEquals("new org.opendaylight.yang.gen.v1.urn.opendaylight.org.test.type.provider.model.rev140912.TestTypeProviderData.RootBitsLeaf(true, false, false)",
             result);
 
         leaf = provideLeafForGetDefaultConstructionTestCase("yang-bits");
-        result = provider.getTypeDefaultConstruction(leaf, "10-Mb-only");
+        result = provider.getTypeDefaultConstruction(leaf, "only-10-Mb");
         assertNotNull(result);
         assertTrue(!result.isEmpty());
-        assertEquals("new org.opendaylight.yang.gen.v1.urn.opendaylight.org.test.base.yang.types.rev140914.YangBits(true, false, false)",
+        assertEquals("new org.opendaylight.yang.gen.v1.urn.opendaylight.org.test.base.yang.types.rev140914.YangBits(false, false, true)",
             result);
 
         leaf = provideLeafForGetDefaultConstructionTestCase("bar-id");
index 4dbd07908f0d8026ef2a51444609714090a73201..14daf7acf61829b823c553fc0fc342326780a117 100644 (file)
@@ -98,7 +98,7 @@ module base-yang-types {
             bit auto-sense-speed {
                 position 1;
             }
-            bit 10-Mb-only {
+            bit only-10-Mb {
                 position 2;
             }
         }
@@ -108,4 +108,4 @@ module base-yang-types {
     typedef yang-instance-identifier {
         type instance-identifier;
     }
-}
\ No newline at end of file
+}
index e4b47628e349ad01c45f4eb3ab555c26f11c8bf4..14eed88289f724f88d4d7906e9adb1c66fceea0a 100644 (file)
@@ -291,7 +291,7 @@ module test-type-provider {
             bit auto-sense-speed {
                 position 1;
             }
-            bit 10-Mb-only {
+            bit only-10-Mb {
                 position 2;
             }
         }
@@ -305,4 +305,4 @@ module test-type-provider {
         }
         default "256";
     }
-}
\ No newline at end of file
+}
index ee467480c4c916f31cc29570cb5b75e8c039bf61..ddbca7f6f3638befab11a01b61a23264c5c1da82 100644 (file)
@@ -618,7 +618,7 @@ module opendaylight-default-value-test {
                 bit auto-sense-speed {
                     position 1;
                 }
-                bit 10-Mb-only {
+                bit only-10-Mb {
                     position 2;
                 }
             }
@@ -674,4 +674,4 @@ module opendaylight-default-value-test {
             default invalid-prefix:my-derived-imported-identity;
         }
     }
-}
\ No newline at end of file
+}
index 1600e7ec45622d3729064f3099ba532922561505..e6b289773429d8433e21fbbb6d95af3e75eb78fd 100644 (file)
@@ -6,7 +6,7 @@ module test-anydata {
     organization "test.org";
     revision "2017-06-08";
 
-    container *my-cont {
+    container .my-cont {
       container my-inner-cont {
         leaf my-leaf {
           type string;
@@ -21,4 +21,4 @@ module test-anydata {
     anydata root-anydata {
        description "I am root anydata";
     }
-}
\ No newline at end of file
+}
index 90a3915ef919602d83ebae00720edd1550c42f21..a9567374f25ab1c53cd268e8e58b0c6e4d1ad024 100644 (file)
@@ -6,7 +6,7 @@ module test-anyxml {
     organization "test.org";
     revision "2017-06-07";
 
-    container *my-cont {
+    container .my-cont {
       container my-inner-cont {
         leaf my-leaf {
           type string;
@@ -21,4 +21,4 @@ module test-anyxml {
     anyxml root-anyxml {
        description "I am root anyxml";
     }
-}
\ No newline at end of file
+}
index db5caab4f6fa4d5b04596cadbcea0738c74c6d87..a8e18bad464362ce7e7f2536ce1956f3556adca7 100644 (file)
@@ -12,6 +12,6 @@ module test {
         type int8;
     }
 
-    container *my-cont {
+    container .my-cont {
     }
-}
\ No newline at end of file
+}
index 152907871e349170059dedf4d95e7213f3da3002..59cd7ee9299679d71ca18812b765102a71434b89 100644 (file)
@@ -10,7 +10,7 @@ module test {
       type int8;
     }
 
-    container *my-cont {
+    container _.my-cont {
       container my-inner-cont {
         leaf my-leaf {
           type string;
@@ -32,7 +32,7 @@ module test {
     }
 
     grouping my-grouping {
-      container *my-cont {
+      container _.my-cont {
       }
     }
-}
\ No newline at end of file
+}
index 8ca7abdd41126a6ebebc865d9fa3e260e163a900..b31c46b0de7b0f084a9423433fc71b7f1fbbdc4b 100644 (file)
@@ -6,6 +6,6 @@ module test {
     organization "test.org";
     revision "2017-02-06";
 
-    container *my-cont {
+    container _.my-cont {
     }
-}
\ No newline at end of file
+}
index a6954c02e6d6b528058a0bb03ee8f2ec41f2c661..5e4fa39879021d6c66281580cf69cae3585a7e48 100644 (file)
@@ -6,9 +6,9 @@ module test-import {
 
     revision 2017-04-21;
 
-    container *my-import-%cont {
+    container _.my-import-.cont {
         leaf test-leaf {
             type string;
         }
     }
-}
\ No newline at end of file
+}
index db5caab4f6fa4d5b04596cadbcea0738c74c6d87..ee2d8a9559601809f5a71e7f7dce76e8c2f18ba4 100644 (file)
@@ -12,6 +12,6 @@ module test {
         type int8;
     }
 
-    container *my-cont {
+    container _.my-cont {
     }
-}
\ No newline at end of file
+}