[ONOS-4894][ONOS-4890][ONOS-4887][ONOS-4923]extension and argument
datamodel and listener + defect fix

Change-Id: Icefe046d9848935bb6c40a6d7688feb084edd65d
diff --git a/plugin/src/test/resources/CaseSubStatementOfAugment.yang b/plugin/src/test/resources/CaseSubStatementOfAugment.yang
new file mode 100644
index 0000000..7123f91
--- /dev/null
+++ b/plugin/src/test/resources/CaseSubStatementOfAugment.yang
@@ -0,0 +1,58 @@
+module event {
+
+    namespace "http://example.com/event";
+    prefix "ev";
+
+    augment /snmp:snmp/snmp:engine/snmp:listen/snmp:transport {
+    if-feature tlstm;
+    case tls {
+      container tls {
+        description
+          "A list of IPv4 and IPv6 addresses and ports to which the
+           engine listens for SNMP messages over TLS.";
+        leaf ip {
+          type inet:ip-address;
+          mandatory true;
+          description
+            "The IPv4 or IPv6 address on which the engine listens
+             for SNMP messages over TLS.";
+        }
+        leaf port {
+          type inet:port-number;
+          description
+            "The TCP port on which the engine listens for SNMP
+             messages over TLS.
+             If the port is not configured, an engine that
+             acts as a Command Responder uses port 10161, and
+             an engine that acts as a Notification Receiver
+             uses port 10162.";
+        }
+      }
+    }
+    case dtls {
+      container dtls1 {
+        description
+          "A list of IPv4 and IPv6 addresses and ports to which the
+           engine listens for SNMP messages over DTLS.";
+        leaf ip {
+          type inet:ip-address;
+          mandatory true;
+          description
+            "The IPv4 or IPv6 address on which the engine listens
+             for SNMP messages over DTLS.";
+        }
+        leaf port {
+          type inet:port-number;
+          description
+            "The UDP port on which the engine listens for SNMP
+             messages over DTLS.
+             If the port is not configured, an engine that
+             acts as a Command Responder uses port 10161, and
+             an engine that acts as a Notification Receiver
+             uses port 10162.";
+        }
+      }
+    }
+  }
+}
+
diff --git a/plugin/src/test/resources/ValidExtensionStatement.yang b/plugin/src/test/resources/ValidExtensionStatement.yang
new file mode 100644
index 0000000..ca134fa
--- /dev/null
+++ b/plugin/src/test/resources/ValidExtensionStatement.yang
@@ -0,0 +1,36 @@
+module ietf-yang-compiler-annotation {
+
+   namespace "urn:ietf:params:xml:ns:yang:ietf-yang-compiler-annotation";
+
+   prefix "ca";
+
+   organization
+     "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+   contact
+     "WG Web:   <http://tools.ietf.org/wg/netmod/>
+      WG List:  <mailto:netmod@ietf.org>";
+
+   description
+     "This YANG module defines an extension statement that allows for
+      defining compiler annotations.
+
+      The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
+      NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and
+      'OPTIONAL' in the module text are to be interpreted as described
+      in RFC 2119 (http://tools.ietf.org/html/rfc2119).";
+
+     revision 2016-07-08 {
+     description
+       "Initial revision.";
+     reference
+       "draft-agv-netmod-yang-compiler-metadata:
+        Defining and Using compiler annotations with YANG";
+     }
+
+     extension compiler-annotation {
+        argument target;
+        description "This extension allows for defining compiler annotations";
+      } // compiler-annotation
+   } //module agv-yang-compiler-annotation
+
diff --git a/plugin/src/test/resources/usesInsideChildOfGrouping/ietf-network.yang b/plugin/src/test/resources/usesInsideChildOfGrouping/ietf-network.yang
new file mode 100644
index 0000000..8fb2bc0
--- /dev/null
+++ b/plugin/src/test/resources/usesInsideChildOfGrouping/ietf-network.yang
@@ -0,0 +1,28 @@
+module ietf-network {
+    yang-version 1;
+    namespace "urn:ietf:params:xml:ns:yang:ietf-network";
+    prefix nd;
+
+    revision 2015-12-08 {
+       description
+         "Initial revision.
+          NOTE TO RFC EDITOR: Please replace the following reference
+          to draft-ietf-i2rs-yang-network-topo-02 with
+          RFC number when published (i.e. RFC xxxx).";
+    }
+
+    container networks {
+        list network {
+            key "network-id";
+            leaf network-id {
+                type string;
+            }
+            list node {
+                key "node-id";
+                leaf node-id {
+                    type string;
+                }
+            }
+        }
+    }
+}
diff --git a/plugin/src/test/resources/usesInsideChildOfGrouping/ietf-te-topology.yang b/plugin/src/test/resources/usesInsideChildOfGrouping/ietf-te-topology.yang
new file mode 100644
index 0000000..f1776fb
--- /dev/null
+++ b/plugin/src/test/resources/usesInsideChildOfGrouping/ietf-te-topology.yang
@@ -0,0 +1,60 @@
+module ietf-te-topology {
+    yang-version 1;
+    namespace "urn:ietf:params:xml:ns:yang:ietf-te-topology";
+
+    prefix "tet";
+
+    import ietf-network {
+        prefix "nw";
+    }
+
+    revision "2016-03-17" {
+        description "Initial revision";
+    }
+
+    grouping te-node-augment {
+        container te {
+            presence "TE support.";
+
+            leaf te-node-id {
+                type string;
+                mandatory true;
+            }
+
+            container config {
+                uses te-node-config;
+            } // config
+        } // te
+    } // te-node-augment
+
+    grouping te-node-config {
+        leaf-list te-node-template {
+            if-feature template;
+            type string;
+        }
+        uses te-node-config-attributes;
+    } // te-node-config
+
+    grouping te-node-config-attributes {
+        container te-node-attributes {
+            leaf admin-status {
+               type string;
+            }
+            uses te-node-connectivity-matrix;
+        } // te-node-attributes
+    } // te-node-config-attributes
+
+    grouping te-node-connectivity-matrix {
+        list connectivity-matrix {
+            key "id";
+            leaf id {
+                type uint32;
+                description "Identifies the connectivity-matrix entry.";
+            }
+        }
+    } // te-node-connectivity-matrix
+
+    augment "/nw:networks/nw:network/nw:node" {
+        uses te-node-augment;
+    }
+}