From: Robert Varga Date: Wed, 14 Mar 2018 14:12:24 +0000 (+0100) Subject: Fix invalid yang models X-Git-Tag: release/fluorine~270 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=6d5b9f5c2e1cdbb0009c42199466485326f14110;p=mdsal.git Fix invalid yang models This patch eliminates bad test models, which use constructs which are not valid YANG identifiers. Change-Id: If0fbf08226d64b76def98421eb4d68e781e97b98 Signed-off-by: Robert Varga --- diff --git a/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/yang/types/TypeProviderTest.java b/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/yang/types/TypeProviderTest.java index 32dd7394e1..187b74a709 100644 --- a/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/yang/types/TypeProviderTest.java +++ b/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/yang/types/TypeProviderTest.java @@ -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"); diff --git a/binding/mdsal-binding-generator-impl/src/test/resources/base-yang-types.yang b/binding/mdsal-binding-generator-impl/src/test/resources/base-yang-types.yang index 4dbd07908f..14daf7acf6 100644 --- a/binding/mdsal-binding-generator-impl/src/test/resources/base-yang-types.yang +++ b/binding/mdsal-binding-generator-impl/src/test/resources/base-yang-types.yang @@ -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 +} diff --git a/binding/mdsal-binding-generator-impl/src/test/resources/test-type-provider.yang b/binding/mdsal-binding-generator-impl/src/test/resources/test-type-provider.yang index e4b47628e3..14eed88289 100644 --- a/binding/mdsal-binding-generator-impl/src/test/resources/test-type-provider.yang +++ b/binding/mdsal-binding-generator-impl/src/test/resources/test-type-provider.yang @@ -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 +} diff --git a/binding/mdsal-binding-test-model/src/main/yang/opendaylight-default-value-test.yang b/binding/mdsal-binding-test-model/src/main/yang/opendaylight-default-value-test.yang index ee467480c4..ddbca7f6f3 100644 --- a/binding/mdsal-binding-test-model/src/main/yang/opendaylight-default-value-test.yang +++ b/binding/mdsal-binding-test-model/src/main/yang/opendaylight-default-value-test.yang @@ -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 +} diff --git a/binding2/mdsal-binding2-generator-impl/src/test/resources/anydata/test-anydata.yang b/binding2/mdsal-binding2-generator-impl/src/test/resources/anydata/test-anydata.yang index 1600e7ec45..e6b2897734 100644 --- a/binding2/mdsal-binding2-generator-impl/src/test/resources/anydata/test-anydata.yang +++ b/binding2/mdsal-binding2-generator-impl/src/test/resources/anydata/test-anydata.yang @@ -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 +} diff --git a/binding2/mdsal-binding2-generator-impl/src/test/resources/anyxml/test-anyxml.yang b/binding2/mdsal-binding2-generator-impl/src/test/resources/anyxml/test-anyxml.yang index 90a3915ef9..a9567374f2 100644 --- a/binding2/mdsal-binding2-generator-impl/src/test/resources/anyxml/test-anyxml.yang +++ b/binding2/mdsal-binding2-generator-impl/src/test/resources/anyxml/test-anyxml.yang @@ -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 +} diff --git a/binding2/mdsal-binding2-generator-impl/src/test/resources/base/with_import/test-typedef-with-import.yang b/binding2/mdsal-binding2-generator-impl/src/test/resources/base/with_import/test-typedef-with-import.yang index db5caab4f6..a8e18bad46 100644 --- a/binding2/mdsal-binding2-generator-impl/src/test/resources/base/with_import/test-typedef-with-import.yang +++ b/binding2/mdsal-binding2-generator-impl/src/test/resources/base/with_import/test-typedef-with-import.yang @@ -12,6 +12,6 @@ module test { type int8; } - container *my-cont { + container .my-cont { } -} \ No newline at end of file +} diff --git a/binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test-typedef.yang b/binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test-typedef.yang index 152907871e..59cd7ee929 100644 --- a/binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test-typedef.yang +++ b/binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test-typedef.yang @@ -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 +} diff --git a/binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test.yang b/binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test.yang index 8ca7abdd41..b31c46b0de 100644 --- a/binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test.yang +++ b/binding2/mdsal-binding2-generator-impl/src/test/resources/generator/test.yang @@ -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 +} diff --git a/binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-import.yang b/binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-import.yang index a6954c02e6..5e4fa39879 100644 --- a/binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-import.yang +++ b/binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-import.yang @@ -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 +} diff --git a/binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-typedef-with-import.yang b/binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-typedef-with-import.yang index db5caab4f6..ee2d8a9559 100644 --- a/binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-typedef-with-import.yang +++ b/binding2/mdsal-binding2-java-api-generator/src/test/resources/base/with_import/test-typedef-with-import.yang @@ -12,6 +12,6 @@ module test { type int8; } - container *my-cont { + container _.my-cont { } -} \ No newline at end of file +}