BUG-1196: fixed bug in choice case codec. 71/8071/4
authorMartin Vitez <mvitez@cisco.com>
Tue, 17 Jun 2014 11:12:13 +0000 (13:12 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Tue, 17 Jun 2014 18:50:17 +0000 (20:50 +0200)
commit92e4fd194891f567aad81f36352aaf9c80df7838
tree67a81b2e993a8ced5441a5e52c90a7ed11c818a2
parent3029dc7ed6a32b24aa839922e7677edcd519173a
BUG-1196: fixed bug in choice case codec.

Implemented lazy generation of choice case codecs by
using DispatchChoiceCodecImpl - delegator for de/serialization
of case instances in
PublicChoiceCodecImpl. This codec is created for each interface
generated from yang choice. It contains information about all
implementations of choice-cases in context and delegate
de/serialization of concrete case instance to correct case
codec based on given InstanceIdentifier.

ChoiceCaseCodecImpl instances are created when concrete case
is encountered.

By using DispatchChoiceCodecImpl we don't need to hold
COMPOSITE_TO_CASE and CLASS_TO_CASE_MAP variables in runtime
generated codec which were
used to serialization and deserialization before.

Added test which test serialization / deserialization.

Change-Id: I52eb78f66e91695758b825b109639d039860f997
Signed-off-by: Martin Vitez <mvitez@cisco.com>
17 files changed:
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/BindingGeneratorImpl.xtend
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/CodecMapping.java
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/LazyGeneratedCodecRegistry.java
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/ModuleContext.java
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/TransformerGenerator.xtend
common/parent/pom.xml
integration-test/bug1196-test-model/pom.xml [new file with mode: 0644]
integration-test/bug1196-test-model/src/main/yang/network-topology-pcep.yang [new file with mode: 0644]
integration-test/bug1196-test-model/src/main/yang/network-topology-unix.yang [new file with mode: 0644]
integration-test/bug1196-test-model/src/main/yang/network-topology@2013-10-21.yang [new file with mode: 0644]
integration-test/bug1196-test-model/src/main/yang/odl-pcep-ietf-stateful07.yang [new file with mode: 0644]
integration-test/bug1196-test-model/src/main/yang/pcep-types.yang [new file with mode: 0644]
integration-test/pom.xml
restconf/restconf-util/pom.xml
restconf/restconf-util/src/test/java/org/opendaylight/yangtools/restconf/utils/Bug1196Test.java [new file with mode: 0644]
restconf/restconf-util/src/test/resources/topology-bug1196-linux.xml [new file with mode: 0644]
restconf/restconf-util/src/test/resources/topology-bug1196-unix.xml [new file with mode: 0644]