summaryrefslogtreecommitdiffstats
path: root/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types
diff options
context:
space:
mode:
Diffstat (limited to 'netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types')
-rw-r--r--netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/simple-data-types.yang278
-rw-r--r--netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml3
-rw-r--r--netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/data.xml71
3 files changed, 352 insertions, 0 deletions
diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/simple-data-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/simple-data-types.yang
new file mode 100644
index 0000000..cf6e513
--- /dev/null
+++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/simple-data-types.yang
@@ -0,0 +1,278 @@
+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 2;
+ }
+ }
+ leaf lfdecimal2 {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+ leaf lfdecimal3 {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+
+ leaf lfdecimal4 {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+
+
+ leaf lfdecimal6 {
+ type decimal64 {
+ fraction-digits 2;
+ }
+ }
+
+ 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 lfunion3 {
+ type union {
+ type empty;
+ type string;
+ }
+ }
+
+ leaf lfunion4 {
+ type union {
+ type boolean;
+ type string;
+ }
+ }
+
+ leaf lfunion5 {
+ type union {
+ type uint16;
+ type string;
+ }
+ }
+
+ leaf lfunion6 {
+ type union {
+ type uint16;
+ type empty;
+ }
+ }
+
+ 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;
+ }
+ }
+
+ anyxml complex-any;
+
+ anyxml simple-any;
+
+ anyxml empty-any;
+ }
+} \ No newline at end of file
diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml
new file mode 100644
index 0000000..31dfad1
--- /dev/null
+++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml
@@ -0,0 +1,3 @@
+<cont xmlns= "simple:data:types">
+ <lfnint8Min>invalid</lfnint8Min>
+</cont> \ No newline at end of file
diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/data.xml
new file mode 100644
index 0000000..86043d7
--- /dev/null
+++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/data.xml
@@ -0,0 +1,71 @@
+<cont xmlns="simple:data:types">
+ <lfnint8Min>-128</lfnint8Min>
+ <lfnint8Max>127</lfnint8Max>
+ <lfnint16Min>-32768</lfnint16Min>
+ <lfnint16Max>32767</lfnint16Max>
+ <lfnint32Min>-2147483648</lfnint32Min>
+ <lfnint32Max>2147483647</lfnint32Max>
+ <lfnint64Min>-9223372036854775808</lfnint64Min>
+ <lfnint64Max>9223372036854775807</lfnint64Max>
+ <lfnuint8Max>255</lfnuint8Max>
+ <lfnuint16Max>65535</lfnuint16Max>
+ <lfnuint32Max>4294967295</lfnuint32Max>
+ <lfstr>lfstr</lfstr>
+ <lfstr1></lfstr1>
+ <lfbool1>true</lfbool1>
+ <lfbool2>false</lfbool2>
+ <lfbool3>bla</lfbool3>
+ <lfdecimal1>43.32</lfdecimal1>
+ <lfdecimal2>-0.43</lfdecimal2>
+ <lfdecimal3>43</lfdecimal3>
+ <lfdecimal4>43E3</lfdecimal4>
+ <lfdecimal6>33.12345</lfdecimal6>
+ <lfenum>enum3</lfenum>
+ <lfbits>bit3 bit2</lfbits>
+ <lfbinary>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</lfbinary>
+ <lfunion1>324</lfunion1>
+ <lfunion2>33.3</lfunion2>
+ <lfunion3>55</lfunion3>
+ <lfunion4>true</lfunion4>
+ <lfunion5>true</lfunion5>
+ <lfunion6>10</lfunion6>
+ <lfunion7></lfunion7>
+ <lfunion8></lfunion8>
+ <lfunion9></lfunion9>
+ <lfunion10>bt1</lfunion10>
+ <lfunion11>33</lfunion11>
+ <lfunion12>false</lfunion12>
+ <lfunion13>b1</lfunion13>
+ <lfunion14>zero</lfunion14>
+ <lfempty></lfempty>
+ <identityref1 xmlns:x="simple:data:types">x:iden</identityref1>
+ <complex-any>
+ <data>
+ <leaf1>leaf1-value</leaf1>
+ <leaf2>leaf2-value</leaf2>
+
+ <leaf-list>leaf-list-value1</leaf-list>
+ <leaf-list>leaf-list-value2</leaf-list>
+
+ <list>
+ <nested-list>
+ <nested-leaf>nested-value1</nested-leaf>
+ </nested-list>
+ <nested-list>
+ <nested-leaf>nested-value2</nested-leaf>
+ </nested-list>
+ </list>
+
+ <list>
+ <nested-list>
+ <nested-leaf>nested-value3</nested-leaf>
+ </nested-list>
+ <nested-list>
+ <nested-leaf>nested-value4</nested-leaf>
+ </nested-list>
+ </list>
+ </data>
+ </complex-any>
+ <simple-any>simple</simple-any>
+ <empty-any></empty-any>
+</cont>