[ONOS-5962]YANG Runtime: ModelConverter's createModel implementation
Change-Id: I8377ad86d0b0b60f96c4d8d40517cede66c5fc27
diff --git a/runtime/src/test/resources/yobTestYangFiles/SampleTest.yang b/runtime/src/test/resources/yobTestYangFiles/SampleTest.yang
new file mode 100644
index 0000000..c59ed74
--- /dev/null
+++ b/runtime/src/test/resources/yobTestYangFiles/SampleTest.yang
@@ -0,0 +1,53 @@
+module sample {
+ yang-version 1;
+ namespace "samplenamespace";
+ prefix "attr";
+ container top {
+ leaf mtu {
+ type string;
+ }
+ leaf-list color {
+ type string;
+ }
+ list interface {
+ key name;
+ leaf name {
+ type string;
+ }
+ container address {
+ leaf name {
+ type string;
+ }
+ }
+ }
+ }
+ list l1 {
+ config false;
+ container c1 {
+ leaf leaf1 {
+ type string;
+ }
+ leaf-list leaf2 {
+ type string;
+ }
+ }
+ leaf leaf3 {
+ type string;
+ }
+ leaf-list leaf4 {
+ type string;
+ }
+ }
+ list l2 {
+ key k1;
+ leaf k1 {
+ type string;
+ }
+ }
+ leaf leaf5 {
+ type string;
+ }
+ leaf-list leaf6 {
+ type string;
+ }
+}
\ No newline at end of file
diff --git a/runtime/src/test/resources/yobTestYangFiles/ip-topology.yang b/runtime/src/test/resources/yobTestYangFiles/ip-topology.yang
new file mode 100644
index 0000000..cb56c41
--- /dev/null
+++ b/runtime/src/test/resources/yobTestYangFiles/ip-topology.yang
@@ -0,0 +1,28 @@
+module yms-ip-topology {
+ yang-version 1;
+ namespace urn:ip:topo;
+ prefix ip-topo;
+ import yms-topology {
+ prefix topo;
+ revision-date "2014-01-01";
+ }
+ revision 2014-01-01 {
+ description "desc";
+ reference "ref";
+ }
+
+ augment /topo:node{
+ leaf router-id {
+ type string;
+ }
+ leaf router-ip {
+ type string;
+ }
+ }
+
+ augment /topo:node/topo:termination-points/topo:termination-point {
+ leaf ip-address {
+ type string;
+ }
+ }
+}
diff --git a/runtime/src/test/resources/yobTestYangFiles/leafreftest.yang b/runtime/src/test/resources/yobTestYangFiles/leafreftest.yang
new file mode 100644
index 0000000..0905c86
--- /dev/null
+++ b/runtime/src/test/resources/yobTestYangFiles/leafreftest.yang
@@ -0,0 +1,71 @@
+module leafreftest {
+
+ yang-version 1;
+
+ namespace "yob.leafreftest";
+
+ prefix "uniontest";
+
+ organization "ON-LAB";
+
+ description "This module defines for union classifier.";
+
+ revision "2016-05-24" {
+ description "Initial revision.";
+ }
+
+ leaf middlename {
+ type string;
+ }
+
+ list leafrefList {
+ config false;
+ leaf id {
+ type leafref {
+ path "/middlename";
+ }
+ }
+ }
+
+ typedef percent {
+ type leafref {
+ path "/middlename";
+ }
+ }
+
+ leaf name {
+ type percent;
+ }
+
+ grouping greeting {
+ leaf surname {
+ type leafref {
+ path "/middlename";
+ }
+ }
+ }
+
+ container cont1 {
+ uses greeting;
+ }
+
+ augment "/cont1" {
+ leaf lastname {
+ type leafref {
+ path "/middlename";
+ }
+ }
+ }
+
+ container food {
+ choice snack {
+ case sportsarena {
+ leaf pretzel {
+ type leafref {
+ path "/middlename";
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/runtime/src/test/resources/yobTestYangFiles/simple-data-types-leaf-list.yang b/runtime/src/test/resources/yobTestYangFiles/simple-data-types-leaf-list.yang
new file mode 100644
index 0000000..401cdaa
--- /dev/null
+++ b/runtime/src/test/resources/yobTestYangFiles/simple-data-types-leaf-list.yang
@@ -0,0 +1,256 @@
+module simple-data-types-ll {
+ namespace "simple:data:types:ll";
+
+ prefix "smpdtp";
+ revision 2013-11-12 {
+ }
+
+ identity iden {
+ }
+
+ typedef tpdfempty {
+ type empty;
+ }
+
+ typedef tpdfbit {
+ type bits {
+ bit b1;
+ bit b2;
+ bit b3;
+ }
+ }
+
+ typedef tpdfun4 {
+ type boolean;
+ }
+
+ typedef tpdfun3 {
+ type union {
+ type tpdfbit;
+ type tpdfempty;
+ }
+ }
+
+ typedef tpdfun2 {
+ type union {
+ type tpdfun3;
+ type tpdfun4;
+ }
+ }
+
+ typedef tpdfun1 {
+ type union {
+ type uint8;
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+ }
+
+ container cont1 {
+ leaf-list lfnint8Min {
+ type int8;
+ }
+ leaf-list lfnint8Max {
+ type int8;
+ }
+ leaf-list lfnint16Min {
+ type int16;
+ }
+ leaf-list lfnint16Max {
+ type int16;
+ }
+ leaf-list lfnint32Min {
+ type int32;
+ }
+ leaf-list lfnint32Max {
+ type int32;
+ }
+ leaf-list lfnint64Min {
+ type int64;
+ }
+ leaf-list lfnint64Max {
+ type int64;
+ }
+ leaf-list lfnuint8Max {
+ type uint8;
+ }
+ leaf-list lfnuint16Max {
+ type uint16;
+ }
+ leaf-list lfnuint32Max {
+ type uint32;
+ }
+ leaf-list lfuint64Max {
+ type uint64;
+ }
+ leaf-list lfstr {
+ type string;
+ }
+ leaf-list lfstr1 {
+ type string;
+ }
+ leaf-list lfbool1 {
+ type boolean;
+ }
+ leaf-list lfbool2 {
+ type boolean;
+ }
+ leaf-list lfbool3 {
+ type boolean;
+ }
+ leaf-list lfdecimal1 {
+ type decimal64 {
+ fraction-digits 1;
+ }
+ }
+ leaf-list lfdecimal2 {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+ leaf-list lfdecimal3 {
+ type decimal64 {
+ fraction-digits 3;
+ }
+ }
+
+ leaf-list lfdecimal4 {
+ type decimal64 {
+ fraction-digits 4;
+ }
+ }
+
+ leaf-list lfdecimal6 {
+ type decimal64 {
+ fraction-digits 6;
+ }
+ }
+
+ leaf-list lfenum {
+ type enumeration {
+ enum enum1;
+ enum enum2;
+ enum enum3;
+ enum enum4;
+ }
+ }
+
+ leaf-list lfbits {
+ type bits {
+ bit bit1;
+ bit bit2;
+ bit bit3;
+ bit bit4;
+ }
+ }
+
+ leaf-list lfbinary {
+ type binary;
+ }
+
+ leaf-list lfref1 { //reference to string type
+ type leafref {
+ path "../lfstr";
+ }
+ }
+
+ leaf-list lfref2 { //reference to number type
+ type leafref {
+ path "../lfnint8Max";
+ }
+ }
+
+ leaf-list lfempty {
+ type empty;
+ }
+
+ leaf-list lfunion1 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+ leaf-list lfunion2 {
+ type union {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ type string;
+ }
+ }
+
+ leaf-list lfunion4 {
+ type union {
+ type boolean;
+ type string;
+ }
+ }
+
+ leaf-list lfunion5 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+
+ leaf-list lfunion7 {
+ type tpdfun3;
+ }
+
+ leaf-list lfunion8 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+
+ leaf-list lfunion9 {
+ type union {
+ type uint16;
+ type boolean;
+ }
+ }
+
+ leaf-list lfunion10 {
+ type union {
+ type bits {
+ bit bt1;
+ bit bt2;
+ }
+ type boolean;
+ }
+ }
+
+ leaf-list lfunion11 {
+ type union {
+ type tpdfun1;
+ type tpdfun2;
+ }
+ }
+
+ leaf-list lfunion12 {
+ type tpdfun2;
+ }
+
+ leaf-list lfunion13 {
+ type tpdfbit;
+ }
+
+ leaf-list lfunion14 {
+ type union {
+ type enumeration {
+ enum zero;
+ enum one;
+ }
+ type uint16;
+ }
+ }
+
+ leaf-list identityref1 {
+ type identityref {
+ base iden;
+ }
+ }
+ }
+}
diff --git a/runtime/src/test/resources/yobTestYangFiles/simple-data-types.yang b/runtime/src/test/resources/yobTestYangFiles/simple-data-types.yang
new file mode 100644
index 0000000..602c37b
--- /dev/null
+++ b/runtime/src/test/resources/yobTestYangFiles/simple-data-types.yang
@@ -0,0 +1,256 @@
+module simple-data-types {
+ namespace "simple:data:types";
+
+ prefix "smpdtp";
+ revision 2013-11-12 {
+ }
+
+ identity iden {
+ }
+
+ typedef tpdfempty {
+ type empty;
+ }
+
+ typedef tpdfbit {
+ type bits {
+ bit b1;
+ bit b2;
+ bit b3;
+ }
+ }
+
+ typedef tpdfun4 {
+ type boolean;
+ }
+
+ typedef tpdfun3 {
+ type union {
+ type tpdfbit;
+ type tpdfempty;
+ }
+ }
+
+ typedef tpdfun2 {
+ type union {
+ type tpdfun3;
+ type tpdfun4;
+ }
+ }
+
+ typedef tpdfun1 {
+ type union {
+ type uint8;
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+ }
+
+ container cont {
+ leaf lfnint8Min {
+ type int8;
+ }
+ leaf lfnint8Max {
+ type int8;
+ }
+ leaf lfnint16Min {
+ type int16;
+ }
+ leaf lfnint16Max {
+ type int16;
+ }
+ leaf lfnint32Min {
+ type int32;
+ }
+ leaf lfnint32Max {
+ type int32;
+ }
+ leaf lfnint64Min {
+ type int64;
+ }
+ leaf lfnint64Max {
+ type int64;
+ }
+ leaf lfnuint8Max {
+ type uint8;
+ }
+ leaf lfnuint16Max {
+ type uint16;
+ }
+ leaf lfnuint32Max {
+ type uint32;
+ }
+ leaf lfuint64Max {
+ type uint64;
+ }
+ leaf lfstr {
+ type string;
+ }
+ leaf lfstr1 {
+ type string;
+ }
+ leaf lfbool1 {
+ type boolean;
+ }
+ leaf lfbool2 {
+ type boolean;
+ }
+ leaf lfbool3 {
+ type boolean;
+ }
+ leaf lfdecimal1 {
+ type decimal64 {
+ fraction-digits 1;
+ }
+ }
+ leaf lfdecimal2 {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+ leaf lfdecimal3 {
+ type decimal64 {
+ fraction-digits 3;
+ }
+ }
+
+ leaf lfdecimal4 {
+ type decimal64 {
+ fraction-digits 4;
+ }
+ }
+
+ leaf lfdecimal6 {
+ type decimal64 {
+ fraction-digits 6;
+ }
+ }
+
+ leaf lfenum {
+ type enumeration {
+ enum enum1;
+ enum enum2;
+ enum enum3;
+ enum enum4;
+ }
+ }
+
+ leaf lfbits {
+ type bits {
+ bit bit1;
+ bit bit2;
+ bit bit3;
+ bit bit4;
+ }
+ }
+
+ leaf lfbinary {
+ type binary;
+ }
+
+ leaf lfref1 { //reference to string type
+ type leafref {
+ path "../lfstr";
+ }
+ }
+
+ leaf lfref2 { //reference to number type
+ type leafref {
+ path "../lfnint8Max";
+ }
+ }
+
+ leaf lfempty {
+ type empty;
+ }
+
+ leaf lfunion1 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+ leaf lfunion2 {
+ type union {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ type string;
+ }
+ }
+
+ leaf lfunion4 {
+ type union {
+ type boolean;
+ type string;
+ }
+ }
+
+ leaf lfunion5 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+
+ leaf lfunion7 {
+ type tpdfun3;
+ }
+
+ leaf lfunion8 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+
+ leaf lfunion9 {
+ type union {
+ type uint16;
+ type boolean;
+ }
+ }
+
+ leaf lfunion10 {
+ type union {
+ type bits {
+ bit bt1;
+ bit bt2;
+ }
+ type boolean;
+ }
+ }
+
+ leaf lfunion11 {
+ type union {
+ type tpdfun1;
+ type tpdfun2;
+ }
+ }
+
+ leaf lfunion12 {
+ type tpdfun2;
+ }
+
+ leaf lfunion13 {
+ type tpdfbit;
+ }
+
+ leaf lfunion14 {
+ type union {
+ type enumeration {
+ enum zero;
+ enum one;
+ }
+ type uint16;
+ }
+ }
+
+ leaf identityref1 {
+ type identityref {
+ base iden;
+ }
+ }
+ }
+}
diff --git a/runtime/src/test/resources/yobTestYangFiles/topology.yang b/runtime/src/test/resources/yobTestYangFiles/topology.yang
new file mode 100644
index 0000000..9837851
--- /dev/null
+++ b/runtime/src/test/resources/yobTestYangFiles/topology.yang
@@ -0,0 +1,90 @@
+
+module yms-topology {
+ yang-version 1;
+ namespace urn:topo;
+ prefix topo;
+ revision 2014-01-01 {
+ description "desc";
+ reference "ref";
+ }
+ list node {
+ key "node-id";
+ leaf node-id{
+ type string;
+ }
+ leaf-list node-prop{
+ type string;
+ }
+ container termination-points{
+ leaf number-of-tp {
+ type int16;
+ }
+ list termination-point {
+ key "tp-id";
+ leaf tp-id {
+ type string;
+ }
+ }
+ }
+ choice choice1{
+ case case1a{
+ leaf leaf1a1{
+ type string;
+ }
+ leaf leaf1a2{
+ type string;
+ }
+ }
+ case case1b{
+ choice choice1b{
+ case case1bi{
+ leaf leaf1bia{
+ type string;
+ }
+ leaf leaf1bib{
+ type string;
+ }
+ }
+ case case1bii{
+ leaf leaf1biia{
+ type string;
+ }
+ leaf leaf1biib{
+ type string;
+ }
+ }
+ }
+ }
+ }
+ }
+ choice choice2 {
+ case case2a {
+ leaf leaf2a1 {
+ type string;
+ }
+ leaf leaf2a2 {
+ type string;
+ }
+ }
+ case case2b {
+ choice choice3b {
+ case case2bi {
+ leaf leaf2bia {
+ type string;
+ }
+ leaf leaf2bib {
+ type string;
+ }
+ }
+ case case3bii {
+ leaf leaf3biia {
+ type string;
+ }
+ leaf leaf3biib {
+ type string;
+ }
+ }
+ }
+ }
+ }
+}