Unable to resolve grouping test 99/88399/4
authormiroslav.kovac <miroslav.kovac@pantheon.tech>
Wed, 11 Mar 2020 11:55:56 +0000 (12:55 +0100)
committerRobert Varga <nite@hq.sk>
Thu, 9 Apr 2020 20:27:36 +0000 (20:27 +0000)
JIRA MDSAL-531
Change-Id: Icdba0c0babf93ca14f7d81b42cc432eb4455d6e0
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/Mdsal531Test.java [new file with mode: 0644]
binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/bar.yang [new file with mode: 0644]
binding/mdsal-binding-generator-impl/src/test/resources/mdsal-531/foo.yang [new file with mode: 0644]

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 (file)
index 0000000..9f95032
--- /dev/null
@@ -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<Type> 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 (file)
index 0000000..f4b68ac
--- /dev/null
@@ -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 (file)
index 0000000..480310b
--- /dev/null
@@ -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;
+  }
+}