Bug 2363, Bug 2205. Beta version of LeafRefContext tree computation 91/14891/19
authorPeter Kajsa <pkajsa@cisco.com>
Wed, 4 Feb 2015 09:06:09 +0000 (10:06 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Thu, 23 Apr 2015 17:51:05 +0000 (19:51 +0200)
commit42e93bc057034b3c4d0dd9ac82c827de9613af68
tree546572eaafc937c3b1d8b28f43098f06ff4ad422
parentd3056708c6e3b860df57caae297d5a419e8ea498
Bug 2363, Bug 2205. Beta version of LeafRefContext tree computation

beta version of DataTree leafrefs values validation

Currently works (Bug 2363):

- LeafRefContext tree build with all relations:
          - isReferencing/ hasReferencingChild
          - isReferenced/ hasReferencedChild
          - leafref target node -> leafref source nodes
- validation of LeafRef Path and Predicates syntax according to RFC6020
  specification
- parsing of all LeafRef Path components (i.e.: LeafRef absolute/relative
  target path, path Predicates, key path expressions) into LeafRefPath
  instance
- pack of utils methods over LeafRefContext tree
- a couple of simple tests

Currently works (Bug 2205):

- validation of LeafRefs values and LeafRefs targets for WRITE, MERGE and
  DELETE operations
- leafref path predicates evaluation (also multiple)

Currently known issues (Bug 2363):

- improve leafref identification, also for cases when type of the leaf is
  typedef -> typedef -> etc.. -> leafref
- handle also choices without case
- questionable issue is, whether it is necessary to merge referencing and
  referencedBy subtrees under the root context (currently are not)
- in equals method check also for predicates equality
- test the solution

Currently known issues (Bug 2205):
- handle also UnkeyedLists
- perfrom further testing
- increase unit tests coverage
- add tests for special cases.

Change-Id: Id873fb446fe40855993fe00e6a56f82d3daee491
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
35 files changed:
yang/yang-data-impl/pom.xml
yang/yang-data-impl/src/main/antlr/LeafRefPathLexer.g4 [new file with mode: 0644]
yang/yang-data-impl/src/main/antlr/LeafRefPathParser.g4 [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefContext.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefContextBuilder.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefContextTreeBuilder.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefContextUtils.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefDataValidationFailedException.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPath.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPathErrorListener.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPathParseException.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPathParserImpl.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPathParserListenerImpl.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPathSyntaxErrorException.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefUtils.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefValidatation.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefYangSyntaxErrorException.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/QNamePredicate.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/QNamePredicateBuilder.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/QNamePredicateImpl.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/QNameWithPredicate.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/QNameWithPredicateBuilder.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/QNameWithPredicateImpl.java [new file with mode: 0644]
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/DataTreeCandidateValidatorTest.java [new file with mode: 0644]
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/DataTreeCandidateValidatorTest2.java [new file with mode: 0644]
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/DataTreeCandidateValidatorTest3.java [new file with mode: 0644]
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/LeafRefContextTest.java [new file with mode: 0644]
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/LeafRefContextTreeBuilderTest.java [new file with mode: 0644]
yang/yang-data-impl/src/test/resources/leafref-context-test/correct-modules/import-mod.yang [new file with mode: 0644]
yang/yang-data-impl/src/test/resources/leafref-context-test/correct-modules/leafref-test.yang [new file with mode: 0644]
yang/yang-data-impl/src/test/resources/leafref-context-test/correct-modules/leafref-test2.yang [new file with mode: 0644]
yang/yang-data-impl/src/test/resources/leafref-context-test/incorrect-modules/leafref-test.yang [new file with mode: 0644]
yang/yang-data-impl/src/test/resources/leafref-validation/leafref-validation.yang [new file with mode: 0644]
yang/yang-data-impl/src/test/resources/leafref-validation/leafref-validation2.yang [new file with mode: 0644]
yang/yang-data-impl/src/test/resources/leafref-validation/leafref-validation3.yang [new file with mode: 0644]