[YANGTOOLS-188] Mapping service - xml to java object - missing choice's case Created: 13/Jun/14  Updated: 10/Apr/22  Resolved: 18/Jun/14

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Milos Fabian Assignee: Martin Vitez
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


External issue ID: 1196
Priority: High

 Description   

If new case is added in augmentation into the choice, mapping service does not translate xml node representing the case into java object.



 Comments   
Comment by Milos Fabian [ 13/Jun/14 ]

import network-topology-pcep

{ prefix topo; revision-date 2013-10-24; }

import network-topology

{ prefix nt; revision-date 2013-10-21; }

import odl-pcep-ietf-stateful07

{ prefix stateful; revision-date 2013-12-22; }

augment "/nt:network-topology/nt:topology/nt:node/topo:path-computation-client/topo:reported-lsp/stateful:lsp/stateful:tlvs/stateful:vs-tlv/stateful:vendor-payload" {
case linux {
container linux-sub-tlvs {
leaf linux-value

{ type uint8; } } }

}

Comment by Milos Fabian [ 13/Jun/14 ]

@Test
public void testXmlDataToDataObject()

{ final InstanceIdentifier<Topology> instanceIdentifier = InstanceIdentifier.builder(NetworkTopology.class) .child(Topology.class, new TopologyKey(new TopologyId("example-pcep-topology"))).toInstance(); final InputStream is = this.getClass().getClassLoader().getResourceAsStream("example-pcep-topology.xml"); final DataSchemaNode dataSchema = RestconfUtils.toRestconfIdentifier(instanceIdentifier, this.mappingService, this.mappingService.getSchemaContext()).getValue(); this.topology = (Topology) RestconfUtils.dataObjectFromInputStream(instanceIdentifier, is, this.mappingService.getSchemaContext(), this.mappingService, dataSchema); assertNotNull(topology); assertNotNull(topology.getNode()); assertEquals(1, topology.getNode().size()); Node node = topology.getNode().get(0); Node1 node1 = node.getAugmentation(Node1.class); assertNotNull(node1); final Lsp lsp = node1.getPathComputationClient().getReportedLsp().get(0).getAugmentation(ReportedLsp1.class).getLsp(); org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.lsp.Tlvs tlvs = lsp.getTlvs(); assertNotNull(tlvs); assertNotNull(tlvs.getVsTlv().getVendorPayload()); }
Comment by Milos Fabian [ 13/Jun/14 ]

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
<server-provided>true</server-provided>
<topology-id>example-pcep-topology</topology-id>
<topology-types/>
<node>
<path-computation-client xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
<state-sync>synchronized</state-sync>
<stateful-tlv>
<stateful>
<lsp-update-capability>true</lsp-update-capability>
<include-db-version>false</include-db-version>
<initiation>true</initiation>
</stateful>
</stateful-tlv>
<reported-lsp>
<name>update-tunel</name>
<path>
<bandwidth>
<bandwidth>AAAAAA==</bandwidth>
<ignore>false</ignore>
<processing-rule>false</processing-rule>
</bandwidth>
<ero>
<ignore>false</ignore>
<processing-rule>false</processing-rule>
<subobject>
<loose>false</loose>
<ip-prefix>
<ip-prefix>195.20.160.40/32</ip-prefix>
</ip-prefix>
</subobject>
<subobject>
<loose>false</loose>
<ip-prefix>
<ip-prefix>201.20.160.43/32</ip-prefix>
</ip-prefix>
</subobject>
</ero>
<lspa>
<exclude-any>0</exclude-any>
<hold-priority>7</hold-priority>
<ignore>false</ignore>
<include-all>0</include-all>
<include-any>0</include-any>
<local-protection-desired>false</local-protection-desired>
<processing-rule>false</processing-rule>
<setup-priority>7</setup-priority>
</lspa>
</path>
<lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
<tlvs>
<symbolic-path-name>
<path-name>dXBkYXRlLXR1bmVs</path-name>
</symbolic-path-name>
<vs-tlv>
<enterprise-number>9</enterprise-number>
<linux-sub-tlvs>
<linux-value>5</linux-value>
</linux-sub-tlvs>
</vs-tlv>
</tlvs>
<delegate>true</delegate>
<processing-rule>false</processing-rule>
<ignore>false</ignore>
<operational>true</operational>
<sync>false</sync>
<plsp-id>40</plsp-id>
<remove>false</remove>
</lsp>
</reported-lsp>
<ip-address>39.39.39.39</ip-address>
</path-computation-client>
<node-id>pcc://39.39.39.39</node-id>
</node>
</topology>

Comment by Tony Tkacik [ 17/Jun/14 ]

Fixed in
https://git.opendaylight.org/gerrit/#/c/8071/2

Generated at Wed Feb 07 20:52:31 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.