From c604f64b971491f8c9b953adce54b847d7946e26 Mon Sep 17 00:00:00 2001 From: Prudence Au Date: Mon, 13 Aug 2018 17:06:59 -0400 Subject: Initial submission for validation service Change-Id: I9372430f1ae347373d5a9a0c7a427d7bd393d61e Issue-ID: LOG-427 Signed-off-by: Prudence Au (prudence.au@amdocs.com) Signed-off-by: Geora Barsky Signed-off-by: Pierre Rioux --- .../instance-reader/connector-attributes.json | 399 +++++++++++++++++++++ .../instance-reader/connector-model-name.json | 84 +++++ .../connector-sibling-inventory-items.json | 118 ++++++ .../instance-reader/connector.json | 82 +++++ .../instance-reader/expected-generic-vnf.json | 36 ++ .../instance-reader/expected-logical-link.json | 51 +++ .../instance-reader/expected-pserver.json | 28 ++ .../expected-virtual-data-center-model-name.json | 66 ++++ .../expected-virtual-data-center.json | 65 ++++ .../model-instance-mapping-attributes.json_conf | 12 + .../model-instance-mapping-root-missing.json_conf | 16 + .../model-instance-mapping-root-unknown.json_conf | 17 + .../model-instance-mapping.json_conf | 17 + .../test-validation-service-beans.xml | 35 ++ 14 files changed, 1026 insertions(+) create mode 100644 src/test/resources/model-validation/instance-reader/connector-attributes.json create mode 100644 src/test/resources/model-validation/instance-reader/connector-model-name.json create mode 100644 src/test/resources/model-validation/instance-reader/connector-sibling-inventory-items.json create mode 100644 src/test/resources/model-validation/instance-reader/connector.json create mode 100644 src/test/resources/model-validation/instance-reader/expected-generic-vnf.json create mode 100644 src/test/resources/model-validation/instance-reader/expected-logical-link.json create mode 100644 src/test/resources/model-validation/instance-reader/expected-pserver.json create mode 100644 src/test/resources/model-validation/instance-reader/expected-virtual-data-center-model-name.json create mode 100644 src/test/resources/model-validation/instance-reader/expected-virtual-data-center.json create mode 100644 src/test/resources/model-validation/instance-reader/model-instance-mapping-attributes.json_conf create mode 100644 src/test/resources/model-validation/instance-reader/model-instance-mapping-root-missing.json_conf create mode 100644 src/test/resources/model-validation/instance-reader/model-instance-mapping-root-unknown.json_conf create mode 100644 src/test/resources/model-validation/instance-reader/model-instance-mapping.json_conf create mode 100644 src/test/resources/model-validation/instance-reader/test-validation-service-beans.xml (limited to 'src/test/resources/model-validation/instance-reader') diff --git a/src/test/resources/model-validation/instance-reader/connector-attributes.json b/src/test/resources/model-validation/instance-reader/connector-attributes.json new file mode 100644 index 0000000..3a4536f --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/connector-attributes.json @@ -0,0 +1,399 @@ +{ + "inventory-response-item": [ + { + "model-name": "WAN Connector v0.1", + "connector": { + "resource-instance-id": "100559", + "resource-version": "1465571381", + "persona-model-id": "dc700a83-c507-47d9-b775-1fdfcdd5f9eb", + "persona-model-version": "0.1" + }, + "extra-properties": { + "metadatum": [ + { + "metaname": "vpn-id", + "metaval": "vpn-id value 1", + "resource-version": "1466418452" + }, + { + "metaname": "unexpected", + "metaval": "unexpected value 1", + "resource-version": "1466418452" + } + ] + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "virtual-data-center": { + "vdc-id": "15001220", + "vdc-name": "SAN_DIEGO_CA01", + "resource-version": "1465571382" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vLAN on a Physical Wire", + "logical-link": { + "link-name": "sn6ca391ve2-xe-10/2/3.117|sn4ca01pbg", + "link-type": "l2bridge", + "resource-version": "1465571381", + "persona-model-id": "32bee148-2cae-4f3d-a42e-22c9e4f078a2", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "pBgf", + "pserver": { + "hostname": "sn4ca01pbg", + "in-maint": false, + "resource-version": "1470978156" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "VL ELAN", + "logical-link": { + "link-name": "sn6ca391ve2-ae6.1322|dbzx0003v", + "link-type": "l2bridge", + "resource-version": "1465571381", + "persona-model-id": "932518e5-4260-4cc4-8038-df604a367f85", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vDbe", + "generic-vnf": { + "vnf-id": "VAPP-2883", + "vnf-name": "dbzx0004v", + "vnf-type": "vSRX vDBE-V VNF", + "service-id": "12a96a9d-4b4c-4349-a950-fe1159602621", + "prov-status": "ACTIVE", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1470978155" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "VL ELAN", + "logical-link": { + "link-name": "sn6ca392ve2-ae6.1322|dbzx0003v", + "link-type": "l2bridge", + "resource-version": "1465571382", + "persona-model-id": "932518e5-4260-4cc4-8038-df604a367f85", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vDbe", + "generic-vnf": { + "vnf-id": "VAPP-2883", + "vnf-name": "dbzx0004v", + "vnf-type": "vSRX vDBE-V VNF", + "service-id": "12a96a9d-4b4c-4349-a950-fe1159602621", + "prov-status": "ACTIVE", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1470978155" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "VL ELAN", + "logical-link": { + "link-name": "sn6ca392ve2-ae6.1927|asbg0003v", + "link-type": "l2bridge", + "resource-version": "1465571382", + "persona-model-id": "932518e5-4260-4cc4-8038-df604a367f85", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vDbe", + "generic-vnf": { + "vnf-id": "VAPP-9320", + "vnf-name": "asbg0003v", + "vnf-type": "ASBGv No TLS", + "service-id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d", + "prov-status": "PROV", + "ipv4-oam-address": "135.193.152.168", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1470978156" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "vLAN on a Physical Wire", + "logical-link": { + "link-name": "sn6ca392ve2-xe-10/2/3.117|sn4ca01pbg", + "link-type": "l2bridge", + "resource-version": "1465571382", + "persona-model-id": "32bee148-2cae-4f3d-a42e-22c9e4f078a2", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "pBgf", + "pserver": { + "hostname": "sn4ca01pbg", + "in-maint": false, + "resource-version": "1470978156" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "VL ELAN", + "logical-link": { + "link-name": "sn6ca391ve2-ae6.1927|asbg0003v", + "link-type": "l2bridge", + "resource-version": "1465571381", + "persona-model-id": "932518e5-4260-4cc4-8038-df604a367f85", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vDbe", + "generic-vnf": { + "vnf-id": "VAPP-9320", + "vnf-name": "asbg0003v", + "vnf-type": "ASBGv No TLS", + "service-id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d", + "prov-status": "PROV", + "ipv4-oam-address": "135.193.152.168", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1470978156" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + } + ] + } + }, + { + "virtual-data-center": { + "vdc-id": "15001219", + "vdc-name": "ALPHARETTA_GA01", + "resource-version": "1465571380" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "VL ELAN", + "logical-link": { + "link-name": "alrga392ve2-ae6.1322|dbzx0004v", + "link-type": "l2bridge", + "resource-version": "1465571380", + "persona-model-id": "932518e5-4260-4cc4-8038-df604a367f85", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vDbe", + "generic-vnf": { + "vnf-id": "VAPP-1883", + "vnf-name": "dbzx0003v", + "vnf-type": "vSRX vDBE-V VNF", + "service-id": "12a96a9d-4b4c-4349-a950-fe1159602621", + "prov-status": "ACTIVE", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1470978153" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "VL ELAN", + "logical-link": { + "link-name": "alrga391ve2-ae6.1322|dbzx0004v", + "link-type": "l2bridge", + "resource-version": "1465571379", + "persona-model-id": "932518e5-4260-4cc4-8038-df604a367f85", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vDbe", + "generic-vnf": { + "vnf-id": "VAPP-1883", + "vnf-name": "dbzx0003v", + "vnf-type": "vSRX vDBE-V VNF", + "service-id": "12a96a9d-4b4c-4349-a950-fe1159602621", + "prov-status": "ACTIVE", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1470978153" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "VL ELAN", + "logical-link": { + "link-name": "alrga392ve2-ae6.1927|asbg0004v", + "link-type": "l2bridge", + "resource-version": "1465571380", + "persona-model-id": "932518e5-4260-4cc4-8038-df604a367f85", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vDbe", + "generic-vnf": { + "vnf-id": "VAPP-5305", + "vnf-name": "asbg0004v", + "vnf-type": "ASBGv No TLS", + "service-id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d", + "prov-status": "PROV", + "ipv4-oam-address": "135.190.182.168", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1470978152" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "vLAN on a Physical Wire", + "logical-link": { + "link-name": "alrga391ve2-xe-10/2/3.117|ar4ga01pbg", + "link-type": "l2bridge", + "resource-version": "1465571379", + "persona-model-id": "32bee148-2cae-4f3d-a42e-22c9e4f078a2", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "pBgf", + "pserver": { + "hostname": "ar4ga01pbg", + "in-maint": false, + "resource-version": "1470978153" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "VL ELAN", + "logical-link": { + "link-name": "alrga391ve2-ae6.1927|asbg0004v", + "link-type": "l2bridge", + "resource-version": "1465571380", + "persona-model-id": "932518e5-4260-4cc4-8038-df604a367f85", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vDbe", + "generic-vnf": { + "vnf-id": "VAPP-5305", + "vnf-name": "asbg0004v", + "vnf-type": "ASBGv No TLS", + "service-id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d", + "prov-status": "PROV", + "ipv4-oam-address": "135.190.182.168", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1470978152" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + }, + { + "model-name": "vLAN on a Physical Wire", + "logical-link": { + "link-name": "alrga392ve2-xe-10/2/3.117|ar4ga01pbg", + "link-type": "l2bridge", + "resource-version": "1465571380", + "persona-model-id": "32bee148-2cae-4f3d-a42e-22c9e4f078a2", + "persona-model-version": "1" + }, + "extra-properties": {}, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "pBgf", + "pserver": { + "hostname": "ar4ga01pbg", + "in-maint": false, + "resource-version": "1470978153" + }, + "extra-properties": {}, + "inventory-response-items": {} + } + ] + } + } + ] + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/model-validation/instance-reader/connector-model-name.json b/src/test/resources/model-validation/instance-reader/connector-model-name.json new file mode 100644 index 0000000..60e6401 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/connector-model-name.json @@ -0,0 +1,84 @@ +{ + "model-name": "Test Connector Model Name", + "connector": { + "resource-instance-id": "c7611ebe-c324-48f1-8085-94aef0c12fd", + "resource-version": "1467975776", + "persona-model-id": "connector-widget-id", + "persona-model-version": "v1.0", + "widget-model-id": "example-widget-model-id-val-69486", + "widget-model-version": "v1.0" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "Test VC Model Name", + "virtual-data-center": { + "vdc-id": "vdc-01", + "vdc-name": "example-vdc-name-val-10107", + "resource-version": "1467975781" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "Test LL Model Name", + "logical-link": { + "link-name": "example-link-name-val-23759", + "link-type": "example-link-type-val-23759", + "speed-value": "example-speed-value-val-23759", + "speed-units": "example-speed-units-val-23759", + "ip-version": "example-ip-version-val-23759", + "routing-protocol": "example-routing-protocol-val-23759", + "resource-version": "1467975786", + "persona-model-id": "example-persona-model-id-val-23759", + "persona-model-version": "example-persona-model-version-val-23759", + "widget-model-id": "example-widget-model-id-val-23759", + "widget-model-version": "example-widget-model-version-val-23759" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "pserver": { + "hostname": "example-hostname-val-79914", + "ptnii-equip-name": "example-ptnii-equip-name-val-79914", + "number-of-cpus": 79914, + "disk-in-gigabytes": 79914, + "ram-in-megabytes": 79914, + "equip-type": "example-equip-type-val-79914", + "equip-vendor": "example-equip-vendor-val-79914", + "equip-model": "example-equip-model-val-79914", + "fqdn": "example-fqdn-val-79914", + "pserver-selflink": "example-pserver-selflink-val-79914", + "ipv4-oam-address": "example-ipv4-oam-address-val-79914", + "serial-number": "example-serial-number-val-79914", + "pserver-id": "example-pserver-id-val-79914", + "internet-topology": "example-internet-topology-val-79914", + "in-maint": true, + "resource-version": "1467994603", + "pserver-name2": "example-pserver-name2-val-79914", + "purpose": "example-purpose-val-79914" + }, + "extra-properties": { + + }, + "inventory-response-items": { + + } + } + ] + } + } + ] + } + } + ] + } +} diff --git a/src/test/resources/model-validation/instance-reader/connector-sibling-inventory-items.json b/src/test/resources/model-validation/instance-reader/connector-sibling-inventory-items.json new file mode 100644 index 0000000..b032966 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/connector-sibling-inventory-items.json @@ -0,0 +1,118 @@ +{ + "connector": { + "resource-instance-id": "c7611ebe-c324-48f1-8085-94aef0c12fd", + "resource-version": "1467975776", + "persona-model-id": "connector-widget-id", + "persona-model-version": "v1.0", + "widget-model-id": "example-widget-model-id-val-69486", + "widget-model-version": "v1.0" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "virtual-data-center": { + "vdc-id": "vdc-01", + "vdc-name": "example-vdc-name-val-10107", + "resource-version": "1467975781" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "Test LL Model Name", + "logical-link": { + "link-name": "example-link-name-val-23759", + "link-type": "example-link-type-val-23759", + "speed-value": "example-speed-value-val-23759", + "speed-units": "example-speed-units-val-23759", + "ip-version": "example-ip-version-val-23759", + "routing-protocol": "example-routing-protocol-val-23759", + "resource-version": "1467975786", + "persona-model-id": "example-persona-model-id-val-23759", + "persona-model-version": "example-persona-model-version-val-23759", + "widget-model-id": "example-widget-model-id-val-23759", + "widget-model-version": "example-widget-model-version-val-23759" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "generic-vnf": { + "vnf-id": "generic-vnf-01", + "vnf-name": "example-vnf-name-val-3501", + "vnf-name2": "example-vnf-name2-val-3501", + "vnf-type": "example-vnf-type-val-3501", + "regional-resource-zone": "example-regional-resource-zone-val-3501", + "prov-status": "example-prov-status-val-3501", + "operational-state": "example-operational-state-val-3501", + "license-key": "example-license-key-val-3501", + "equipment-role": "example-equipment-role-val-3501", + "orchestration-status": "example-orchestration-status-val-3501", + "heat-stack-id": "example-heat-stack-id-val-3501", + "mso-catalog-key": "example-mso-catalog-key-val-3501", + "management-option": "example-management-option-val-3501", + "ipv4-oam-address": "example-ipv4-oam-address-val-3501", + "ipv4-loopback0-address": "example-ipv4-loopback0-address-val-3501", + "nm-lan-v6-address": "example-nm-lan-v6-address-val-3501", + "management-v6-address": "example-management-v6-address-val-3501", + "vcpu": 1817, + "vcpu-units": "example-vcpu-units-val-3501", + "vmemory": 6020, + "vmemory-units": "example-vmemory-units-val-3501", + "vdisk": 5281, + "vdisk-units": "example-vdisk-units-val-3501", + "in-maint": false, + "is-closed-loop-disabled": true, + "resource-version": "1468321711" + }, + "extra-properties": { + + }, + "inventory-response-items": { + + } + }, + { + "pserver": { + "hostname": "example-hostname-val-79914", + "ptnii-equip-name": "example-ptnii-equip-name-val-79914", + "number-of-cpus": 79914, + "disk-in-gigabytes": 79914, + "ram-in-megabytes": 79914, + "equip-type": "example-equip-type-val-79914", + "equip-vendor": "example-equip-vendor-val-79914", + "equip-model": "example-equip-model-val-79914", + "fqdn": "example-fqdn-val-79914", + "pserver-selflink": "example-pserver-selflink-val-79914", + "ipv4-oam-address": "example-ipv4-oam-address-val-79914", + "serial-number": "example-serial-number-val-79914", + "pserver-id": "example-pserver-id-val-79914", + "internet-topology": "example-internet-topology-val-79914", + "in-maint": true, + "resource-version": "1467994603", + "pserver-name2": "example-pserver-name2-val-79914", + "purpose": "example-purpose-val-79914" + }, + "extra-properties": { + + }, + "inventory-response-items": { + + } + } + ] + } + } + ] + } + } + ] + } +} diff --git a/src/test/resources/model-validation/instance-reader/connector.json b/src/test/resources/model-validation/instance-reader/connector.json new file mode 100644 index 0000000..1870dc8 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/connector.json @@ -0,0 +1,82 @@ +{ + "connector": { + "resource-instance-id": "c7611ebe-c324-48f1-8085-94aef0c12fd", + "resource-version": "1467975776", + "persona-model-id": "connector-widget-id", + "persona-model-version": "v1.0", + "widget-model-id": "example-widget-model-id-val-69486", + "widget-model-version": "v1.0" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "virtual-data-center": { + "vdc-id": "vdc-01", + "vdc-name": "example-vdc-name-val-10107", + "resource-version": "1467975781" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "Test LL Model Name", + "logical-link": { + "link-name": "example-link-name-val-23759", + "link-type": "example-link-type-val-23759", + "speed-value": "example-speed-value-val-23759", + "speed-units": "example-speed-units-val-23759", + "ip-version": "example-ip-version-val-23759", + "routing-protocol": "example-routing-protocol-val-23759", + "resource-version": "1467975786", + "persona-model-id": "example-persona-model-id-val-23759", + "persona-model-version": "example-persona-model-version-val-23759", + "widget-model-id": "example-widget-model-id-val-23759", + "widget-model-version": "example-widget-model-version-val-23759" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "pserver": { + "hostname": "example-hostname-val-79914", + "ptnii-equip-name": "example-ptnii-equip-name-val-79914", + "number-of-cpus": 79914, + "disk-in-gigabytes": 79914, + "ram-in-megabytes": 79914, + "equip-type": "example-equip-type-val-79914", + "equip-vendor": "example-equip-vendor-val-79914", + "equip-model": "example-equip-model-val-79914", + "fqdn": "example-fqdn-val-79914", + "pserver-selflink": "example-pserver-selflink-val-79914", + "ipv4-oam-address": "example-ipv4-oam-address-val-79914", + "serial-number": "example-serial-number-val-79914", + "pserver-id": "example-pserver-id-val-79914", + "internet-topology": "example-internet-topology-val-79914", + "in-maint": true, + "resource-version": "1467994603", + "pserver-name2": "example-pserver-name2-val-79914", + "purpose": "example-purpose-val-79914" + }, + "extra-properties": { + + }, + "inventory-response-items": { + + } + } + ] + } + } + ] + } + } + ] + } +} diff --git a/src/test/resources/model-validation/instance-reader/expected-generic-vnf.json b/src/test/resources/model-validation/instance-reader/expected-generic-vnf.json new file mode 100644 index 0000000..ab5bb10 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/expected-generic-vnf.json @@ -0,0 +1,36 @@ +{ + "generic-vnf": { + "vnf-id": "generic-vnf-01", + "vnf-name": "example-vnf-name-val-3501", + "vnf-name2": "example-vnf-name2-val-3501", + "vnf-type": "example-vnf-type-val-3501", + "regional-resource-zone": "example-regional-resource-zone-val-3501", + "prov-status": "example-prov-status-val-3501", + "operational-state": "example-operational-state-val-3501", + "license-key": "example-license-key-val-3501", + "equipment-role": "example-equipment-role-val-3501", + "orchestration-status": "example-orchestration-status-val-3501", + "heat-stack-id": "example-heat-stack-id-val-3501", + "mso-catalog-key": "example-mso-catalog-key-val-3501", + "management-option": "example-management-option-val-3501", + "ipv4-oam-address": "example-ipv4-oam-address-val-3501", + "ipv4-loopback0-address": "example-ipv4-loopback0-address-val-3501", + "nm-lan-v6-address": "example-nm-lan-v6-address-val-3501", + "management-v6-address": "example-management-v6-address-val-3501", + "vcpu": 1817, + "vcpu-units": "example-vcpu-units-val-3501", + "vmemory": 6020, + "vmemory-units": "example-vmemory-units-val-3501", + "vdisk": 5281, + "vdisk-units": "example-vdisk-units-val-3501", + "in-maint": false, + "is-closed-loop-disabled": true, + "resource-version": "1468321711" + }, + "extra-properties": { + + }, + "inventory-response-items": { + + } +} diff --git a/src/test/resources/model-validation/instance-reader/expected-logical-link.json b/src/test/resources/model-validation/instance-reader/expected-logical-link.json new file mode 100644 index 0000000..90bb7de --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/expected-logical-link.json @@ -0,0 +1,51 @@ +{ + "model-name": "Test LL Model Name", + "logical-link": { + "link-name": "example-link-name-val-23759", + "link-type": "example-link-type-val-23759", + "speed-value": "example-speed-value-val-23759", + "speed-units": "example-speed-units-val-23759", + "ip-version": "example-ip-version-val-23759", + "routing-protocol": "example-routing-protocol-val-23759", + "resource-version": "1467975786", + "persona-model-id": "example-persona-model-id-val-23759", + "persona-model-version": "example-persona-model-version-val-23759", + "widget-model-id": "example-widget-model-id-val-23759", + "widget-model-version": "example-widget-model-version-val-23759" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "pserver": { + "hostname": "example-hostname-val-79914", + "ptnii-equip-name": "example-ptnii-equip-name-val-79914", + "number-of-cpus": 79914, + "disk-in-gigabytes": 79914, + "ram-in-megabytes": 79914, + "equip-type": "example-equip-type-val-79914", + "equip-vendor": "example-equip-vendor-val-79914", + "equip-model": "example-equip-model-val-79914", + "fqdn": "example-fqdn-val-79914", + "pserver-selflink": "example-pserver-selflink-val-79914", + "ipv4-oam-address": "example-ipv4-oam-address-val-79914", + "serial-number": "example-serial-number-val-79914", + "pserver-id": "example-pserver-id-val-79914", + "internet-topology": "example-internet-topology-val-79914", + "in-maint": true, + "resource-version": "1467994603", + "pserver-name2": "example-pserver-name2-val-79914", + "purpose": "example-purpose-val-79914" + }, + "extra-properties": { + + }, + "inventory-response-items": { + + } + } + ] + } +} \ No newline at end of file diff --git a/src/test/resources/model-validation/instance-reader/expected-pserver.json b/src/test/resources/model-validation/instance-reader/expected-pserver.json new file mode 100644 index 0000000..8d4b8c5 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/expected-pserver.json @@ -0,0 +1,28 @@ +{ + "pserver": { + "hostname": "example-hostname-val-79914", + "ptnii-equip-name": "example-ptnii-equip-name-val-79914", + "number-of-cpus": 79914, + "disk-in-gigabytes": 79914, + "ram-in-megabytes": 79914, + "equip-type": "example-equip-type-val-79914", + "equip-vendor": "example-equip-vendor-val-79914", + "equip-model": "example-equip-model-val-79914", + "fqdn": "example-fqdn-val-79914", + "pserver-selflink": "example-pserver-selflink-val-79914", + "ipv4-oam-address": "example-ipv4-oam-address-val-79914", + "serial-number": "example-serial-number-val-79914", + "pserver-id": "example-pserver-id-val-79914", + "internet-topology": "example-internet-topology-val-79914", + "in-maint": true, + "resource-version": "1467994603", + "pserver-name2": "example-pserver-name2-val-79914", + "purpose": "example-purpose-val-79914" + }, + "extra-properties": { + + }, + "inventory-response-items": { + + } +} \ No newline at end of file diff --git a/src/test/resources/model-validation/instance-reader/expected-virtual-data-center-model-name.json b/src/test/resources/model-validation/instance-reader/expected-virtual-data-center-model-name.json new file mode 100644 index 0000000..e72a52f --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/expected-virtual-data-center-model-name.json @@ -0,0 +1,66 @@ +{ + "model-name": "Test VC Model Name", + "virtual-data-center": { + "vdc-id": "vdc-01", + "vdc-name": "example-vdc-name-val-10107", + "resource-version": "1467975781" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "Test LL Model Name", + "logical-link": { + "link-name": "example-link-name-val-23759", + "link-type": "example-link-type-val-23759", + "speed-value": "example-speed-value-val-23759", + "speed-units": "example-speed-units-val-23759", + "ip-version": "example-ip-version-val-23759", + "routing-protocol": "example-routing-protocol-val-23759", + "resource-version": "1467975786", + "persona-model-id": "example-persona-model-id-val-23759", + "persona-model-version": "example-persona-model-version-val-23759", + "widget-model-id": "example-widget-model-id-val-23759", + "widget-model-version": "example-widget-model-version-val-23759" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "pserver": { + "hostname": "example-hostname-val-79914", + "ptnii-equip-name": "example-ptnii-equip-name-val-79914", + "number-of-cpus": 79914, + "disk-in-gigabytes": 79914, + "ram-in-megabytes": 79914, + "equip-type": "example-equip-type-val-79914", + "equip-vendor": "example-equip-vendor-val-79914", + "equip-model": "example-equip-model-val-79914", + "fqdn": "example-fqdn-val-79914", + "pserver-selflink": "example-pserver-selflink-val-79914", + "ipv4-oam-address": "example-ipv4-oam-address-val-79914", + "serial-number": "example-serial-number-val-79914", + "pserver-id": "example-pserver-id-val-79914", + "internet-topology": "example-internet-topology-val-79914", + "in-maint": true, + "resource-version": "1467994603", + "pserver-name2": "example-pserver-name2-val-79914", + "purpose": "example-purpose-val-79914" + }, + "extra-properties": { + + }, + "inventory-response-items": { + + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/src/test/resources/model-validation/instance-reader/expected-virtual-data-center.json b/src/test/resources/model-validation/instance-reader/expected-virtual-data-center.json new file mode 100644 index 0000000..7445823 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/expected-virtual-data-center.json @@ -0,0 +1,65 @@ +{ + "virtual-data-center": { + "vdc-id": "vdc-01", + "vdc-name": "example-vdc-name-val-10107", + "resource-version": "1467975781" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "Test LL Model Name", + "logical-link": { + "link-name": "example-link-name-val-23759", + "link-type": "example-link-type-val-23759", + "speed-value": "example-speed-value-val-23759", + "speed-units": "example-speed-units-val-23759", + "ip-version": "example-ip-version-val-23759", + "routing-protocol": "example-routing-protocol-val-23759", + "resource-version": "1467975786", + "persona-model-id": "example-persona-model-id-val-23759", + "persona-model-version": "example-persona-model-version-val-23759", + "widget-model-id": "example-widget-model-id-val-23759", + "widget-model-version": "example-widget-model-version-val-23759" + }, + "extra-properties": { + + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "pserver": { + "hostname": "example-hostname-val-79914", + "ptnii-equip-name": "example-ptnii-equip-name-val-79914", + "number-of-cpus": 79914, + "disk-in-gigabytes": 79914, + "ram-in-megabytes": 79914, + "equip-type": "example-equip-type-val-79914", + "equip-vendor": "example-equip-vendor-val-79914", + "equip-model": "example-equip-model-val-79914", + "fqdn": "example-fqdn-val-79914", + "pserver-selflink": "example-pserver-selflink-val-79914", + "ipv4-oam-address": "example-ipv4-oam-address-val-79914", + "serial-number": "example-serial-number-val-79914", + "pserver-id": "example-pserver-id-val-79914", + "internet-topology": "example-internet-topology-val-79914", + "in-maint": true, + "resource-version": "1467994603", + "pserver-name2": "example-pserver-name2-val-79914", + "purpose": "example-purpose-val-79914" + }, + "extra-properties": { + + }, + "inventory-response-items": { + + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/src/test/resources/model-validation/instance-reader/model-instance-mapping-attributes.json_conf b/src/test/resources/model-validation/instance-reader/model-instance-mapping-attributes.json_conf new file mode 100644 index 0000000..1abe24f --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/model-instance-mapping-attributes.json_conf @@ -0,0 +1,12 @@ +[ + { + "mappingType": "ATTRIBUTE", + "model": { + "value": "metadata/metadatum/metaname" + }, + "instance": { + "origin": "$.inventory-response-item[0]", + "value": "$..extra-properties.metadatum[*].metaname" + } + } +] \ No newline at end of file diff --git a/src/test/resources/model-validation/instance-reader/model-instance-mapping-root-missing.json_conf b/src/test/resources/model-validation/instance-reader/model-instance-mapping-root-missing.json_conf new file mode 100644 index 0000000..c8d5591 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/model-instance-mapping-root-missing.json_conf @@ -0,0 +1,16 @@ +[ + { + "mappingType" : "RELATIONSHIP", + "model": { + "root": "model-elements/model-element", + "filter": { + "path": "relationship-list/relationship/related-to-property/property-value[../property-key/text()='model.model-type']", + "valid": ["widget"] + }, + "value": "relationship-list/relationship/related-to-property/property-value[../property-key/text()='model.model-name']" + }, + "instance": { + "origin": "$.inventory-response-item[0]" + } + } +] \ No newline at end of file diff --git a/src/test/resources/model-validation/instance-reader/model-instance-mapping-root-unknown.json_conf b/src/test/resources/model-validation/instance-reader/model-instance-mapping-root-unknown.json_conf new file mode 100644 index 0000000..990d0c7 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/model-instance-mapping-root-unknown.json_conf @@ -0,0 +1,17 @@ +[ + { + "mappingType" : "RELATIONSHIP", + "model": { + "root": "model-elements/model-element", + "filter": { + "path": "relationship-list/relationship/related-to-property/property-value[../property-key/text()='model.model-type']", + "valid": ["widget"] + }, + "value": "relationship-list/relationship/related-to-property/property-value[../property-key/text()='model.model-name']" + }, + "instance": { + "origin": "$.inventory-response-item[0]", + "root": "NOT_KNOWN" + } + } +] \ No newline at end of file diff --git a/src/test/resources/model-validation/instance-reader/model-instance-mapping.json_conf b/src/test/resources/model-validation/instance-reader/model-instance-mapping.json_conf new file mode 100644 index 0000000..917c575 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/model-instance-mapping.json_conf @@ -0,0 +1,17 @@ +[ + { + "mappingType": "RELATIONSHIP", + "model": { + "root": "model-elements/model-element", + "filter": { + "path": "relationship-list/relationship/related-to-property/property-value[../property-key/text()='model.model-type']", + "valid": ["widget"] + }, + "value": "relationship-list/relationship/related-to-property/property-value[../property-key/text()='model.model-name']" + }, + "instance": { + "origin": "$.inventory-response-item[0]", + "root": "$.inventory-response-items.inventory-response-item[*]" + } + } +] \ No newline at end of file diff --git a/src/test/resources/model-validation/instance-reader/test-validation-service-beans.xml b/src/test/resources/model-validation/instance-reader/test-validation-service-beans.xml new file mode 100644 index 0000000..baf07b2 --- /dev/null +++ b/src/test/resources/model-validation/instance-reader/test-validation-service-beans.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + \ No newline at end of file -- cgit 1.2.3-korg