BUG 652 leafref CCE & BUG 720 colons problem 35/6335/4
authorJozef Gloncak <jgloncak@cisco.com>
Wed, 23 Apr 2014 12:56:10 +0000 (14:56 +0200)
committerJozef Gloncak <jgloncak@cisco.com>
Thu, 24 Apr 2014 09:15:24 +0000 (11:15 +0200)
commit874d0e74084fc55af280a97052570c8cccf60821
tree5e2feb0dc02e6c5029e0755e8ff4249ef5a6789f
parent632b3b4a1c9477ca5c744e04021e4061e4d97130
BUG 652 leafref CCE & BUG 720 colons problem

BUG 652 leafref Class cast exception
By default if input data were in format which was possible to parse as
XPath if was done like this. It caused that for leafref which indexed to
instance-identifier the value was parsed as XPath and not as string.

BUG 720 colons problem in JSON
If input string contained colon (:) then it was dealed as namespace:value
and object of type IdentityValuesDTO was created (it is probable that
data could be of type identityref). If data wasn't of type leafref then it
was incorrectly processed as leafref.
The RestCodec was updated to correctly translate data (cases when data
contains ':' but aren't of type leafref)

Change-Id: I0cba06bce1b1c69f6901cc90d2b30a3735e5f57e
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonReader.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestUtil.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlReader.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/IdentityValuesDTO.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestCodec.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.xtend
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/XmlAndJsonToCnSnLeafRefTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/resources/leafref/json/jsondata.json [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/resources/leafref/xml/xmldata.xml [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/resources/leafref/yang/leafref-module.yang [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/resources/leafref/yang/referenced-module.yang [new file with mode: 0644]