From 4d8f226826c45c79bbf7459d24f3b70b2e9dbe92 Mon Sep 17 00:00:00 2001 From: ary Date: Thu, 7 May 2015 09:56:59 +0200 Subject: [PATCH] Bug 2358 - Resources for tests nn to json Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but we test codec on input data and also with presentation of Rest path. * fix and add yang files for tests * fix json and xml files * rename base folder of csns-to-json to nn-to-json Change-Id: Id1c88f069d259536d34438d7b68666dd3010adc4 Signed-off-by: Jakub Toth (cherry picked from commit b0e9c2a7deb5a49e7f964ec1eee06198c0c15f5a) --- .../cnsn-to-json/augmentation/yang.yang | 17 ------- .../cnsn-to-json/leafref/main-module.yang | 43 ---------------- .../xml/data_absolut_ref_to_existing_leaf.xml | 6 --- .../xml/data_from_leafref_to_leafref.xml | 3 -- .../xml/data_ref_to_non_existing_leaf.xml | 3 -- .../leafref/xml/data_ref_to_not_leaf.xml | 3 -- ...tiv_ref_from_leaflist_to_existing_leaf.xml | 5 -- .../xml/data_relativ_ref_to_existing_leaf.xml | 4 -- .../simple-data-types/xml/bad-data.xml | 3 -- .../augmentation/augment-container.yang | 0 .../augmentation/augment-leaf.yang | 0 .../augmentation/augment-leaflist.yang | 0 .../augmentation/augment-list.yang | 0 .../augmentation/xml/data.xml | 2 +- .../nn-to-json/augmentation/yang.yang | 30 +++++++++++ .../choice/choice.yang | 2 +- .../xml/data_case_defined_without_case.xml | 2 +- .../choice/xml/data_container.xml | 2 +- .../choice/xml/data_leaflist.xml | 2 +- .../choice/xml/data_list.xml | 2 +- .../xml/data_more_choices_same_level.xml | 2 +- ...e_choices_same_level_various_paths_err.xml | 2 +- .../choice/xml/data_no_first_case.xml | 2 +- .../choice/xml/data_random_level.xml | 2 +- .../xml/data_three_choices_same_level.xml | 2 +- .../choice/xml/data_various_path_err.xml | 2 +- .../data-of-several-modules/yang/module1.yang | 20 ++++++++ .../data-of-several-modules/yang/module2.yang | 20 ++++++++ .../identityref/identity-module.yang | 0 .../identityref/identityref-module.yang | 0 .../invalid-top-level-element.yang | 0 .../leafref/cont-augment-module.yang | 5 +- .../nn-to-json/leafref/main-module.yang | 50 +++++++++++++++++++ .../xml/data_absolut_ref_to_existing_leaf.xml | 7 +++ .../xml/data_from_leafref_to_leafref.xml | 4 ++ .../xml/data_ref_to_non_existing_leaf.xml | 4 ++ .../leafref/xml/data_ref_to_not_leaf.xml | 4 ++ ...tiv_ref_from_leaflist_to_existing_leaf.xml | 6 +++ .../xml/data_relativ_ref_to_existing_leaf.xml | 5 ++ .../list/list-types-module | 0 .../simple-data-types/simple-data-types.yang | 0 .../simple-data-types/xml/bad-data.xml | 3 ++ .../simple-data-types/xml/data.xml | 4 +- .../simple-yang-types/simple-yang-types.yang | 2 +- .../xml/awaited_output_data.json | 0 .../xml/awaited_output_empty_data.json | 0 .../simple-yang-types/xml/data.xml | 2 +- .../simple-yang-types/xml/empty_data.xml | 0 48 files changed, 170 insertions(+), 107 deletions(-) delete mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/yang.yang delete mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/main-module.yang delete mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml delete mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_from_leafref_to_leafref.xml delete mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml delete mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_ref_to_not_leaf.xml delete mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml delete mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml delete mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-data-types/xml/bad-data.xml rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/augmentation/augment-container.yang (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/augmentation/augment-leaf.yang (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/augmentation/augment-leaflist.yang (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/augmentation/augment-list.yang (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/augmentation/xml/data.xml (90%) create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/yang.yang rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/choice.yang (98%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_case_defined_without_case.xml (51%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_container.xml (60%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_leaflist.xml (65%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_list.xml (75%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_more_choices_same_level.xml (69%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_more_choices_same_level_various_paths_err.xml (74%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_no_first_case.xml (65%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_random_level.xml (72%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_three_choices_same_level.xml (84%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/choice/xml/data_various_path_err.xml (72%) create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/data-of-several-modules/yang/module1.yang create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/data-of-several-modules/yang/module2.yang rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/identityref/identity-module.yang (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/identityref/identityref-module.yang (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/invalid-top-level-element/invalid-top-level-element.yang (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/leafref/cont-augment-module.yang (99%) create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/main-module.yang create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_from_leafref_to_leafref.xml create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_ref_to_not_leaf.xml create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/list/list-types-module (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/simple-data-types/simple-data-types.yang (100%) create mode 100644 opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/simple-data-types/xml/data.xml (97%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/simple-yang-types/simple-yang-types.yang (97%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/simple-yang-types/xml/awaited_output_data.json (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/simple-yang-types/xml/awaited_output_empty_data.json (100%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/simple-yang-types/xml/data.xml (98%) rename opendaylight/md-sal/sal-rest-connector/src/test/resources/{cnsn-to-json => nn-to-json}/simple-yang-types/xml/empty_data.xml (100%) diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/yang.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/yang.yang deleted file mode 100644 index aeb973704d..0000000000 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/yang.yang +++ /dev/null @@ -1,17 +0,0 @@ -module yang { - namespace "ns:yang"; - - prefix "yng"; - revision 2013-11-26 { - } - - container cont { - leaf lf1 { - type string; - } - - } - - - -} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/main-module.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/main-module.yang deleted file mode 100644 index 8c8039290c..0000000000 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/main-module.yang +++ /dev/null @@ -1,43 +0,0 @@ -module main-module { - namespace "main:module"; - - prefix "mainmod"; - revision 2013-12-2 { - } - - container cont { - leaf lf1 { - type uint32; - } - - container cont1 { - leaf lf11 { - type boolean; - } - } - - leaf lf2 { - type leafref { - path "../lf1"; - } - } - - leaf lf3 { - type leafref { - path "/cont/cont1/lf11"; - } - } - - /* reference to nonexisting leaf */ - leaf lf5 { - type leafref { - path "/cont/lf"; - } - } - - - } - - - -} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml deleted file mode 100644 index 6bb975947b..0000000000 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - true - - true - \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_from_leafref_to_leafref.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_from_leafref_to_leafref.xml deleted file mode 100644 index c6c20cb638..0000000000 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_from_leafref_to_leafref.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 200 - \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml deleted file mode 100644 index 401247a367..0000000000 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 137 - \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_ref_to_not_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_ref_to_not_leaf.xml deleted file mode 100644 index b72d438c28..0000000000 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_ref_to_not_leaf.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 44 - \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml deleted file mode 100644 index 49d2dc39aa..0000000000 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml +++ /dev/null @@ -1,5 +0,0 @@ - - 345 - 346 - 347 - \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml deleted file mode 100644 index 06200a69b5..0000000000 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml +++ /dev/null @@ -1,4 +0,0 @@ - - 121 - 121 - \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-data-types/xml/bad-data.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-data-types/xml/bad-data.xml deleted file mode 100644 index 110c3237de..0000000000 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-data-types/xml/bad-data.xml +++ /dev/null @@ -1,3 +0,0 @@ - - invalid - \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/augment-container.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/augment-container.yang similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/augment-container.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/augment-container.yang diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/augment-leaf.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/augment-leaf.yang similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/augment-leaf.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/augment-leaf.yang diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/augment-leaflist.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/augment-leaflist.yang similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/augment-leaflist.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/augment-leaflist.yang diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/augment-list.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/augment-list.yang similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/augment-list.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/augment-list.yang diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/xml/data.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/xml/data.xml similarity index 90% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/xml/data.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/xml/data.xml index 5b1c8324ac..fec62092c0 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/augmentation/xml/data.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/xml/data.xml @@ -1,4 +1,4 @@ - + lf1 lf2 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/yang.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/yang.yang new file mode 100644 index 0000000000..64bf6f56d3 --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/augmentation/yang.yang @@ -0,0 +1,30 @@ +module yang { + namespace "ns:yang"; + + prefix "yng"; + revision 2013-11-26 { + } + + container cont { + leaf lf1 { + type string; + } + leaf lf2 { + type string; + } + container cont1{ + leaf lf11 { + type string; + } + } + + list lst1{ + leaf lf11 { + type string; + } + } + leaf-list lflst1{ + type string; + } + } +}l \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/choice.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/choice.yang similarity index 98% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/choice.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/choice.yang index a6a32df52e..2f14c84659 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/choice.yang +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/choice.yang @@ -1,5 +1,5 @@ module choice-case-test { - namespace "choice:case:test"; + namespace "module:with:choice"; prefix "chcatst"; revision 2013-11-27 { diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_case_defined_without_case.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_case_defined_without_case.xml similarity index 51% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_case_defined_without_case.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_case_defined_without_case.xml index c6e42dfb77..1d3f99f00a 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_case_defined_without_case.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_case_defined_without_case.xml @@ -1,4 +1,4 @@ - + 45 lf2b val \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_container.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_container.xml similarity index 60% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_container.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_container.xml index 0d5fa4a514..146e2566cf 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_container.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_container.xml @@ -1,4 +1,4 @@ - + lf11c val diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_leaflist.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_leaflist.xml similarity index 65% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_leaflist.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_leaflist.xml index 0278389d73..f501e043f2 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_leaflist.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_leaflist.xml @@ -1,4 +1,4 @@ - + lflst1d_1 val lflst1d_2 val \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_list.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_list.xml similarity index 75% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_list.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_list.xml index 488873d5ef..6694b48379 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_list.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_list.xml @@ -1,4 +1,4 @@ - + lf11b_1 val diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_more_choices_same_level.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level.xml similarity index 69% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_more_choices_same_level.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level.xml index f21d83f8f0..3d2742aaa5 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_more_choices_same_level.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level.xml @@ -1,4 +1,4 @@ - + lf11c val diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_more_choices_same_level_various_paths_err.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level_various_paths_err.xml similarity index 74% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_more_choices_same_level_various_paths_err.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level_various_paths_err.xml index 9e28730355..aa9e24c89b 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_more_choices_same_level_various_paths_err.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level_various_paths_err.xml @@ -1,4 +1,4 @@ - + lf11c val diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_no_first_case.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_no_first_case.xml similarity index 65% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_no_first_case.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_no_first_case.xml index dbd2684526..cc6f019289 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_no_first_case.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_no_first_case.xml @@ -1,4 +1,4 @@ - + lf1 val 121 lf1ab val diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_random_level.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_random_level.xml similarity index 72% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_random_level.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_random_level.xml index e3e66b78e6..05ca42fab6 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_random_level.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_random_level.xml @@ -1,4 +1,4 @@ - + lf1aa val lf1 val 121 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_three_choices_same_level.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_three_choices_same_level.xml similarity index 84% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_three_choices_same_level.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_three_choices_same_level.xml index 49b4143a2e..7e5430118a 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_three_choices_same_level.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_three_choices_same_level.xml @@ -1,4 +1,4 @@ - + lf1aaa value lf2b value diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_various_path_err.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_various_path_err.xml similarity index 72% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_various_path_err.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_various_path_err.xml index e8634682cd..5274679e90 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/choice/xml/data_various_path_err.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/choice/xml/data_various_path_err.xml @@ -1,4 +1,4 @@ - + lf1aa val lf1 val 121 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/data-of-several-modules/yang/module1.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/data-of-several-modules/yang/module1.yang new file mode 100644 index 0000000000..72a82caec4 --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/data-of-several-modules/yang/module1.yang @@ -0,0 +1,20 @@ +module module1 { + namespace "module:one"; + + prefix "m1"; + revision 2014-01-17 { + } + + container cont_m1 { + leaf lf1_m1 { + type string; + } + uses confB_gr; + } + + grouping confB_gr { + container contB_m1 { + } + } + +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/data-of-several-modules/yang/module2.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/data-of-several-modules/yang/module2.yang new file mode 100644 index 0000000000..521d9c0e63 --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/data-of-several-modules/yang/module2.yang @@ -0,0 +1,20 @@ +module module2 { + namespace "module:two"; + + prefix "m2"; + revision 2014-01-17 { + } + + container cont_m2 { + leaf lf1_m2 { + type string; + } + uses confB_gr; + } + + grouping confB_gr { + container contB_m2 { + } + } + +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/identityref/identity-module.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/identityref/identity-module.yang similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/identityref/identity-module.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/identityref/identity-module.yang diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/identityref/identityref-module.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/identityref/identityref-module.yang similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/identityref/identityref-module.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/identityref/identityref-module.yang diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/invalid-top-level-element/invalid-top-level-element.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/invalid-top-level-element/invalid-top-level-element.yang similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/invalid-top-level-element/invalid-top-level-element.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/invalid-top-level-element/invalid-top-level-element.yang diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/cont-augment-module.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/cont-augment-module.yang similarity index 99% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/cont-augment-module.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/cont-augment-module.yang index 27b2dae243..528eb5e420 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/cont-augment-module.yang +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/cont-augment-module.yang @@ -35,8 +35,5 @@ module cont-augment-module { } } } - - - - + } \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/main-module.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/main-module.yang new file mode 100644 index 0000000000..1641aaae6e --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/main-module.yang @@ -0,0 +1,50 @@ +module main-module { + namespace "main:module"; + + prefix "mainmod"; + revision 2013-12-2 { + } + + container cont { + leaf lf1 { + /* + *FIX ME + * If is this leaf lf1 called from cont-augment-module.yang + * from lf4, type that will be returned to the lf1 is string. + * Than there are failing tests because of we have string, + * do not number(uint32) + */ +// type uint32; + type string; + } + + container cont1 { + leaf lf11 { + /* + * FIX ME TOO WITH BAD PARSING + */ +// type boolean; + type string; + } + } + + leaf lf2 { + type leafref { + path "../lf1"; + } + } + + leaf lf3 { + type leafref { + path "/cont/cont1/lf11"; + } + } + + /* reference to nonexisting leaf */ + leaf lf5 { + type leafref { + path "/cont/lf"; + } + } + } +} diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml new file mode 100644 index 0000000000..bd5b6a2544 --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml @@ -0,0 +1,7 @@ + + + true + + true + \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_from_leafref_to_leafref.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_from_leafref_to_leafref.xml new file mode 100644 index 0000000000..7b1c2776b3 --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_from_leafref_to_leafref.xml @@ -0,0 +1,4 @@ + + 200 + \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml new file mode 100644 index 0000000000..cdbd56bc08 --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml @@ -0,0 +1,4 @@ + + 137 + \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_ref_to_not_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_ref_to_not_leaf.xml new file mode 100644 index 0000000000..953280b9dd --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_ref_to_not_leaf.xml @@ -0,0 +1,4 @@ + + 44 + \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml new file mode 100644 index 0000000000..8fe0ac4ab5 --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml @@ -0,0 +1,6 @@ + + 345 + 346 + 347 + \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml new file mode 100644 index 0000000000..14a2544f88 --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml @@ -0,0 +1,5 @@ + + 121 + 121 + \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/list/list-types-module b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/list/list-types-module similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/list/list-types-module rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/list/list-types-module diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-data-types/simple-data-types.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-data-types/simple-data-types.yang similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-data-types/simple-data-types.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-data-types/simple-data-types.yang diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml new file mode 100644 index 0000000000..31dfad1595 --- /dev/null +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml @@ -0,0 +1,3 @@ + + invalid + \ No newline at end of file diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-data-types/xml/data.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-data-types/xml/data.xml similarity index 97% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-data-types/xml/data.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-data-types/xml/data.xml index ed02ca35f6..86043d7441 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-data-types/xml/data.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-data-types/xml/data.xml @@ -1,4 +1,4 @@ - + -128 127 -32768 @@ -37,7 +37,7 @@ false b1 zero - + x:iden diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/simple-yang-types.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/simple-yang-types.yang similarity index 97% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/simple-yang-types.yang rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/simple-yang-types.yang index 0216e97cfb..fdb3bfb9ea 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/simple-yang-types.yang +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/simple-yang-types.yang @@ -17,7 +17,7 @@ module simple-yang-types { type string; } list lst11 { - key lf111; + key "lf111"; leaf lf111 { type uint8; } diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/xml/awaited_output_data.json b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_data.json similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/xml/awaited_output_data.json rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_data.json diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/xml/awaited_output_empty_data.json b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_empty_data.json similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/xml/awaited_output_empty_data.json rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_empty_data.json diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/xml/data.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/xml/data.xml similarity index 98% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/xml/data.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/xml/data.xml index 61858d28b6..1df9ca5a6e 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/xml/data.xml +++ b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/xml/data.xml @@ -1,4 +1,4 @@ - + lf 56 55 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/xml/empty_data.xml b/opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/xml/empty_data.xml similarity index 100% rename from opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/simple-yang-types/xml/empty_data.xml rename to opendaylight/md-sal/sal-rest-connector/src/test/resources/nn-to-json/simple-yang-types/xml/empty_data.xml -- 2.36.6