From 3ece0eb9b209975b84495ccfb09aa2a71a058fc7 Mon Sep 17 00:00:00 2001 From: "miroslav.kovac" Date: Wed, 11 Mar 2020 12:55:56 +0100 Subject: [PATCH] Unable to resolve grouping test JIRA MDSAL-531 Change-Id: Icdba0c0babf93ca14f7d81b42cc432eb4455d6e0 Signed-off-by: miroslav.kovac --- .../binding/generator/impl/Mdsal531Test.java | 26 ++++++++++ .../src/test/resources/mdsal-531/bar.yang | 11 ++++ .../src/test/resources/mdsal-531/foo.yang | 50 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/Mdsal531Test.java create mode 100644 binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/bar.yang create mode 100644 binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/foo.yang diff --git a/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/Mdsal531Test.java b/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/Mdsal531Test.java new file mode 100644 index 0000000000..9f95032a37 --- /dev/null +++ b/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/Mdsal531Test.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 + */ +package org.opendaylight.mdsal.binding.generator.impl; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.util.List; +import org.junit.Test; +import org.opendaylight.mdsal.binding.model.api.Type; +import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; + +public class Mdsal531Test extends AbstractOpaqueTest { + @Test + public void augmentGroupingTest() { + final List types = DefaultBindingGenerator.generateFor( + YangParserTestUtils.parseYangResourceDirectory("/mdsal-531")); + assertNotNull(types); + assertEquals(10, types.size()); + } +} diff --git a/binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/bar.yang b/binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/bar.yang new file mode 100644 index 0000000000..f4b68ace9e --- /dev/null +++ b/binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/bar.yang @@ -0,0 +1,11 @@ +module bar { + yang-version 1.1; + namespace "b"; + prefix b; + + container fooo { + leaf baar { + type empty; + } + } +} diff --git a/binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/foo.yang b/binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/foo.yang new file mode 100644 index 0000000000..480310b522 --- /dev/null +++ b/binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/foo.yang @@ -0,0 +1,50 @@ +module foo { + yang-version 1.1; + namespace "a"; + prefix a; + import bar { prefix b;} + + grouping foo { + container bar { + leaf foo { + type string; + } + uses software-operation-state; + } + + grouping software-operation-state { + + leaf bar2 { + type empty; + } + uses next-operation-group; + } + + grouping next-operation-group { + list next-operation { + key order; + config false; + // ui:group-ref "current-operation-group"; + leaf order { + description "A logical sequence number of operations to be done."; + type uint8; + } + + leaf operation-type { + description "Type of software action launched on the device."; + type string; + + } + + leaf software-name { + description "Name of the software on which the operation was performed. For download operations, the leaf only records the software name and not the complete URL."; + type string; + } + } // list next-operation + } + } + + augment "/b:fooo" { + uses a:foo; + } +} -- 2.36.6