Removed 'code-generator' and 'model' projects. 03/803/1
authorMartin Vitez <mvitez@cisco.com>
Tue, 6 Aug 2013 13:09:42 +0000 (15:09 +0200)
committerMartin Vitez <mvitez@cisco.com>
Tue, 6 Aug 2013 13:11:25 +0000 (15:11 +0200)
Updated pom.

Change-Id: I3c9498af4a545215cecc441c995bcb47c6bf82fe
Signed-off-by: Martin Vitez <mvitez@cisco.com>
207 files changed:
opendaylight/sal/yang-prototype/code-generator/.gitignore [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-api/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-api/src/main/java/org/opendaylight/controller/sal/binding/generator/api/BindingGenerator.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-api/src/main/java/org/opendaylight/controller/sal/binding/generator/api/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/generator/impl/BindingGeneratorImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/generator/impl/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/BaseYangTypes.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/GroupingDefinitionDependencySort.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/TypeProviderImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/UnionDependencySort.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/AugmentRleativeXPathTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/AugmentedTypeTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BaseTypeProvider.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BinaryTypeTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BitAndUnionTOEnclosingTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ChoiceCaseGenTypesTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ControllerTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/DefinedTypesProviderTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ExtendedTypedefTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenEnumResolvingTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenTypesSubSetTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesBitsTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesStringTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/MethodSignaturePattern.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/SupportTestUtil.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/UnionTypeDefTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/UsesTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/abstract-topology.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/abstract-topology@2013-02-08.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/augment-abstract-topology@2013-05-03.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/iana-if-type@2012-06-05.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/ietf-interfaces@2012-11-15.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/ietf-yang-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-test-models/abstract-topology@2013-02-08.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-test-models/augment-abstract-topology@2013-05-03.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-test-models/augment-network-link-attributes@2013-05-03.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-test-models/augment-topology-tunnels@2013-05-03.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-test-models/iana-if-type@2012-06-05.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-test-models/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-test-models/ietf-interfaces@2012-11-15.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-test-models/ietf-yang-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/binary-type-test-models/binary-type-test.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/binary-type-test-models/binary-types@2013-06-13.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/bit_and_union_in_leaf.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/choice-case-type-test-models/augment-monitoring@2013-07-01.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/choice-case-type-test-models/choice-monitoring@2013-07-01.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/choice-case-type-test-models/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/choice-case-type-test-models/ietf-yang-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/controller-models/controller-network.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/controller-models/controller-openflow.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/controller-models/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/controller-models/ietf-yang-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/demo-topology.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/enum-test-models/abstract-topology@2013-02-08.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/enum-test-models/iana-if-type@2012-06-05.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/enum-test-models/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/enum-test-models/ietf-interfaces@2012-11-15.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/enum-test-models/ietf-yang-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/leafref-test-models/abstract-topology@2013-02-08.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/leafref-test-models/iana-if-type@2012-06-05.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/leafref-test-models/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/leafref-test-models/ietf-interfaces@2012-11-15.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/leafref-test-models/ietf-yang-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/list-composite-key.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/simple-bits-demo.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/simple-container-demo.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/simple-leaf-list-demo.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/simple-list-demo.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/simple-string-demo.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/typedef_of_typedef.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/union-test-models/abstract-topology.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/union-test-models/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping/uses-of-grouping-augment.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping/uses-of-grouping-case.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping/uses-of-grouping-container.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping/uses-of-grouping-dependencies.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping/uses-of-grouping-grouping.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping/uses-of-grouping-list.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping/uses-of-grouping-modul.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping/uses-of-grouping-notification.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/uses-of-grouping/uses-of-grouping-rpc.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-spi/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-spi/src/main/java/org/opendaylight/controller/sal/binding/generator/spi/BindingGeneratorServiceProvider.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-spi/src/main/java/org/opendaylight/controller/sal/binding/generator/spi/TypeProvider.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-spi/src/main/java/org/opendaylight/controller/sal/binding/generator/spi/TypeProviderFactory.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-spi/src/main/java/org/opendaylight/controller/sal/binding/generator/spi/YANGModuleIdentifier.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-spi/src/main/java/org/opendaylight/controller/sal/binding/generator/spi/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/AbstractBaseType.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/BindingGeneratorUtil.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/ReferencedTypeImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/TypeConstants.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/Types.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/AbstractGeneratedType.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/AbstractGeneratedTypeBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/AbstractTypeMember.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/AbstractTypeMemberBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/AnnotationTypeBuilderImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/ConstantImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/EnumerationBuilderImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/GeneratedPropertyBuilderImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/GeneratedPropertyImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/GeneratedTOBuilderImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/GeneratedTypeBuilderImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/MethodParameterImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/MethodSignatureBuilderImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/MethodSignatureImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/main/java/org/opendaylight/controller/binding/generator/util/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-generator-util/src/test/java/org/opendaylight/controller/binding/generator/util/generated/type/builder/AnnotationBuilderTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/BuilderGenerator.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/BuilderTemplate.xtend [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/ClassGenerator.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/ClassTemplate.xtend [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/Constants.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/EnumGenerator.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/EnumTemplate.xtend [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/GeneratorJavaFile.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/GeneratorUtil.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/InterfaceGenerator.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/InterfaceTemplate.xtend [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/java/org/opendaylight/controller/sal/java/api/generator/test/ClassCodeGeneratorTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/java/org/opendaylight/controller/sal/java/api/generator/test/GenerateInnerClassForBitsAndUnionInLeavesTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/java/org/opendaylight/controller/sal/java/api/generator/test/GeneratorJavaFileTest.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/java/org/opendaylight/controller/sal/java/api/generator/test/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/abstract-topology.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/bit_and_union_in_leaf.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/demo-topology.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/list-composite-key.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/simple-container-demo.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/simple-leaf-list-demo.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/simple-list-demo.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/abstract-topology@2013-02-08.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/iana-if-type@2012-06-05.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-interfaces@2012-11-15.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/test/resources/yang/ietf-yang-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/AccessModifier.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/AnnotationType.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/CodeGenerator.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/ConcreteType.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/Constant.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/Enumeration.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/GeneratedProperty.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/GeneratedTransferIdentityObject.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/GeneratedTransferObject.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/GeneratedType.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/MethodSignature.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/ParameterizedType.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/Type.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/TypeMember.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/WildcardType.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/AnnotationTypeBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/ConstantBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/EnumBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/GeneratedPropertyBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/GeneratedTOBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/GeneratedTypeBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/MethodSignatureBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/TypeMemberBuilder.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/builder/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/type/provider/package-info.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/maven-sal-api-gen-plugin/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/controller/maven/sal/api/gen/plugin/CodeGeneratorImpl.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/java/Example.java [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/augment-monitoring@2013-07-01.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/bit_and_union_in_leaf.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/choice-monitoring@2013-07-01.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/controller-network-ne.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/controller-network.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/controller-openflow-ipv6.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/controller-openflow.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/demo-topology.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/ietf-inet-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/ietf-yang-types@2010-09-24.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/simple-string-demo.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/typedef_of_typedef.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/pom.xml [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/toaster.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/src/site/site.xml [deleted file]
opendaylight/sal/yang-prototype/model/ietf/ietf-inet-types/pom.xml [deleted file]
opendaylight/sal/yang-prototype/model/ietf/ietf-inet-types/src/main/yang/ietf-inet-types.yang [deleted file]
opendaylight/sal/yang-prototype/model/ietf/ietf-yang-types/pom.xml [deleted file]
opendaylight/sal/yang-prototype/model/ietf/ietf-yang-types/src/main/yang/ietf-yang-types.yang [deleted file]
opendaylight/sal/yang-prototype/model/ietf/pom.xml [deleted file]
opendaylight/sal/yang-prototype/model/ietf/src/main/yang/.gitignore [deleted file]
opendaylight/sal/yang-prototype/model/model-openflow/pom.xml [deleted file]
opendaylight/sal/yang-prototype/model/model-openflow/src/main/yang/.gitignore [deleted file]
opendaylight/sal/yang-prototype/model/model-topology-bgp/pom.xml [deleted file]
opendaylight/sal/yang-prototype/model/model-topology/pom.xml [deleted file]
opendaylight/sal/yang-prototype/model/model-topology/src/main/yang/topology.yang [deleted file]
opendaylight/sal/yang-prototype/model/pom.xml [deleted file]
opendaylight/sal/yang-prototype/model/src/main/yang/.gitignore [deleted file]
opendaylight/sal/yang-prototype/model/src/site/site.xml [deleted file]
opendaylight/sal/yang-prototype/pom.xml
opendaylight/sal/yang-prototype/src/site/markdown/readme.md

diff --git a/opendaylight/sal/yang-prototype/code-generator/.gitignore b/opendaylight/sal/yang-prototype/code-generator/.gitignore
deleted file mode 100644 (file)
index acda883..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/.settings
-/binding-java-api-generator/src/main/xtend-gen
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-api/pom.xml b/opendaylight/sal/yang-prototype/code-generator/binding-generator-api/pom.xml
deleted file mode 100644 (file)
index 544942b..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-\r
-    <parent>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>binding-generator</artifactId>\r
-        <version>0.5.5-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>binding-generator-api</artifactId>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.opendaylight.controller</groupId>\r
-            <artifactId>binding-model-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.opendaylight.yangtools</groupId>\r
-            <artifactId>yang-model-api</artifactId>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-</project>\r
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-api/src/main/java/org/opendaylight/controller/sal/binding/generator/api/BindingGenerator.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-api/src/main/java/org/opendaylight/controller/sal/binding/generator/api/BindingGenerator.java
deleted file mode 100644 (file)
index 4c07970..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.sal.binding.generator.api;\r
-\r
-import java.util.List;\r
-import java.util.Set;\r
-\r
-import org.opendaylight.controller.sal.binding.model.api.Type;\r
-import org.opendaylight.yangtools.yang.model.api.Module;\r
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;\r
-\r
-/**\r
- *\r
- *\r
- */\r
-public interface BindingGenerator {\r
-\r
-    /**\r
-     * Generate Types from whole Schema Context.\r
-     * <br>\r
-     * The method will return List of All Generated Types that could be\r
-     * Generated from Schema Context.\r
-     *\r
-     *\r
-     * @param context Schema Context\r
-     * @return List of Generated Types\r
-     *\r
-     * @see SchemaContext\r
-     */\r
-    public List<Type> generateTypes(final SchemaContext context);\r
-\r
-    /**\r
-     * Generate Types from Schema Context restricted by sub set of specified\r
-     * Modules. The Schema Context MUST contain all of the sub modules\r
-     * otherwise the there is no guarantee that result List of Generated\r
-     * Types will contain correct Generated Types.\r
-     *\r
-     * @param context Schema Context\r
-     * @param modules Sub Set of Modules\r
-     * @return List of Generated Types restricted by sub set of Modules\r
-     *\r
-     * @see Module\r
-     * @see SchemaContext\r
-     *\r
-     */\r
-    public List<Type> generateTypes(final SchemaContext context,\r
-                                    final Set<Module> modules);\r
-}\r
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-api/src/main/java/org/opendaylight/controller/sal/binding/generator/api/package-info.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-api/src/main/java/org/opendaylight/controller/sal/binding/generator/api/package-info.java
deleted file mode 100644 (file)
index 237690c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.api;
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/pom.xml b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/pom.xml
deleted file mode 100644 (file)
index cbecf02..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-\r
-    <parent>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>binding-generator</artifactId>\r
-        <version>0.5.5-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>binding-generator-impl</artifactId>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.opendaylight.controller</groupId>\r
-            <artifactId>binding-generator-util</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.opendaylight.yangtools</groupId>\r
-            <artifactId>yang-parser-impl</artifactId>\r
-            <version>${yangtools.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.opendaylight.controller</groupId>\r
-            <artifactId>binding-generator-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.opendaylight.controller</groupId>\r
-            <artifactId>binding-generator-spi</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-lang</groupId>\r
-            <artifactId>commons-lang</artifactId>\r
-            <version>2.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-</project>\r
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/generator/impl/BindingGeneratorImpl.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/generator/impl/BindingGeneratorImpl.java
deleted file mode 100644 (file)
index 3b5272d..0000000
+++ /dev/null
@@ -1,1258 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.opendaylight.controller.binding.generator.util.BindingGeneratorUtil.*;
-import static org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.*;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Future;
-
-import javax.management.Notification;
-
-import org.opendaylight.controller.binding.generator.util.ReferencedTypeImpl;
-import org.opendaylight.controller.binding.generator.util.Types;
-import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTOBuilderImpl;
-import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTypeBuilderImpl;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.generator.spi.TypeProvider;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.EnumBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedPropertyBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTOBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTypeBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.MethodSignatureBuilder;
-import org.opendaylight.controller.sal.binding.yang.types.GroupingDefinitionDependencySort;
-import org.opendaylight.controller.sal.binding.yang.types.TypeProviderImpl;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
-import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
-import org.opendaylight.yangtools.yang.model.api.ChoiceNode;
-import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
-import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
-import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.UsesNode;
-import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition.EnumPair;
-import org.opendaylight.yangtools.yang.model.util.DataNodeIterator;
-import org.opendaylight.yangtools.yang.model.util.ExtendedType;
-import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
-import org.opendaylight.yangtools.yang.model.util.UnionType;
-
-public final class BindingGeneratorImpl implements BindingGenerator {
-
-    private Map<String, Map<String, GeneratedTypeBuilder>> genTypeBuilders;
-    private TypeProvider typeProvider;
-    private SchemaContext schemaContext;
-    private final Map<SchemaPath, GeneratedType> allGroupings = new HashMap<SchemaPath, GeneratedType>();
-
-    public BindingGeneratorImpl() {
-        super();
-    }
-
-    @Override
-    public List<Type> generateTypes(final SchemaContext context) {
-        if (context == null) {
-            throw new IllegalArgumentException("Schema Context reference cannot be NULL!");
-        }
-        if (context.getModules() == null) {
-            throw new IllegalStateException("Schema Context does not contain defined modules!");
-        }
-
-        final List<Type> generatedTypes = new ArrayList<>();
-        schemaContext = context;
-        typeProvider = new TypeProviderImpl(context);
-        final Set<Module> modules = context.getModules();
-        genTypeBuilders = new HashMap<>();
-        for (final Module module : modules) {
-            generatedTypes.addAll(allGroupingsToGenTypes(module));
-            generatedTypes.add(moduleToDataType(module));
-            generatedTypes.addAll(allTypeDefinitionsToGenTypes(module));
-            generatedTypes.addAll(allContainersToGenTypes(module));
-            generatedTypes.addAll(allListsToGenTypes(module));
-            generatedTypes.addAll(allChoicesToGenTypes(module));
-            generatedTypes.addAll(allAugmentsToGenTypes(module));
-            generatedTypes.addAll(allRPCMethodsToGenType(module));
-            generatedTypes.addAll(allNotificationsToGenType(module));
-            generatedTypes.addAll(allIdentitiesToGenTypes(module, context));
-
-        }
-        return generatedTypes;
-    }
-
-    @Override
-    public List<Type> generateTypes(final SchemaContext context, final Set<Module> modules) {
-        if (context == null) {
-            throw new IllegalArgumentException("Schema Context reference cannot be NULL!");
-        }
-        if (context.getModules() == null) {
-            throw new IllegalStateException("Schema Context does not contain defined modules!");
-        }
-        if (modules == null) {
-            throw new IllegalArgumentException("Sef of Modules cannot be NULL!");
-        }
-
-        final List<Type> filteredGenTypes = new ArrayList<>();
-        schemaContext = context;
-        typeProvider = new TypeProviderImpl(context);
-        final Set<Module> contextModules = context.getModules();
-        genTypeBuilders = new HashMap<>();
-        for (final Module contextModule : contextModules) {
-            final List<Type> generatedTypes = new ArrayList<>();
-
-            generatedTypes.addAll(allGroupingsToGenTypes(contextModule));
-            generatedTypes.add(moduleToDataType(contextModule));
-            generatedTypes.addAll(allTypeDefinitionsToGenTypes(contextModule));
-            generatedTypes.addAll(allContainersToGenTypes(contextModule));
-            generatedTypes.addAll(allListsToGenTypes(contextModule));
-            generatedTypes.addAll(allChoicesToGenTypes(contextModule));
-            generatedTypes.addAll(allAugmentsToGenTypes(contextModule));
-            generatedTypes.addAll(allRPCMethodsToGenType(contextModule));
-            generatedTypes.addAll(allNotificationsToGenType(contextModule));
-            generatedTypes.addAll(allIdentitiesToGenTypes(contextModule, context));
-
-            if (modules.contains(contextModule)) {
-                filteredGenTypes.addAll(generatedTypes);
-            }
-        }
-        return filteredGenTypes;
-    }
-
-    private List<Type> allTypeDefinitionsToGenTypes(final Module module) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-        if (module.getName() == null) {
-            throw new IllegalArgumentException("Module name cannot be NULL!");
-        }
-        if (module.getTypeDefinitions() == null) {
-            throw new IllegalArgumentException("Type Definitions for module " + module.getName() + " cannot be NULL!");
-        }
-
-        final Set<TypeDefinition<?>> typeDefinitions = module.getTypeDefinitions();
-        final List<Type> generatedTypes = new ArrayList<>();
-        for (final TypeDefinition<?> typedef : typeDefinitions) {
-            if (typedef != null) {
-                final Type type = ((TypeProviderImpl) typeProvider).generatedTypeForExtendedDefinitionType(typedef);
-                if ((type != null) && !generatedTypes.contains(type)) {
-                    generatedTypes.add(type);
-                }
-            }
-        }
-        return generatedTypes;
-    }
-
-    private List<Type> allContainersToGenTypes(final Module module) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-
-        if (module.getName() == null) {
-            throw new IllegalArgumentException("Module name cannot be NULL!");
-        }
-
-        if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of Child Nodes in module " + module.getName()
-                    + " cannot be NULL!");
-        }
-
-        final List<Type> generatedTypes = new ArrayList<>();
-        final DataNodeIterator it = new DataNodeIterator(module);
-        final List<ContainerSchemaNode> schemaContainers = it.allContainers();
-        final String basePackageName = moduleNamespaceToPackageName(module);
-        for (final ContainerSchemaNode container : schemaContainers) {
-            if (!container.isAddedByUses()) {
-                generatedTypes.add(containerToGenType(basePackageName, container));
-            }
-        }
-        return generatedTypes;
-    }
-
-    private List<Type> allListsToGenTypes(final Module module) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-
-        if (module.getName() == null) {
-            throw new IllegalArgumentException("Module name cannot be NULL!");
-        }
-
-        if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of Child Nodes in module " + module.getName()
-                    + " cannot be NULL!");
-        }
-
-        final List<Type> generatedTypes = new ArrayList<>();
-        final DataNodeIterator it = new DataNodeIterator(module);
-        final List<ListSchemaNode> schemaLists = it.allLists();
-        final String basePackageName = moduleNamespaceToPackageName(module);
-        if (schemaLists != null) {
-            for (final ListSchemaNode list : schemaLists) {
-                if (!list.isAddedByUses()) {
-                    generatedTypes.addAll(listToGenType(basePackageName, list));
-                }
-            }
-        }
-        return generatedTypes;
-    }
-
-    private List<GeneratedType> allChoicesToGenTypes(final Module module) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-        if (module.getName() == null) {
-            throw new IllegalArgumentException("Module name cannot be NULL!");
-        }
-
-        final DataNodeIterator it = new DataNodeIterator(module);
-        final List<ChoiceNode> choiceNodes = it.allChoices();
-        final String basePackageName = moduleNamespaceToPackageName(module);
-
-        final List<GeneratedType> generatedTypes = new ArrayList<>();
-        for (final ChoiceNode choice : choiceNodes) {
-            if ((choice != null) && !choice.isAddedByUses()) {
-                generatedTypes.addAll(choiceToGeneratedType(basePackageName, choice));
-            }
-        }
-        return generatedTypes;
-    }
-
-    private List<Type> allAugmentsToGenTypes(final Module module) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-        if (module.getName() == null) {
-            throw new IllegalArgumentException("Module name cannot be NULL!");
-        }
-        if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of Augmentation Definitions in module "
-                    + module.getName() + " cannot be NULL!");
-        }
-
-        final List<Type> generatedTypes = new ArrayList<>();
-        final String basePackageName = moduleNamespaceToPackageName(module);
-        final List<AugmentationSchema> augmentations = resolveAugmentations(module);
-        for (final AugmentationSchema augment : augmentations) {
-            generatedTypes.addAll(augmentationToGenTypes(basePackageName, augment));
-        }
-        return generatedTypes;
-    }
-
-    private List<AugmentationSchema> resolveAugmentations(final Module module) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-        if (module.getAugmentations() == null) {
-            throw new IllegalStateException("Augmentations Set cannot be NULL!");
-        }
-
-        final Set<AugmentationSchema> augmentations = module.getAugmentations();
-        final List<AugmentationSchema> sortedAugmentations = new ArrayList<>(augmentations);
-        Collections.sort(sortedAugmentations, new Comparator<AugmentationSchema>() {
-
-            @Override
-            public int compare(AugmentationSchema augSchema1, AugmentationSchema augSchema2) {
-
-                if (augSchema1.getTargetPath().getPath().size() > augSchema2.getTargetPath().getPath().size()) {
-                    return 1;
-                } else if (augSchema1.getTargetPath().getPath().size() < augSchema2.getTargetPath().getPath().size()) {
-                    return -1;
-                }
-                return 0;
-
-            }
-        });
-
-        return sortedAugmentations;
-    }
-
-    private GeneratedType moduleToDataType(final Module module) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-
-        final GeneratedTypeBuilder moduleDataTypeBuilder = moduleTypeBuilder(module, "Data");
-        addInterfaceDefinition(module, moduleDataTypeBuilder);
-
-        final String basePackageName = moduleNamespaceToPackageName(module);
-        if (moduleDataTypeBuilder != null) {
-            final Set<DataSchemaNode> dataNodes = module.getChildNodes();
-            resolveDataSchemaNodes(basePackageName, moduleDataTypeBuilder, dataNodes);
-        }
-        return moduleDataTypeBuilder.toInstance();
-    }
-
-    private List<Type> allRPCMethodsToGenType(final Module module) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-
-        if (module.getName() == null) {
-            throw new IllegalArgumentException("Module name cannot be NULL!");
-        }
-
-        if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of RPC Method Definitions in module "
-                    + module.getName() + " cannot be NULL!");
-        }
-
-        final String basePackageName = moduleNamespaceToPackageName(module);
-        final Set<RpcDefinition> rpcDefinitions = module.getRpcs();
-        final List<Type> genRPCTypes = new ArrayList<>();
-        final GeneratedTypeBuilder interfaceBuilder = moduleTypeBuilder(module, "Service");
-        final Type future = Types.typeForClass(Future.class);
-        for (final RpcDefinition rpc : rpcDefinitions) {
-            if (rpc != null) {
-
-                String rpcName = parseToClassName(rpc.getQName().getLocalName());
-                String rpcMethodName = parseToValidParamName(rpcName);
-                MethodSignatureBuilder method = interfaceBuilder.addMethod(rpcMethodName);
-
-                final List<DataNodeIterator> rpcInOut = new ArrayList<>();
-
-                ContainerSchemaNode input = rpc.getInput();
-                ContainerSchemaNode output = rpc.getOutput();
-
-                if (input != null) {
-                    rpcInOut.add(new DataNodeIterator(input));
-                    GeneratedTypeBuilder inType = addRawInterfaceDefinition(basePackageName, input, rpcName);
-                    addInterfaceDefinition(input, inType);
-                    resolveDataSchemaNodes(basePackageName, inType, input.getChildNodes());
-                    Type inTypeInstance = inType.toInstance();
-                    genRPCTypes.add(inTypeInstance);
-                    method.addParameter(inTypeInstance, "input");
-                }
-
-                Type outTypeInstance = Types.typeForClass(Void.class);
-                if (output != null) {
-                    rpcInOut.add(new DataNodeIterator(output));
-                    GeneratedTypeBuilder outType = addRawInterfaceDefinition(basePackageName, output, rpcName);
-                    addInterfaceDefinition(output, outType);
-                    resolveDataSchemaNodes(basePackageName, outType, output.getChildNodes());
-                    outTypeInstance = outType.toInstance();
-                    genRPCTypes.add(outTypeInstance);
-
-                }
-
-                final Type rpcRes = Types.parameterizedTypeFor(Types.typeForClass(RpcResult.class), outTypeInstance);
-                method.setReturnType(Types.parameterizedTypeFor(future, rpcRes));
-                for (DataNodeIterator it : rpcInOut) {
-                    List<ContainerSchemaNode> nContainers = it.allContainers();
-                    if ((nContainers != null) && !nContainers.isEmpty()) {
-                        for (final ContainerSchemaNode container : nContainers) {
-                            if (!container.isAddedByUses()) {
-                                genRPCTypes.add(containerToGenType(basePackageName, container));
-                            }
-                        }
-                    }
-                    List<ListSchemaNode> nLists = it.allLists();
-                    if ((nLists != null) && !nLists.isEmpty()) {
-                        for (final ListSchemaNode list : nLists) {
-                            if (!list.isAddedByUses()) {
-                                genRPCTypes.addAll(listToGenType(basePackageName, list));
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        genRPCTypes.add(interfaceBuilder.toInstance());
-        return genRPCTypes;
-    }
-
-    private List<Type> allNotificationsToGenType(final Module module) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-
-        if (module.getName() == null) {
-            throw new IllegalArgumentException("Module name cannot be NULL!");
-        }
-
-        if (module.getChildNodes() == null) {
-            throw new IllegalArgumentException("Reference to Set of Notification Definitions in module "
-                    + module.getName() + " cannot be NULL!");
-        }
-
-        final String basePackageName = moduleNamespaceToPackageName(module);
-        final List<Type> genNotifyTypes = new ArrayList<>();
-        final Set<NotificationDefinition> notifications = module.getNotifications();
-
-        for (final NotificationDefinition notification : notifications) {
-            if (notification != null) {
-                DataNodeIterator it = new DataNodeIterator(notification);
-
-                // Containers
-                for (ContainerSchemaNode node : it.allContainers()) {
-                    if (!node.isAddedByUses()) {
-                        genNotifyTypes.add(containerToGenType(basePackageName, node));
-                    }
-                }
-                // Lists
-                for (ListSchemaNode node : it.allLists()) {
-                    if (!node.isAddedByUses()) {
-                        genNotifyTypes.addAll(listToGenType(basePackageName, node));
-                    }
-                }
-                final GeneratedTypeBuilder notificationTypeBuilder = addDefaultInterfaceDefinition(basePackageName,
-                        notification);
-                notificationTypeBuilder.addImplementsType(Types.typeForClass(Notification.class));
-                // Notification object
-                resolveDataSchemaNodes(basePackageName, notificationTypeBuilder, notification.getChildNodes());
-                genNotifyTypes.add(notificationTypeBuilder.toInstance());
-            }
-        }
-        return genNotifyTypes;
-    }
-
-    private List<Type> allIdentitiesToGenTypes(final Module module, final SchemaContext context) {
-        List<Type> genTypes = new ArrayList<>();
-
-        final Set<IdentitySchemaNode> schemaIdentities = module.getIdentities();
-
-        final String basePackageName = moduleNamespaceToPackageName(module);
-
-        if (schemaIdentities != null && !schemaIdentities.isEmpty()) {
-            for (final IdentitySchemaNode identity : schemaIdentities) {
-                genTypes.add(identityToGenType(basePackageName, identity, context));
-            }
-        }
-        return genTypes;
-    }
-
-    private GeneratedType identityToGenType(final String basePackageName, final IdentitySchemaNode identity,
-            final SchemaContext context) {
-        if (identity == null) {
-            return null;
-        }
-
-        final String packageName = packageNameForGeneratedType(basePackageName, identity.getPath());
-        final String genTypeName = parseToClassName(identity.getQName().getLocalName());
-        final GeneratedTOBuilderImpl newType = new GeneratedTOBuilderImpl(packageName, genTypeName);
-
-        IdentitySchemaNode baseIdentity = identity.getBaseIdentity();
-        if (baseIdentity != null) {
-            Module baseIdentityParentModule = SchemaContextUtil.findParentModule(context, baseIdentity);
-
-            final String returnTypePkgName = moduleNamespaceToPackageName(baseIdentityParentModule);
-            final String returnTypeName = parseToClassName(baseIdentity.getQName().getLocalName());
-
-            GeneratedTransferObject gto = new GeneratedTOBuilderImpl(returnTypePkgName, returnTypeName).toInstance();
-            newType.setExtendsType(gto);
-        } else {
-            newType.setExtendsType(Types.getBaseIdentityTO());
-        }
-        newType.setAbstract(true);
-        return newType.toInstance();
-    }
-
-    private List<Type> allGroupingsToGenTypes(final Module module) {
-        final List<Type> genTypes = new ArrayList<>();
-        final String basePackageName = moduleNamespaceToPackageName(module);
-        final Set<GroupingDefinition> groupings = module.getGroupings();
-        List<GroupingDefinition> groupingsSortedByDependencies;
-        // groupingsSortedByDependencies =
-        // sortGroupingDefinitionsByUses(groupings);
-        groupingsSortedByDependencies = GroupingDefinitionDependencySort.sort(groupings);
-
-        for (final GroupingDefinition grouping : groupingsSortedByDependencies) {
-            GeneratedType genType = groupingToGenType(basePackageName, grouping);
-            genTypes.add(genType);
-            SchemaPath schemaPath = grouping.getPath();
-            allGroupings.put(schemaPath, genType);
-        }
-        return genTypes;
-    }
-
-    private GeneratedType groupingToGenType(final String basePackageName, GroupingDefinition grouping) {
-        if (grouping == null) {
-            return null;
-        }
-
-        final String packageName = packageNameForGeneratedType(basePackageName, grouping.getPath());
-        final Set<DataSchemaNode> schemaNodes = grouping.getChildNodes();
-        final GeneratedTypeBuilder typeBuilder = addDefaultInterfaceDefinition(packageName, grouping);
-
-        resolveDataSchemaNodes(basePackageName, typeBuilder, schemaNodes);
-        return typeBuilder.toInstance();
-    }
-
-    private EnumTypeDefinition enumTypeDefFromExtendedType(final TypeDefinition<?> typeDefinition) {
-        if (typeDefinition != null) {
-            if (typeDefinition.getBaseType() instanceof EnumTypeDefinition) {
-                return (EnumTypeDefinition) typeDefinition.getBaseType();
-            } else if (typeDefinition.getBaseType() instanceof ExtendedType) {
-                return enumTypeDefFromExtendedType(typeDefinition.getBaseType());
-            }
-        }
-        return null;
-    }
-
-    private EnumBuilder resolveInnerEnumFromTypeDefinition(final EnumTypeDefinition enumTypeDef, final String enumName,
-            final GeneratedTypeBuilder typeBuilder) {
-        if ((enumTypeDef != null) && (typeBuilder != null) && (enumTypeDef.getQName() != null)
-                && (enumTypeDef.getQName().getLocalName() != null)) {
-
-            final String enumerationName = parseToClassName(enumName);
-            final EnumBuilder enumBuilder = typeBuilder.addEnumeration(enumerationName);
-
-            if (enumBuilder != null) {
-                final List<EnumPair> enums = enumTypeDef.getValues();
-                if (enums != null) {
-                    int listIndex = 0;
-                    for (final EnumPair enumPair : enums) {
-                        if (enumPair != null) {
-                            final String enumPairName = parseToClassName(enumPair.getName());
-                            Integer enumPairValue = enumPair.getValue();
-
-                            if (enumPairValue == null) {
-                                enumPairValue = listIndex;
-                            }
-                            enumBuilder.addValue(enumPairName, enumPairValue);
-                            listIndex++;
-                        }
-                    }
-                }
-                return enumBuilder;
-            }
-        }
-        return null;
-    }
-
-    private GeneratedTypeBuilder moduleTypeBuilder(final Module module, final String postfix) {
-        if (module == null) {
-            throw new IllegalArgumentException("Module reference cannot be NULL!");
-        }
-        String packageName = moduleNamespaceToPackageName(module);
-        final String moduleName = parseToClassName(module.getName()) + postfix;
-
-        return new GeneratedTypeBuilderImpl(packageName, moduleName);
-
-    }
-
-    private List<Type> augmentationToGenTypes(final String augmentPackageName, final AugmentationSchema augSchema) {
-        if (augmentPackageName == null) {
-            throw new IllegalArgumentException("Package Name cannot be NULL!");
-        }
-        if (augSchema == null) {
-            throw new IllegalArgumentException("Augmentation Schema cannot be NULL!");
-        }
-        if (augSchema.getTargetPath() == null) {
-            throw new IllegalStateException("Augmentation Schema does not contain Target Path (Target Path is NULL).");
-        }
-
-        final List<Type> genTypes = new ArrayList<>();
-
-        // EVERY augmented interface will extends Augmentation<T> interface
-        // and DataObject interface!!!
-        final SchemaPath targetPath = augSchema.getTargetPath();
-        final DataSchemaNode targetSchemaNode = findDataSchemaNode(schemaContext, targetPath);
-        if ((targetSchemaNode != null) && (targetSchemaNode.getQName() != null)
-                && (targetSchemaNode.getQName().getLocalName() != null)) {
-            final Module targetModule = findParentModule(schemaContext, targetSchemaNode);
-            final String targetBasePackage = moduleNamespaceToPackageName(targetModule);
-            final String targetPackageName = packageNameForGeneratedType(targetBasePackage, targetSchemaNode.getPath());
-            final String targetSchemaNodeName = targetSchemaNode.getQName().getLocalName();
-            final Set<DataSchemaNode> augChildNodes = augSchema.getChildNodes();
-
-            if (!(targetSchemaNode instanceof ChoiceNode)) {
-                final GeneratedTypeBuilder augTypeBuilder = addRawAugmentGenTypeDefinition(augmentPackageName,
-                        targetPackageName, targetSchemaNodeName, augSchema);
-                addInterfaceDefinition(augSchema, augTypeBuilder);
-
-                final GeneratedType augType = augTypeBuilder.toInstance();
-                genTypes.add(augType);
-            } else {
-                final Type refChoiceType = new ReferencedTypeImpl(targetPackageName,
-                        parseToClassName(targetSchemaNodeName));
-                final ChoiceNode choiceTarget = (ChoiceNode) targetSchemaNode;
-                final Set<ChoiceCaseNode> choiceCaseNodes = choiceTarget.getCases();
-                genTypes.addAll(augmentCasesToGenTypes(augmentPackageName, refChoiceType, choiceCaseNodes));
-            }
-            genTypes.addAll(augmentationBodyToGenTypes(augmentPackageName, augChildNodes));
-        }
-        return genTypes;
-    }
-
-    private List<GeneratedType> augmentCasesToGenTypes(final String augmentPackageName, final Type refChoiceType,
-            final Set<ChoiceCaseNode> choiceCaseNodes) {
-        if (augmentPackageName == null) {
-            throw new IllegalArgumentException("Augment Package Name string cannot be NULL!");
-        }
-        if (choiceCaseNodes == null) {
-            throw new IllegalArgumentException("Set of Choice Case Nodes cannot be NULL!");
-        }
-        final List<GeneratedType> genTypes = generateTypesFromAugmentedChoiceCases(augmentPackageName, refChoiceType,
-                choiceCaseNodes);
-        return genTypes;
-    }
-
-    private GeneratedTypeBuilder addRawAugmentGenTypeDefinition(final String augmentPackageName,
-            final String targetPackageName, final String targetSchemaNodeName, final AugmentationSchema augSchema) {
-        final String targetTypeName = parseToClassName(targetSchemaNodeName);
-        Map<String, GeneratedTypeBuilder> augmentBuilders = genTypeBuilders.get(augmentPackageName);
-        if (augmentBuilders == null) {
-            augmentBuilders = new HashMap<>();
-            genTypeBuilders.put(augmentPackageName, augmentBuilders);
-        }
-
-        final String augTypeName = augGenTypeName(augmentBuilders, targetTypeName);
-        final Type targetTypeRef = new ReferencedTypeImpl(targetPackageName, targetTypeName);
-        final Set<DataSchemaNode> augChildNodes = augSchema.getChildNodes();
-
-        final GeneratedTypeBuilder augTypeBuilder = new GeneratedTypeBuilderImpl(augmentPackageName, augTypeName);
-
-        augTypeBuilder.addImplementsType(Types.DATA_OBJECT);
-        augTypeBuilder.addImplementsType(Types.augmentationTypeFor(targetTypeRef));
-
-        augSchemaNodeToMethods(augmentPackageName, augTypeBuilder, augChildNodes);
-        augmentBuilders.put(augTypeName, augTypeBuilder);
-        return augTypeBuilder;
-    }
-
-    private List<Type> augmentationBodyToGenTypes(final String augBasePackageName,
-            final Set<DataSchemaNode> augChildNodes) {
-        final List<Type> genTypes = new ArrayList<>();
-        final List<DataNodeIterator> augSchemaIts = new ArrayList<>();
-        for (final DataSchemaNode childNode : augChildNodes) {
-            if (childNode instanceof DataNodeContainer) {
-                augSchemaIts.add(new DataNodeIterator((DataNodeContainer) childNode));
-
-                if (childNode instanceof ContainerSchemaNode) {
-                    genTypes.add(containerToGenType(augBasePackageName, (ContainerSchemaNode) childNode));
-                } else if (childNode instanceof ListSchemaNode) {
-                    genTypes.addAll(listToGenType(augBasePackageName, (ListSchemaNode) childNode));
-                }
-            } else if (childNode instanceof ChoiceNode) {
-                final ChoiceNode choice = (ChoiceNode) childNode;
-                for (final ChoiceCaseNode caseNode : choice.getCases()) {
-                    augSchemaIts.add(new DataNodeIterator(caseNode));
-                }
-                genTypes.addAll(choiceToGeneratedType(augBasePackageName, (ChoiceNode) childNode));
-            }
-        }
-
-        for (final DataNodeIterator it : augSchemaIts) {
-            final List<ContainerSchemaNode> augContainers = it.allContainers();
-            final List<ListSchemaNode> augLists = it.allLists();
-            final List<ChoiceNode> augChoices = it.allChoices();
-
-            if (augContainers != null) {
-                for (final ContainerSchemaNode container : augContainers) {
-                    genTypes.add(containerToGenType(augBasePackageName, container));
-                }
-            }
-            if (augLists != null) {
-                for (final ListSchemaNode list : augLists) {
-                    genTypes.addAll(listToGenType(augBasePackageName, list));
-                }
-            }
-            if (augChoices != null) {
-                for (final ChoiceNode choice : augChoices) {
-                    genTypes.addAll(choiceToGeneratedType(augBasePackageName, choice));
-                }
-            }
-        }
-        return genTypes;
-    }
-
-    private String augGenTypeName(final Map<String, GeneratedTypeBuilder> builders, final String genTypeName) {
-        String augTypeName = genTypeName;
-
-        int index = 1;
-        while ((builders != null) && builders.containsKey(genTypeName + index)) {
-            index++;
-        }
-        augTypeName += index;
-        return augTypeName;
-    }
-
-    private GeneratedType containerToGenType(final String basePackageName, ContainerSchemaNode containerNode) {
-        if (containerNode == null) {
-            return null;
-        }
-
-        final String packageName = packageNameForGeneratedType(basePackageName, containerNode.getPath());
-        final Set<DataSchemaNode> schemaNodes = containerNode.getChildNodes();
-        final GeneratedTypeBuilder typeBuilder = addDefaultInterfaceDefinition(packageName, containerNode);
-
-        resolveDataSchemaNodes(basePackageName, typeBuilder, schemaNodes);
-        return typeBuilder.toInstance();
-    }
-
-    private GeneratedTypeBuilder resolveDataSchemaNodes(final String basePackageName,
-            final GeneratedTypeBuilder typeBuilder, final Set<DataSchemaNode> schemaNodes) {
-        if ((schemaNodes != null) && (typeBuilder != null)) {
-            for (final DataSchemaNode schemaNode : schemaNodes) {
-                if (schemaNode.isAugmenting() || schemaNode.isAddedByUses()) {
-                    continue;
-                }
-                addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode, typeBuilder);
-            }
-        }
-        return typeBuilder;
-    }
-
-    private GeneratedTypeBuilder augSchemaNodeToMethods(final String basePackageName,
-            final GeneratedTypeBuilder typeBuilder, final Set<DataSchemaNode> schemaNodes) {
-        if ((schemaNodes != null) && (typeBuilder != null)) {
-            for (final DataSchemaNode schemaNode : schemaNodes) {
-                if (schemaNode.isAugmenting()) {
-                    addSchemaNodeToBuilderAsMethod(basePackageName, schemaNode, typeBuilder);
-                }
-            }
-        }
-        return typeBuilder;
-    }
-
-    private void addSchemaNodeToBuilderAsMethod(final String basePackageName, final DataSchemaNode schemaNode,
-            final GeneratedTypeBuilder typeBuilder) {
-        if (schemaNode != null && typeBuilder != null) {
-            if (schemaNode instanceof LeafSchemaNode) {
-                resolveLeafSchemaNodeAsMethod(typeBuilder, (LeafSchemaNode) schemaNode);
-            } else if (schemaNode instanceof LeafListSchemaNode) {
-                resolveLeafListSchemaNode(typeBuilder, (LeafListSchemaNode) schemaNode);
-            } else if (schemaNode instanceof ContainerSchemaNode) {
-                resolveContainerSchemaNode(basePackageName, typeBuilder, (ContainerSchemaNode) schemaNode);
-            } else if (schemaNode instanceof ListSchemaNode) {
-                resolveListSchemaNode(basePackageName, typeBuilder, (ListSchemaNode) schemaNode);
-            } else if (schemaNode instanceof ChoiceNode) {
-                resolveChoiceSchemaNode(basePackageName, typeBuilder, (ChoiceNode) schemaNode);
-            }
-        }
-    }
-
-    private void resolveChoiceSchemaNode(final String basePackageName, final GeneratedTypeBuilder typeBuilder,
-            final ChoiceNode choiceNode) {
-        if (basePackageName == null) {
-            throw new IllegalArgumentException("Base Package Name cannot be NULL!");
-        }
-        if (typeBuilder == null) {
-            throw new IllegalArgumentException("Generated Type Builder cannot be NULL!");
-        }
-        if (choiceNode == null) {
-            throw new IllegalArgumentException("Choice Schema Node cannot be NULL!");
-        }
-
-        final String choiceName = choiceNode.getQName().getLocalName();
-        if (choiceName != null && !choiceNode.isAddedByUses()) {
-            final String packageName = packageNameForGeneratedType(basePackageName, choiceNode.getPath());
-            final GeneratedTypeBuilder choiceType = addDefaultInterfaceDefinition(packageName, choiceNode);
-            constructGetter(typeBuilder, choiceName, choiceNode.getDescription(), choiceType);
-        }
-    }
-
-    private List<GeneratedType> choiceToGeneratedType(final String basePackageName, final ChoiceNode choiceNode) {
-        if (basePackageName == null) {
-            throw new IllegalArgumentException("Base Package Name cannot be NULL!");
-        }
-        if (choiceNode == null) {
-            throw new IllegalArgumentException("Choice Schema Node cannot be NULL!");
-        }
-
-        final List<GeneratedType> generatedTypes = new ArrayList<>();
-        final String packageName = packageNameForGeneratedType(basePackageName, choiceNode.getPath());
-        final GeneratedTypeBuilder choiceTypeBuilder = addRawInterfaceDefinition(packageName, choiceNode);
-        choiceTypeBuilder.addImplementsType(Types.DATA_OBJECT);
-        final GeneratedType choiceType = choiceTypeBuilder.toInstance();
-
-        generatedTypes.add(choiceType);
-        final Set<ChoiceCaseNode> caseNodes = choiceNode.getCases();
-        if ((caseNodes != null) && !caseNodes.isEmpty()) {
-            generatedTypes.addAll(generateTypesFromChoiceCases(basePackageName, choiceType, caseNodes));
-        }
-        return generatedTypes;
-    }
-
-    private List<GeneratedType> generateTypesFromChoiceCases(final String basePackageName, final Type refChoiceType,
-            final Set<ChoiceCaseNode> caseNodes) {
-        if (basePackageName == null) {
-            throw new IllegalArgumentException("Base Package Name cannot be NULL!");
-        }
-        if (refChoiceType == null) {
-            throw new IllegalArgumentException("Referenced Choice Type cannot be NULL!");
-        }
-        if (caseNodes == null) {
-            throw new IllegalArgumentException("Set of Choice Case Nodes cannot be NULL!");
-        }
-
-        final List<GeneratedType> generatedTypes = new ArrayList<>();
-        for (final ChoiceCaseNode caseNode : caseNodes) {
-            if (caseNode != null && !caseNode.isAddedByUses() && !caseNode.isAugmenting()) {
-                final String packageName = packageNameForGeneratedType(basePackageName, caseNode.getPath());
-                final GeneratedTypeBuilder caseTypeBuilder = addDefaultInterfaceDefinition(packageName, caseNode);
-                caseTypeBuilder.addImplementsType(refChoiceType);
-
-                final Set<DataSchemaNode> childNodes = caseNode.getChildNodes();
-                if (childNodes != null) {
-                    resolveDataSchemaNodes(basePackageName, caseTypeBuilder, childNodes);
-                }
-                generatedTypes.add(caseTypeBuilder.toInstance());
-            }
-        }
-
-        return generatedTypes;
-    }
-
-    private List<GeneratedType> generateTypesFromAugmentedChoiceCases(final String basePackageName,
-            final Type refChoiceType, final Set<ChoiceCaseNode> caseNodes) {
-        if (basePackageName == null) {
-            throw new IllegalArgumentException("Base Package Name cannot be NULL!");
-        }
-        if (refChoiceType == null) {
-            throw new IllegalArgumentException("Referenced Choice Type cannot be NULL!");
-        }
-        if (caseNodes == null) {
-            throw new IllegalArgumentException("Set of Choice Case Nodes cannot be NULL!");
-        }
-
-        final List<GeneratedType> generatedTypes = new ArrayList<>();
-        for (final ChoiceCaseNode caseNode : caseNodes) {
-            if (caseNode != null && caseNode.isAugmenting()) {
-                final String packageName = packageNameForGeneratedType(basePackageName, caseNode.getPath());
-                final GeneratedTypeBuilder caseTypeBuilder = addDefaultInterfaceDefinition(packageName, caseNode);
-                caseTypeBuilder.addImplementsType(refChoiceType);
-
-                final Set<DataSchemaNode> childNodes = caseNode.getChildNodes();
-                if (childNodes != null) {
-                    resolveDataSchemaNodes(basePackageName, caseTypeBuilder, childNodes);
-                }
-                generatedTypes.add(caseTypeBuilder.toInstance());
-            }
-        }
-
-        return generatedTypes;
-    }
-
-    private boolean resolveLeafSchemaNodeAsMethod(final GeneratedTypeBuilder typeBuilder, final LeafSchemaNode leaf) {
-        if ((leaf != null) && (typeBuilder != null)) {
-            final String leafName = leaf.getQName().getLocalName();
-            String leafDesc = leaf.getDescription();
-            if (leafDesc == null) {
-                leafDesc = "";
-            }
-
-            if (leafName != null && !leaf.isAddedByUses()) {
-                final TypeDefinition<?> typeDef = leaf.getType();
-
-                Type returnType = null;
-                if (typeDef instanceof EnumTypeDefinition) {
-                    returnType = typeProvider.javaTypeForSchemaDefinitionType(typeDef);
-                    final EnumTypeDefinition enumTypeDef = enumTypeDefFromExtendedType(typeDef);
-                    final EnumBuilder enumBuilder = resolveInnerEnumFromTypeDefinition(enumTypeDef, leafName,
-                            typeBuilder);
-
-                    if (enumBuilder != null) {
-                        returnType = new ReferencedTypeImpl(enumBuilder.getPackageName(), enumBuilder.getName());
-                    }
-                    ((TypeProviderImpl) typeProvider).putReferencedType(leaf.getPath(), returnType);
-                } else if (typeDef instanceof UnionType) {
-                    GeneratedTOBuilder genTOBuilder = addEnclosedTOToTypeBuilder(typeDef, typeBuilder, leafName);
-                    if (genTOBuilder != null) {
-                        returnType = new ReferencedTypeImpl(genTOBuilder.getPackageName(), genTOBuilder.getName());
-                    }
-                } else if (typeDef instanceof BitsTypeDefinition) {
-                    GeneratedTOBuilder genTOBuilder = addEnclosedTOToTypeBuilder(typeDef, typeBuilder, leafName);
-                    if (genTOBuilder != null) {
-                        returnType = new ReferencedTypeImpl(genTOBuilder.getPackageName(), genTOBuilder.getName());
-                    }
-                } else {
-                    returnType = typeProvider.javaTypeForSchemaDefinitionType(typeDef);
-                }
-                if (returnType != null) {
-                    constructGetter(typeBuilder, leafName, leafDesc, returnType);
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    private boolean resolveLeafSchemaNodeAsProperty(final GeneratedTOBuilder toBuilder, final LeafSchemaNode leaf,
-            boolean isReadOnly) {
-        if ((leaf != null) && (toBuilder != null)) {
-            final String leafName = leaf.getQName().getLocalName();
-            String leafDesc = leaf.getDescription();
-            if (leafDesc == null) {
-                leafDesc = "";
-            }
-
-            if (leafName != null && !leaf.isAddedByUses()) {
-                final TypeDefinition<?> typeDef = leaf.getType();
-
-                // TODO: properly resolve enum types
-                final Type returnType = typeProvider.javaTypeForSchemaDefinitionType(typeDef);
-
-                if (returnType != null) {
-                    final GeneratedPropertyBuilder propBuilder = toBuilder.addProperty(parseToClassName(leafName));
-
-                    propBuilder.setReadOnly(isReadOnly);
-                    propBuilder.setReturnType(returnType);
-                    propBuilder.setComment(leafDesc);
-
-                    toBuilder.addEqualsIdentity(propBuilder);
-                    toBuilder.addHashIdentity(propBuilder);
-                    toBuilder.addToStringProperty(propBuilder);
-
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    private boolean resolveLeafListSchemaNode(final GeneratedTypeBuilder typeBuilder, final LeafListSchemaNode node) {
-        if ((node != null) && (typeBuilder != null)) {
-            final String nodeName = node.getQName().getLocalName();
-            String nodeDesc = node.getDescription();
-            if (nodeDesc == null) {
-                nodeDesc = "";
-            }
-
-            if (nodeName != null && !node.isAddedByUses()) {
-                final TypeDefinition<?> type = node.getType();
-                final Type listType = Types.listTypeFor(typeProvider.javaTypeForSchemaDefinitionType(type));
-
-                constructGetter(typeBuilder, nodeName, nodeDesc, listType);
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private boolean resolveContainerSchemaNode(final String basePackageName, final GeneratedTypeBuilder typeBuilder,
-            final ContainerSchemaNode containerNode) {
-        if ((containerNode != null) && (typeBuilder != null)) {
-            final String nodeName = containerNode.getQName().getLocalName();
-
-            if (nodeName != null && !containerNode.isAddedByUses()) {
-                final String packageName = packageNameForGeneratedType(basePackageName, containerNode.getPath());
-
-                final GeneratedTypeBuilder rawGenType = addDefaultInterfaceDefinition(packageName, containerNode);
-                constructGetter(typeBuilder, nodeName, containerNode.getDescription(), rawGenType);
-
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private boolean resolveListSchemaNode(final String basePackageName, final GeneratedTypeBuilder typeBuilder,
-            final ListSchemaNode schemaNode) {
-        if ((schemaNode != null) && (typeBuilder != null)) {
-            final String listName = schemaNode.getQName().getLocalName();
-
-            if (listName != null && !schemaNode.isAddedByUses()) {
-                final String packageName = packageNameForGeneratedType(basePackageName, schemaNode.getPath());
-                final GeneratedTypeBuilder rawGenType = addDefaultInterfaceDefinition(packageName, schemaNode);
-                constructGetter(typeBuilder, listName, schemaNode.getDescription(), Types.listTypeFor(rawGenType));
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Method instantiates new Generated Type Builder and sets the implements
-     * definitions of Data Object and Augmentable.
-     *
-     * @param packageName
-     *            Generated Type Package Name
-     * @param schemaNode
-     *            Schema Node definition
-     * @return Generated Type Builder instance for Schema Node definition
-     */
-    private GeneratedTypeBuilder addDefaultInterfaceDefinition(final String packageName, final SchemaNode schemaNode) {
-        final GeneratedTypeBuilder builder = addRawInterfaceDefinition(packageName, schemaNode, "");
-        builder.addImplementsType(Types.DATA_OBJECT);
-        if (!(schemaNode instanceof GroupingDefinition)) {
-            builder.addImplementsType(Types.augmentableTypeFor(builder));
-        }
-
-        if (schemaNode instanceof DataNodeContainer) {
-            addInterfaceDefinition((DataNodeContainer) schemaNode, builder);
-        }
-
-        return builder;
-    }
-
-    /**
-     *
-     * @param packageName
-     * @param schemaNode
-     * @return
-     */
-    private GeneratedTypeBuilder addRawInterfaceDefinition(final String packageName, final SchemaNode schemaNode) {
-        return addRawInterfaceDefinition(packageName, schemaNode, "");
-    }
-
-    private GeneratedTypeBuilder addRawInterfaceDefinition(final String packageName, final SchemaNode schemaNode,
-            final String prefix) {
-        if (schemaNode == null) {
-            throw new IllegalArgumentException("Data Schema Node cannot be NULL!");
-        }
-        if (packageName == null) {
-            throw new IllegalArgumentException("Package Name for Generated Type cannot be NULL!");
-        }
-        if (schemaNode.getQName() == null) {
-            throw new IllegalArgumentException("QName for Data Schema Node cannot be NULL!");
-        }
-        final String schemaNodeName = schemaNode.getQName().getLocalName();
-        if (schemaNodeName == null) {
-            throw new IllegalArgumentException("Local Name of QName for Data Schema Node cannot be NULL!");
-        }
-
-        final String genTypeName;
-        if (prefix == null) {
-            genTypeName = parseToClassName(schemaNodeName);
-        } else {
-            genTypeName = prefix + parseToClassName(schemaNodeName);
-        }
-
-        final GeneratedTypeBuilder newType = new GeneratedTypeBuilderImpl(packageName, genTypeName);
-        if (!genTypeBuilders.containsKey(packageName)) {
-            final Map<String, GeneratedTypeBuilder> builders = new HashMap<>();
-            builders.put(genTypeName, newType);
-            genTypeBuilders.put(packageName, builders);
-        } else {
-            final Map<String, GeneratedTypeBuilder> builders = genTypeBuilders.get(packageName);
-            if (!builders.containsKey(genTypeName)) {
-                builders.put(genTypeName, newType);
-            }
-        }
-        return newType;
-    }
-
-    private String getterMethodName(final String methodName) {
-        final StringBuilder method = new StringBuilder();
-        method.append("get");
-        method.append(parseToClassName(methodName));
-        return method.toString();
-    }
-
-    private String setterMethodName(final String methodName) {
-        final StringBuilder method = new StringBuilder();
-        method.append("set");
-        method.append(parseToClassName(methodName));
-        return method.toString();
-    }
-
-    private MethodSignatureBuilder constructGetter(final GeneratedTypeBuilder interfaceBuilder,
-            final String schemaNodeName, final String comment, final Type returnType) {
-        final MethodSignatureBuilder getMethod = interfaceBuilder.addMethod(getterMethodName(schemaNodeName));
-
-        getMethod.setComment(comment);
-        getMethod.setReturnType(returnType);
-
-        return getMethod;
-    }
-
-    private MethodSignatureBuilder constructSetter(final GeneratedTypeBuilder interfaceBuilder,
-            final String schemaNodeName, final String comment, final Type parameterType) {
-        final MethodSignatureBuilder setMethod = interfaceBuilder.addMethod(setterMethodName(schemaNodeName));
-
-        setMethod.setComment(comment);
-        setMethod.addParameter(parameterType, parseToValidParamName(schemaNodeName));
-        setMethod.setReturnType(Types.voidType());
-
-        return setMethod;
-    }
-
-    private List<Type> listToGenType(final String basePackageName, final ListSchemaNode list) {
-        if (basePackageName == null) {
-            throw new IllegalArgumentException("Package Name for Generated Type cannot be NULL!");
-        }
-        if (list == null) {
-            throw new IllegalArgumentException("List Schema Node cannot be NULL!");
-        }
-
-        final String packageName = packageNameForGeneratedType(basePackageName, list.getPath());
-        final GeneratedTypeBuilder typeBuilder = resolveListTypeBuilder(packageName, list);
-        final List<String> listKeys = listKeys(list);
-        GeneratedTOBuilder genTOBuilder = resolveListKeyTOBuilder(packageName, list, listKeys);
-
-        final Set<DataSchemaNode> schemaNodes = list.getChildNodes();
-
-        for (final DataSchemaNode schemaNode : schemaNodes) {
-            if (schemaNode.isAugmenting()) {
-                continue;
-            }
-            addSchemaNodeToListBuilders(basePackageName, schemaNode, typeBuilder, genTOBuilder, listKeys);
-        }
-        return typeBuildersToGenTypes(typeBuilder, genTOBuilder);
-    }
-
-    private void addSchemaNodeToListBuilders(final String basePackageName, final DataSchemaNode schemaNode,
-            final GeneratedTypeBuilder typeBuilder, final GeneratedTOBuilder genTOBuilder, final List<String> listKeys) {
-        if (schemaNode == null) {
-            throw new IllegalArgumentException("Data Schema Node cannot be NULL!");
-        }
-
-        if (typeBuilder == null) {
-            throw new IllegalArgumentException("Generated Type Builder cannot be NULL!");
-        }
-
-        if (schemaNode instanceof LeafSchemaNode) {
-            final LeafSchemaNode leaf = (LeafSchemaNode) schemaNode;
-            if (!isPartOfListKey(leaf, listKeys)) {
-                resolveLeafSchemaNodeAsMethod(typeBuilder, leaf);
-            } else {
-                resolveLeafSchemaNodeAsProperty(genTOBuilder, leaf, true);
-            }
-        } else if (schemaNode instanceof LeafListSchemaNode) {
-            resolveLeafListSchemaNode(typeBuilder, (LeafListSchemaNode) schemaNode);
-        } else if (schemaNode instanceof ContainerSchemaNode) {
-            resolveContainerSchemaNode(basePackageName, typeBuilder, (ContainerSchemaNode) schemaNode);
-        } else if (schemaNode instanceof ListSchemaNode) {
-            resolveListSchemaNode(basePackageName, typeBuilder, (ListSchemaNode) schemaNode);
-        }
-    }
-
-    private List<Type> typeBuildersToGenTypes(final GeneratedTypeBuilder typeBuilder, GeneratedTOBuilder genTOBuilder) {
-        final List<Type> genTypes = new ArrayList<>();
-        if (typeBuilder == null) {
-            throw new IllegalArgumentException("Generated Type Builder cannot be NULL!");
-        }
-
-        if (genTOBuilder != null) {
-            final GeneratedTransferObject genTO = genTOBuilder.toInstance();
-            constructGetter(typeBuilder, genTO.getName(), "Returns Primary Key of Yang List Type", genTO);
-            genTypes.add(genTO);
-        }
-        genTypes.add(typeBuilder.toInstance());
-        return genTypes;
-    }
-
-    /**
-     * @param list
-     * @return
-     */
-    private GeneratedTOBuilder resolveListKey(final String packageName, final ListSchemaNode list) {
-        final String listName = list.getQName().getLocalName() + "Key";
-        return schemaNodeToTransferObjectBuilder(packageName, list, listName);
-    }
-
-    private boolean isPartOfListKey(final LeafSchemaNode leaf, final List<String> keys) {
-        if ((leaf != null) && (keys != null) && (leaf.getQName() != null)) {
-            final String leafName = leaf.getQName().getLocalName();
-            if (keys.contains(leafName)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private List<String> listKeys(final ListSchemaNode list) {
-        final List<String> listKeys = new ArrayList<>();
-
-        if (list.getKeyDefinition() != null) {
-            final List<QName> keyDefinitions = list.getKeyDefinition();
-
-            for (final QName keyDefinition : keyDefinitions) {
-                listKeys.add(keyDefinition.getLocalName());
-            }
-        }
-        return listKeys;
-    }
-
-    private GeneratedTypeBuilder resolveListTypeBuilder(final String packageName, final ListSchemaNode list) {
-        if (packageName == null) {
-            throw new IllegalArgumentException("Package Name for Generated Type cannot be NULL!");
-        }
-        if (list == null) {
-            throw new IllegalArgumentException("List Schema Node cannot be NULL!");
-        }
-
-        final String schemaNodeName = list.getQName().getLocalName();
-        final String genTypeName = parseToClassName(schemaNodeName);
-
-        GeneratedTypeBuilder typeBuilder = null;
-        final Map<String, GeneratedTypeBuilder> builders = genTypeBuilders.get(packageName);
-        if (builders != null) {
-            typeBuilder = builders.get(genTypeName);
-        }
-        if (typeBuilder == null) {
-            typeBuilder = addDefaultInterfaceDefinition(packageName, list);
-        }
-        return typeBuilder;
-    }
-
-    private GeneratedTOBuilder resolveListKeyTOBuilder(final String packageName, final ListSchemaNode list,
-            final List<String> listKeys) {
-        GeneratedTOBuilder genTOBuilder = null;
-        if (listKeys.size() > 0) {
-            genTOBuilder = resolveListKey(packageName, list);
-        }
-        return genTOBuilder;
-    }
-
-    private GeneratedTOBuilder addEnclosedTOToTypeBuilder(TypeDefinition<?> typeDef, GeneratedTypeBuilder typeBuilder,
-            String leafName) {
-        String className = parseToClassName(leafName);
-        GeneratedTOBuilder genTOBuilder = null;
-        if (typeDef instanceof UnionType) {
-            genTOBuilder = ((TypeProviderImpl) typeProvider).addUnionGeneratedTypeDefinition(
-                    typeBuilder.getFullyQualifiedName(), typeDef, className);
-        } else if (typeDef instanceof BitsTypeDefinition) {
-            genTOBuilder = ((TypeProviderImpl) typeProvider).bitsTypedefToTransferObject(
-                    typeBuilder.getFullyQualifiedName(), typeDef, className);
-        }
-        if (genTOBuilder != null) {
-            typeBuilder.addEnclosingTransferObject(genTOBuilder);
-            return genTOBuilder;
-        }
-        return null;
-
-    }
-
-    /**
-     * Adds the implemented types to type builder. The method passes through the
-     * list of elements which contains {@code dataNodeContainer} and adds them
-     * as <i>implements type</i> to <code>builder</code>
-     *
-     * @param dataNodeContainer
-     *            element which contains the list of used YANG groupings
-     * @param builder
-     *            builder to which are added implemented types according to
-     *            <code>dataNodeContainer</code>
-     * @return generated type builder which contains implemented types
-     */
-    private GeneratedTypeBuilder addInterfaceDefinition(final DataNodeContainer dataNodeContainer,
-            final GeneratedTypeBuilder builder) {
-        for (UsesNode usesNode : dataNodeContainer.getUses()) {
-            if (usesNode.getGroupingPath() != null) {
-                GeneratedType genType = allGroupings.get(usesNode.getGroupingPath());
-                builder.addImplementsType(genType);
-            }
-        }
-        return builder;
-    }
-
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/generator/impl/package-info.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/generator/impl/package-info.java
deleted file mode 100644 (file)
index 741aeef..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/BaseYangTypes.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/BaseYangTypes.java
deleted file mode 100644 (file)
index 38486e7..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.yang.types;
-
-import java.math.BigInteger;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.opendaylight.controller.binding.generator.util.Types;
-import org.opendaylight.controller.sal.binding.generator.spi.TypeProvider;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-
-public final class BaseYangTypes {
-
-    private static Map<String, Type> typeMap = new HashMap<String, Type>();
-
-    public static final Type BOOLEAN_TYPE = Types.typeForClass(Boolean.class);
-    public static final Type EMPTY_TYPE = Types.typeForClass(Boolean.class);
-    public static final Type INT8_TYPE = Types.typeForClass(Byte.class);
-    public static final Type INT16_TYPE = Types.typeForClass(Short.class);
-    public static final Type INT32_TYPE = Types.typeForClass(Integer.class);
-    public static final Type INT64_TYPE = Types.typeForClass(Long.class);
-    public static final Type STRING_TYPE = Types.typeForClass(String.class);
-    public static final Type DECIMAL64_TYPE = Types.typeForClass(Double.class);
-    public static final Type UINT8_TYPE = Types.typeForClass(Short.class);
-    public static final Type UINT16_TYPE = Types.typeForClass(Integer.class);
-    public static final Type UINT32_TYPE = Types.typeForClass(Long.class);
-    public static final Type UINT64_TYPE = Types.typeForClass(BigInteger.class);
-    public static final Type BINARY_TYPE = Types.primitiveType("byte[]");
-
-    static {
-        typeMap.put("boolean", BOOLEAN_TYPE);
-        typeMap.put("empty", EMPTY_TYPE);
-        typeMap.put("int8", INT8_TYPE);
-        typeMap.put("int16", INT16_TYPE);
-        typeMap.put("int32", INT32_TYPE);
-        typeMap.put("int64", INT64_TYPE);
-        typeMap.put("string", STRING_TYPE);
-        typeMap.put("decimal64", DECIMAL64_TYPE);
-        typeMap.put("uint8", UINT8_TYPE);
-        typeMap.put("uint16", UINT16_TYPE);
-        typeMap.put("uint32", UINT32_TYPE);
-        typeMap.put("uint64", UINT64_TYPE);
-        typeMap.put("binary", BINARY_TYPE);
-    }
-
-    public static final TypeProvider BASE_YANG_TYPES_PROVIDER = new TypeProvider() {
-
-        @Override
-        public Type javaTypeForYangType(String type) {
-            return typeMap.get(type);
-        }
-
-        @Override
-        public Type javaTypeForSchemaDefinitionType(TypeDefinition<?> type) {
-            if (type != null) {
-                return typeMap.get(type.getQName().getLocalName());
-            }
-
-            return null;
-        }
-    };
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/GroupingDefinitionDependencySort.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/GroupingDefinitionDependencySort.java
deleted file mode 100644 (file)
index 2be70b1..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.yang.types;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.UsesNode;
-import org.opendaylight.yangtools.yang.parser.util.TopologicalSort;
-import org.opendaylight.yangtools.yang.parser.util.TopologicalSort.Node;
-import org.opendaylight.yangtools.yang.parser.util.TopologicalSort.NodeImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-
-//import org.opendaylight.controller.yang.model.util.GroupingDefinition;
-
-public class GroupingDefinitionDependencySort {
-    private static final Logger logger = LoggerFactory.getLogger(GroupingDefinitionDependencySort.class);
-
-    public static List<GroupingDefinition> sort(final Set<GroupingDefinition> groupingDefinitions) {
-        if (groupingDefinitions == null) {
-            logger.error("Set of grouping definitions cannot be NULL!");
-            throw new IllegalArgumentException("Set of Type Definitions " + "cannot be NULL!");
-        }
-
-        final List<GroupingDefinition> resultGroupingDefinitions = new ArrayList<GroupingDefinition>();
-        final Set<Node> unsorted = groupingDefinitionsToGroupingNodes(groupingDefinitions);
-        final List<Node> sortedNodes = TopologicalSort.sort(unsorted);
-        for (Node node : sortedNodes) {
-            resultGroupingDefinitions.add(((GroupingNode) node).getGroupingDefinition());
-        }
-        return resultGroupingDefinitions;
-
-    }
-
-    private static Set<Node> groupingDefinitionsToGroupingNodes(final Set<GroupingDefinition> groupingDefinitions) {
-        final Map<SchemaPath, Node> nodeMap = Maps.newHashMap();
-        final Set<Node> resultNodes = Sets.newHashSet();
-
-        for (final GroupingDefinition groupingDefinition : groupingDefinitions) {
-            final Node node = new GroupingNode(groupingDefinition);
-            nodeMap.put(groupingDefinition.getPath(), node);
-            resultNodes.add(node);
-        }
-
-        for (final Node node : resultNodes) {
-            final GroupingNode groupingNode = (GroupingNode) node;
-            final GroupingDefinition groupingDefinition = groupingNode.getGroupingDefinition();
-
-            Set<UsesNode> usesNodes = groupingDefinition.getUses();
-            for (UsesNode usesNode : usesNodes) {
-                SchemaPath schemaPath = usesNode.getGroupingPath();
-                if (schemaPath != null) {
-                    Node nodeTo = nodeMap.get(schemaPath);
-                    groupingNode.addEdge(nodeTo);
-                }
-            }
-        }
-
-        return resultNodes;
-    }
-
-    private static final class GroupingNode extends NodeImpl {
-        private final GroupingDefinition groupingDefinition;
-
-        GroupingNode(GroupingDefinition groupingDefinition) {
-            this.groupingDefinition = groupingDefinition;
-        }
-
-        GroupingDefinition getGroupingDefinition() {
-            return groupingDefinition;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (this == o) {
-                return true;
-            }
-            if (!(o instanceof GroupingNode)) {
-                return false;
-            }
-            GroupingNode groupingNode = (GroupingNode) o;
-            if (!groupingDefinition.equals(groupingNode.groupingDefinition)) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public int hashCode() {
-            return groupingDefinition.hashCode();
-        }
-
-        @Override
-        public String toString() {
-            return "GroupingNode{" + "groupingType=" + groupingDefinition + '}';
-        }
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/TypeProviderImpl.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/TypeProviderImpl.java
deleted file mode 100644 (file)
index 7e6f93f..0000000
+++ /dev/null
@@ -1,743 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.yang.types;
-
-import static org.opendaylight.controller.binding.generator.util.BindingGeneratorUtil.*;
-import static org.opendaylight.yangtools.yang.model.util.SchemaContextUtil.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.opendaylight.controller.binding.generator.util.ReferencedTypeImpl;
-import org.opendaylight.controller.binding.generator.util.TypeConstants;
-import org.opendaylight.controller.binding.generator.util.Types;
-import org.opendaylight.controller.binding.generator.util.generated.type.builder.EnumerationBuilderImpl;
-import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTOBuilderImpl;
-import org.opendaylight.controller.sal.binding.generator.spi.TypeProvider;
-import org.opendaylight.controller.sal.binding.model.api.Enumeration;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.EnumBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedPropertyBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTOBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTypeBuilder;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
-import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition.Bit;
-import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition.EnumPair;
-import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint;
-import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
-import org.opendaylight.yangtools.yang.model.util.ExtendedType;
-import org.opendaylight.yangtools.yang.model.util.StringType;
-import org.opendaylight.yangtools.yang.model.util.UnionType;
-
-public final class TypeProviderImpl implements TypeProvider {
-
-    private final SchemaContext schemaContext;
-    private Map<String, Map<String, Type>> genTypeDefsContextMap;
-    private final Map<SchemaPath, Type> referencedTypes;
-
-    public TypeProviderImpl(final SchemaContext schemaContext) {
-        if (schemaContext == null) {
-            throw new IllegalArgumentException("Schema Context cannot be null!");
-        }
-
-        this.schemaContext = schemaContext;
-        this.genTypeDefsContextMap = new HashMap<>();
-        this.referencedTypes = new HashMap<>();
-        resolveTypeDefsFromContext();
-    }
-
-    public void putReferencedType(final SchemaPath refTypePath, final Type refType) {
-        if (refTypePath == null) {
-            throw new IllegalArgumentException("Path reference of " + "Enumeration Type Definition cannot be NULL!");
-        }
-
-        if (refType == null) {
-            throw new IllegalArgumentException("Reference to Enumeration " + "Type cannot be NULL!");
-        }
-        referencedTypes.put(refTypePath, refType);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see org.opendaylight.controller.yang.model.type.provider.TypeProvider#
-     * javaTypeForYangType(java.lang.String)
-     */
-    @Override
-    public Type javaTypeForYangType(String type) {
-        Type t = BaseYangTypes.BASE_YANG_TYPES_PROVIDER.javaTypeForYangType(type);
-        return t;
-    }
-
-    @Override
-    public Type javaTypeForSchemaDefinitionType(final TypeDefinition<?> typeDefinition) {
-        Type returnType = null;
-        if (typeDefinition == null) {
-            throw new IllegalArgumentException("Type Definition cannot be NULL!");
-        }
-        if (typeDefinition.getQName() == null) {
-            throw new IllegalArgumentException(
-                    "Type Definition cannot have non specified QName (QName cannot be NULL!)");
-        }
-        if (typeDefinition.getQName().getLocalName() == null) {
-            throw new IllegalArgumentException("Type Definitions Local Name cannot be NULL!");
-        }
-        final String typedefName = typeDefinition.getQName().getLocalName();
-        if (typeDefinition instanceof ExtendedType) {
-            final TypeDefinition<?> baseTypeDef = baseTypeDefForExtendedType(typeDefinition);
-
-            if (baseTypeDef instanceof LeafrefTypeDefinition) {
-                final LeafrefTypeDefinition leafref = (LeafrefTypeDefinition) baseTypeDef;
-                returnType = provideTypeForLeafref(leafref);
-            } else if (baseTypeDef instanceof IdentityrefTypeDefinition) {
-                final IdentityrefTypeDefinition idref = (IdentityrefTypeDefinition) baseTypeDef;
-                returnType = returnTypeForIdentityref(idref);
-            } else if (baseTypeDef instanceof EnumTypeDefinition) {
-                final EnumTypeDefinition enumTypeDef = (EnumTypeDefinition) baseTypeDef;
-                returnType = resolveEnumFromTypeDefinition(enumTypeDef, typedefName);
-            } else {
-                final Module module = findParentModuleForTypeDefinition(schemaContext, typeDefinition);
-                if (module != null) {
-                    final Map<String, Type> genTOs = genTypeDefsContextMap.get(module.getName());
-                    if (genTOs != null) {
-                        returnType = genTOs.get(typedefName);
-                    }
-                    if (returnType == null) {
-                        returnType = BaseYangTypes.BASE_YANG_TYPES_PROVIDER
-                                .javaTypeForSchemaDefinitionType(baseTypeDef);
-                    }
-                }
-            }
-        } else {
-            if (typeDefinition instanceof LeafrefTypeDefinition) {
-                final LeafrefTypeDefinition leafref = (LeafrefTypeDefinition) typeDefinition;
-                returnType = provideTypeForLeafref(leafref);
-            } else if (typeDefinition instanceof IdentityrefTypeDefinition) {
-                final IdentityrefTypeDefinition idref = (IdentityrefTypeDefinition) typeDefinition;
-                returnType = returnTypeForIdentityref(idref);
-            } else {
-                returnType = BaseYangTypes.BASE_YANG_TYPES_PROVIDER.javaTypeForSchemaDefinitionType(typeDefinition);
-            }
-        }
-        // TODO: add throw exception when we will be able to resolve ALL yang
-        // types!
-        // if (returnType == null) {
-        // throw new IllegalArgumentException("Type Provider can't resolve " +
-        // "type for specified Type Definition " + typedefName);
-        // }
-        return returnType;
-    }
-
-    private Type returnTypeForIdentityref(IdentityrefTypeDefinition idref) {
-        QName baseIdQName = idref.getIdentity();
-        Module module = schemaContext.findModuleByNamespace(baseIdQName.getNamespace());
-        IdentitySchemaNode identity = null;
-        for (IdentitySchemaNode id : module.getIdentities()) {
-            if (id.getQName().equals(baseIdQName)) {
-                identity = id;
-            }
-        }
-        if (identity == null) {
-            throw new IllegalArgumentException("Target identity '" + baseIdQName + "' do not exists");
-        }
-
-        final String basePackageName = moduleNamespaceToPackageName(module);
-        final String packageName = packageNameForGeneratedType(basePackageName, identity.getPath());
-        final String genTypeName = parseToClassName(identity.getQName().getLocalName());
-
-        Type baseType = Types.typeForClass(Class.class);
-        Type paramType = Types.wildcardTypeFor(packageName, genTypeName);
-        Type returnType = Types.parameterizedTypeFor(baseType, paramType);
-        return returnType;
-    }
-
-    public Type generatedTypeForExtendedDefinitionType(final TypeDefinition<?> typeDefinition) {
-        Type returnType = null;
-        if (typeDefinition == null) {
-            throw new IllegalArgumentException("Type Definition cannot be NULL!");
-        }
-        if (typeDefinition.getQName() == null) {
-            throw new IllegalArgumentException(
-                    "Type Definition cannot have non specified QName (QName cannot be NULL!)");
-        }
-        if (typeDefinition.getQName() == null) {
-            throw new IllegalArgumentException("Type Definitions Local Name cannot be NULL!");
-        }
-
-        final String typedefName = typeDefinition.getQName().getLocalName();
-        if (typeDefinition instanceof ExtendedType) {
-            final TypeDefinition<?> baseTypeDef = baseTypeDefForExtendedType(typeDefinition);
-
-            if (!(baseTypeDef instanceof LeafrefTypeDefinition) && !(baseTypeDef instanceof IdentityrefTypeDefinition)) {
-                final Module module = findParentModuleForTypeDefinition(schemaContext, typeDefinition);
-
-                if (module != null) {
-                    final Map<String, Type> genTOs = genTypeDefsContextMap.get(module.getName());
-                    if (genTOs != null) {
-                        returnType = genTOs.get(typedefName);
-                    }
-                }
-            }
-        }
-        return returnType;
-    }
-
-    private TypeDefinition<?> baseTypeDefForExtendedType(final TypeDefinition<?> extendTypeDef) {
-        if (extendTypeDef == null) {
-            throw new IllegalArgumentException("Type Definiition reference cannot be NULL!");
-        }
-        final TypeDefinition<?> baseTypeDef = extendTypeDef.getBaseType();
-        if (baseTypeDef instanceof ExtendedType) {
-            return baseTypeDefForExtendedType(baseTypeDef);
-        } else {
-            return baseTypeDef;
-        }
-
-    }
-
-    public Type provideTypeForLeafref(final LeafrefTypeDefinition leafrefType) {
-        Type returnType = null;
-        if (leafrefType == null) {
-            throw new IllegalArgumentException("Leafref Type Definition reference cannot be NULL!");
-        }
-
-        if (leafrefType.getPathStatement() == null) {
-            throw new IllegalArgumentException("The Path Statement for Leafref Type Definition cannot be NULL!");
-        }
-
-        final RevisionAwareXPath xpath = leafrefType.getPathStatement();
-        final String strXPath = xpath.toString();
-
-        if (strXPath != null) {
-            if (strXPath.contains("[")) {
-                returnType = Types.typeForClass(Object.class);
-            } else {
-                final Module module = findParentModuleForTypeDefinition(schemaContext, leafrefType);
-                if (module != null) {
-                    final DataSchemaNode dataNode;
-                    if (xpath.isAbsolute()) {
-                        dataNode = findDataSchemaNode(schemaContext, module, xpath);
-                    } else {
-                        dataNode = findDataSchemaNodeForRelativeXPath(schemaContext, module, leafrefType, xpath);
-                    }
-
-                    if (leafContainsEnumDefinition(dataNode)) {
-                        returnType = referencedTypes.get(dataNode.getPath());
-                    } else if (leafListContainsEnumDefinition(dataNode)) {
-                        returnType = Types.listTypeFor(referencedTypes.get(dataNode.getPath()));
-                    } else {
-                        returnType = resolveTypeFromDataSchemaNode(dataNode);
-                    }
-                }
-            }
-        }
-        return returnType;
-    }
-
-    private boolean leafContainsEnumDefinition(final DataSchemaNode dataNode) {
-        if (dataNode instanceof LeafSchemaNode) {
-            final LeafSchemaNode leaf = (LeafSchemaNode) dataNode;
-            if (leaf.getType() instanceof EnumTypeDefinition) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private boolean leafListContainsEnumDefinition(final DataSchemaNode dataNode) {
-        if (dataNode instanceof LeafListSchemaNode) {
-            final LeafListSchemaNode leafList = (LeafListSchemaNode) dataNode;
-            if (leafList.getType() instanceof EnumTypeDefinition) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private Enumeration resolveEnumFromTypeDefinition(final EnumTypeDefinition enumTypeDef, final String enumName) {
-        if (enumTypeDef == null) {
-            throw new IllegalArgumentException("EnumTypeDefinition reference cannot be NULL!");
-        }
-        if (enumTypeDef.getValues() == null) {
-            throw new IllegalArgumentException("EnumTypeDefinition MUST contain at least ONE value definition!");
-        }
-        if (enumTypeDef.getQName() == null) {
-            throw new IllegalArgumentException("EnumTypeDefinition MUST contain NON-NULL QName!");
-        }
-        if (enumTypeDef.getQName().getLocalName() == null) {
-            throw new IllegalArgumentException("Local Name in EnumTypeDefinition QName cannot be NULL!");
-        }
-
-        final String enumerationName = parseToClassName(enumName);
-
-        Module module = findParentModuleForTypeDefinition(schemaContext, enumTypeDef);
-        final String basePackageName = moduleNamespaceToPackageName(module);
-
-        final EnumBuilder enumBuilder = new EnumerationBuilderImpl(basePackageName, enumerationName);
-        updateEnumPairsFromEnumTypeDef(enumTypeDef, enumBuilder);
-        return enumBuilder.toInstance(null);
-    }
-
-    private EnumBuilder resolveInnerEnumFromTypeDefinition(final EnumTypeDefinition enumTypeDef, final String enumName,
-            final GeneratedTypeBuilder typeBuilder) {
-        if (enumTypeDef == null) {
-            throw new IllegalArgumentException("EnumTypeDefinition reference cannot be NULL!");
-        }
-        if (enumTypeDef.getValues() == null) {
-            throw new IllegalArgumentException("EnumTypeDefinition MUST contain at least ONE value definition!");
-        }
-        if (enumTypeDef.getQName() == null) {
-            throw new IllegalArgumentException("EnumTypeDefinition MUST contain NON-NULL QName!");
-        }
-        if (enumTypeDef.getQName().getLocalName() == null) {
-            throw new IllegalArgumentException("Local Name in EnumTypeDefinition QName cannot be NULL!");
-        }
-        if (typeBuilder == null) {
-            throw new IllegalArgumentException("Generated Type Builder reference cannot be NULL!");
-        }
-
-        final String enumerationName = parseToClassName(enumName);
-        final EnumBuilder enumBuilder = typeBuilder.addEnumeration(enumerationName);
-
-        updateEnumPairsFromEnumTypeDef(enumTypeDef, enumBuilder);
-
-        return enumBuilder;
-    }
-
-    private void updateEnumPairsFromEnumTypeDef(final EnumTypeDefinition enumTypeDef, final EnumBuilder enumBuilder) {
-        if (enumBuilder != null) {
-            final List<EnumPair> enums = enumTypeDef.getValues();
-            if (enums != null) {
-                int listIndex = 0;
-                for (final EnumPair enumPair : enums) {
-                    if (enumPair != null) {
-                        final String enumPairName = parseToClassName(enumPair.getName());
-                        Integer enumPairValue = enumPair.getValue();
-
-                        if (enumPairValue == null) {
-                            enumPairValue = listIndex;
-                        }
-                        enumBuilder.addValue(enumPairName, enumPairValue);
-                        listIndex++;
-                    }
-                }
-            }
-        }
-    }
-
-    private Type resolveTypeFromDataSchemaNode(final DataSchemaNode dataNode) {
-        Type returnType = null;
-        if (dataNode != null) {
-            if (dataNode instanceof LeafSchemaNode) {
-                final LeafSchemaNode leaf = (LeafSchemaNode) dataNode;
-                returnType = javaTypeForSchemaDefinitionType(leaf.getType());
-            } else if (dataNode instanceof LeafListSchemaNode) {
-                final LeafListSchemaNode leafList = (LeafListSchemaNode) dataNode;
-                returnType = javaTypeForSchemaDefinitionType(leafList.getType());
-            }
-        }
-        return returnType;
-    }
-
-    private void resolveTypeDefsFromContext() {
-        final Set<Module> modules = schemaContext.getModules();
-        if (modules == null) {
-            throw new IllegalArgumentException("Sef of Modules cannot be NULL!");
-        }
-        for (final Module module : modules) {
-            if (module == null) {
-                continue;
-            }
-            final String moduleName = module.getName();
-            final String basePackageName = moduleNamespaceToPackageName(module);
-
-            final Set<TypeDefinition<?>> typeDefinitions = module.getTypeDefinitions();
-            final List<TypeDefinition<?>> listTypeDefinitions = sortTypeDefinitionAccordingDepth(typeDefinitions);
-
-            final Map<String, Type> typeMap = new HashMap<>();
-            genTypeDefsContextMap.put(moduleName, typeMap);
-
-            if ((listTypeDefinitions != null) && (basePackageName != null)) {
-                for (final TypeDefinition<?> typedef : listTypeDefinitions) {
-                    typedefToGeneratedType(basePackageName, moduleName, typedef);
-                }
-            }
-        }
-    }
-
-    private Type typedefToGeneratedType(final String basePackageName, final String moduleName,
-            final TypeDefinition<?> typedef) {
-        if ((basePackageName != null) && (moduleName != null) && (typedef != null) && (typedef.getQName() != null)) {
-
-            final String typedefName = typedef.getQName().getLocalName();
-            final TypeDefinition<?> innerTypeDefinition = typedef.getBaseType();
-            if (!(innerTypeDefinition instanceof LeafrefTypeDefinition)
-                    && !(innerTypeDefinition instanceof IdentityrefTypeDefinition)) {
-                Type returnType = null;
-                if (innerTypeDefinition instanceof ExtendedType) {
-                    ExtendedType extendedTypeDef = (ExtendedType) innerTypeDefinition;
-                    returnType = resolveExtendedTypeFromTypeDef(extendedTypeDef, basePackageName, typedefName,
-                            moduleName);
-                } else if (innerTypeDefinition instanceof UnionTypeDefinition) {
-                    final GeneratedTOBuilder genTOBuilder = addUnionGeneratedTypeDefinition(basePackageName, typedef,
-                            typedefName);
-                    returnType = genTOBuilder.toInstance();
-                } else if (innerTypeDefinition instanceof EnumTypeDefinition) {
-                    final EnumTypeDefinition enumTypeDef = (EnumTypeDefinition) innerTypeDefinition;
-                    returnType = resolveEnumFromTypeDefinition(enumTypeDef, typedefName);
-
-                } else if (innerTypeDefinition instanceof BitsTypeDefinition) {
-                    final BitsTypeDefinition bitsTypeDefinition = (BitsTypeDefinition) innerTypeDefinition;
-                    final GeneratedTOBuilder genTOBuilder = bitsTypedefToTransferObject(basePackageName,
-                            bitsTypeDefinition, typedefName);
-                    returnType = genTOBuilder.toInstance();
-
-                } else {
-                    final Type javaType = BaseYangTypes.BASE_YANG_TYPES_PROVIDER
-                            .javaTypeForSchemaDefinitionType(innerTypeDefinition);
-
-                    returnType = wrapJavaTypeIntoTO(basePackageName, typedef, javaType);
-                }
-                if (returnType != null) {
-                    final Map<String, Type> typeMap = genTypeDefsContextMap.get(moduleName);
-                    if (typeMap != null) {
-                        typeMap.put(typedefName, returnType);
-                    }
-                    return returnType;
-                }
-            }
-        }
-        return null;
-    }
-
-    private GeneratedTransferObject wrapJavaTypeIntoTO(final String basePackageName, final TypeDefinition<?> typedef,
-            final Type javaType) {
-        if (javaType != null) {
-            final String typedefName = typedef.getQName().getLocalName();
-            final String propertyName = parseToValidParamName(typedefName);
-
-            final GeneratedTOBuilder genTOBuilder = typedefToTransferObject(basePackageName, typedef);
-
-            final GeneratedPropertyBuilder genPropBuilder = genTOBuilder.addProperty(propertyName);
-
-            genPropBuilder.setReturnType(javaType);
-            genTOBuilder.addEqualsIdentity(genPropBuilder);
-            genTOBuilder.addHashIdentity(genPropBuilder);
-            genTOBuilder.addToStringProperty(genPropBuilder);
-            if (javaType == BaseYangTypes.STRING_TYPE) {
-                if (typedef instanceof ExtendedType) {
-                    final List<String> regExps = resolveRegExpressionsFromTypedef((ExtendedType) typedef);
-                    addStringRegExAsConstant(genTOBuilder, regExps);
-                }
-            }
-            return genTOBuilder.toInstance();
-        }
-        return null;
-    }
-
-    public GeneratedTOBuilder addUnionGeneratedTypeDefinition(final String basePackageName,
-            final TypeDefinition<?> typedef, String typeDefName) {
-        if (basePackageName == null) {
-            throw new IllegalArgumentException("Base Package Name cannot be NULL!");
-        }
-        if (typedef == null) {
-            throw new IllegalArgumentException("Type Definition cannot be NULL!");
-        }
-        if (typedef.getQName() == null) {
-            throw new IllegalArgumentException(
-                    "Type Definition cannot have non specified QName (QName cannot be NULL!)");
-        }
-
-        final TypeDefinition<?> baseTypeDefinition = typedef.getBaseType();
-        if ((baseTypeDefinition != null) && (baseTypeDefinition instanceof UnionTypeDefinition)) {
-            final Module parentModule = findParentModuleForTypeDefinition(schemaContext, typedef);
-            final UnionTypeDefinition unionTypeDef = (UnionTypeDefinition) baseTypeDefinition;
-            final List<TypeDefinition<?>> unionTypes = unionTypeDef.getTypes();
-
-            Map<String, Type> genTOsMap = null;
-            if (parentModule != null && parentModule.getName() != null) {
-                genTOsMap = genTypeDefsContextMap.get(parentModule.getName());
-            }
-
-            final GeneratedTOBuilder unionGenTransObject;
-            if (typeDefName != null && !typeDefName.isEmpty()) {
-                final String typeName = parseToClassName(typeDefName);
-                unionGenTransObject = new GeneratedTOBuilderImpl(basePackageName, typeName);
-            } else {
-                unionGenTransObject = typedefToTransferObject(basePackageName, typedef);
-            }
-            unionGenTransObject.setIsUnion(true);
-
-            final List<String> regularExpressions = new ArrayList<String>();
-            for (final TypeDefinition<?> unionType : unionTypes) {
-                final String typeName = unionType.getQName().getLocalName();
-                if (unionType instanceof ExtendedType) {
-                    final Module unionTypeModule = findParentModuleForTypeDefinition(schemaContext, unionType);
-                    if (unionTypeModule != null && unionTypeModule.getName() != null) {
-                        final Map<String, Type> innerGenTOs = genTypeDefsContextMap.get(unionTypeModule.getName());
-                        Type genTransferObject = null;
-                        if (innerGenTOs != null) {
-                            genTransferObject = innerGenTOs.get(typeName);
-                        }
-                        if (genTransferObject != null) {
-                            updateUnionTypeAsProperty(unionGenTransObject, genTransferObject,
-                                    genTransferObject.getName());
-                        } else {
-                            final TypeDefinition<?> baseType = baseTypeDefForExtendedType(unionType);
-                            if (typeName.equals(baseType.getQName().getLocalName())) {
-                                final Type javaType = BaseYangTypes.BASE_YANG_TYPES_PROVIDER
-                                        .javaTypeForSchemaDefinitionType(baseType);
-                                if (javaType != null) {
-                                    updateUnionTypeAsProperty(unionGenTransObject, javaType, typeName);
-                                }
-                            }
-                            if (baseType instanceof StringType) {
-                                regularExpressions.addAll(resolveRegExpressionsFromTypedef((ExtendedType) unionType));
-                            }
-                        }
-                    }
-                } else if (unionType instanceof EnumTypeDefinition) {
-                    final EnumBuilder enumBuilder = resolveInnerEnumFromTypeDefinition((EnumTypeDefinition) unionType,
-                            typeName, unionGenTransObject);
-                    final Type enumRefType = new ReferencedTypeImpl(enumBuilder.getPackageName(), enumBuilder.getName());
-                    updateUnionTypeAsProperty(unionGenTransObject, enumRefType, typeName);
-                } else {
-                    final Type javaType = BaseYangTypes.BASE_YANG_TYPES_PROVIDER
-                            .javaTypeForSchemaDefinitionType(unionType);
-                    if (javaType != null) {
-                        updateUnionTypeAsProperty(unionGenTransObject, javaType, typeName);
-                    }
-                }
-            }
-            if (!regularExpressions.isEmpty()) {
-                addStringRegExAsConstant(unionGenTransObject, regularExpressions);
-            }
-
-            genTOsMap.put(typedef.getQName().getLocalName(), unionGenTransObject.toInstance());
-            return unionGenTransObject;
-        }
-        return null;
-    }
-
-    private void updateUnionTypeAsProperty(final GeneratedTOBuilder unionGenTransObject, final Type type,
-            final String propertyName) {
-        if (unionGenTransObject != null && type != null) {
-            if (!unionGenTransObject.containsProperty(propertyName)) {
-                final GeneratedPropertyBuilder propBuilder = unionGenTransObject
-                        .addProperty(parseToValidParamName(propertyName));
-                propBuilder.setReturnType(type);
-
-                if (!(type instanceof Enumeration)) {
-                    unionGenTransObject.addEqualsIdentity(propBuilder);
-                    unionGenTransObject.addHashIdentity(propBuilder);
-                    unionGenTransObject.addToStringProperty(propBuilder);
-                }
-            }
-        }
-    }
-
-    private GeneratedTOBuilder typedefToTransferObject(final String basePackageName, final TypeDefinition<?> typedef) {
-
-        final String packageName = packageNameForGeneratedType(basePackageName, typedef.getPath());
-        final String typeDefTOName = typedef.getQName().getLocalName();
-
-        if ((packageName != null) && (typedef != null) && (typeDefTOName != null)) {
-            final String genTOName = parseToClassName(typeDefTOName);
-            final GeneratedTOBuilder newType = new GeneratedTOBuilderImpl(packageName, genTOName);
-
-            return newType;
-        }
-        return null;
-    }
-
-    public GeneratedTOBuilder bitsTypedefToTransferObject(final String basePackageName,
-            final TypeDefinition<?> typeDef, String typeDefName) {
-
-        if (typeDef == null) {
-            throw new IllegalArgumentException("typeDef cannot be NULL!");
-        }
-        if (basePackageName == null) {
-            throw new IllegalArgumentException("Base Package Name cannot be NULL!");
-        }
-
-        if (typeDef instanceof BitsTypeDefinition) {
-            BitsTypeDefinition bitsTypeDefinition = (BitsTypeDefinition) typeDef;
-
-            final String typeName = parseToClassName(typeDefName);
-            final GeneratedTOBuilder genTOBuilder = new GeneratedTOBuilderImpl(basePackageName, typeName);
-
-            final List<Bit> bitList = bitsTypeDefinition.getBits();
-            GeneratedPropertyBuilder genPropertyBuilder;
-            for (final Bit bit : bitList) {
-                String name = bit.getName();
-                genPropertyBuilder = genTOBuilder.addProperty(parseToValidParamName(name));
-                genPropertyBuilder.setReadOnly(false);
-                genPropertyBuilder.setReturnType(BaseYangTypes.BOOLEAN_TYPE);
-
-                genTOBuilder.addEqualsIdentity(genPropertyBuilder);
-                genTOBuilder.addHashIdentity(genPropertyBuilder);
-                genTOBuilder.addToStringProperty(genPropertyBuilder);
-            }
-
-            return genTOBuilder;
-        }
-        return null;
-    }
-
-    private List<String> resolveRegExpressionsFromTypedef(ExtendedType typedef) {
-        final List<String> regExps = new ArrayList<String>();
-        if (typedef == null) {
-            throw new IllegalArgumentException("typedef can't be null");
-        }
-        final TypeDefinition<?> strTypeDef = baseTypeDefForExtendedType(typedef);
-        if (strTypeDef instanceof StringType) {
-            final List<PatternConstraint> patternConstraints = typedef.getPatterns();
-            if (!patternConstraints.isEmpty()) {
-                String regEx;
-                String modifiedRegEx;
-                for (PatternConstraint patternConstraint : patternConstraints) {
-                    regEx = patternConstraint.getRegularExpression();
-                    modifiedRegEx = StringEscapeUtils.escapeJava(regEx);
-                    regExps.add(modifiedRegEx);
-                }
-            }
-        }
-        return regExps;
-    }
-
-    private void addStringRegExAsConstant(GeneratedTOBuilder genTOBuilder, List<String> regularExpressions) {
-        if (genTOBuilder == null)
-            throw new IllegalArgumentException("genTOBuilder can't be null");
-        if (regularExpressions == null)
-            throw new IllegalArgumentException("regularExpressions can't be null");
-
-        if (!regularExpressions.isEmpty()) {
-            genTOBuilder.addConstant(Types.listTypeFor(BaseYangTypes.STRING_TYPE), TypeConstants.PATTERN_CONSTANT_NAME,
-                    regularExpressions);
-        }
-    }
-
-    private GeneratedTransferObject resolveExtendedTypeFromTypeDef(final ExtendedType extendedType,
-            final String basePackageName, final String typedefName, final String moduleName) {
-
-        if (extendedType == null) {
-            throw new IllegalArgumentException("Extended type cannot be NULL!");
-        }
-        if (basePackageName == null) {
-            throw new IllegalArgumentException("String with base package name cannot be NULL!");
-        }
-        if (typedefName == null) {
-            throw new IllegalArgumentException("String with type definition name cannot be NULL!");
-        }
-
-        final String typeDefName = parseToClassName(typedefName);
-        final String lowTypeDef = extendedType.getQName().getLocalName();
-        final GeneratedTOBuilder genTOBuilder = new GeneratedTOBuilderImpl(basePackageName, typeDefName);
-
-        final Map<String, Type> typeMap = genTypeDefsContextMap.get(moduleName);
-        if (typeMap != null) {
-            Type type = typeMap.get(lowTypeDef);
-            if (type instanceof GeneratedTransferObject) {
-                genTOBuilder.setExtendsType((GeneratedTransferObject) type);
-            }
-        }
-
-        return genTOBuilder.toInstance();
-    }
-
-    /**
-     * The method find out for each type definition how many immersion (depth)
-     * is necessary to get to the base type. Every type definition is inserted
-     * to the map which key is depth and value is list of type definitions with
-     * equal depth. In next step are lists from this map concatenated to one
-     * list in ascending order according to their depth. All type definitions
-     * are in the list behind all type definitions on which depends.
-     *
-     * @param unsortedTypeDefinitions
-     *            represents list of type definitions
-     * @return list of type definitions sorted according their each other
-     *         dependencies (type definitions which are depend on other type
-     *         definitions are in list behind them).
-     */
-    private List<TypeDefinition<?>> sortTypeDefinitionAccordingDepth(
-            final Set<TypeDefinition<?>> unsortedTypeDefinitions) {
-        List<TypeDefinition<?>> sortedTypeDefinition = new ArrayList<>();
-
-        Map<Integer, List<TypeDefinition<?>>> typeDefinitionsDepths = new TreeMap<>();
-        for (TypeDefinition<?> unsortedTypeDefinition : unsortedTypeDefinitions) {
-            final int depth = getTypeDefinitionDepth(unsortedTypeDefinition);
-            List<TypeDefinition<?>> typeDefinitionsConcreteDepth = typeDefinitionsDepths.get(depth);
-            if (typeDefinitionsConcreteDepth == null) {
-                typeDefinitionsConcreteDepth = new ArrayList<TypeDefinition<?>>();
-                typeDefinitionsDepths.put(depth, typeDefinitionsConcreteDepth);
-            }
-            typeDefinitionsConcreteDepth.add(unsortedTypeDefinition);
-        }
-
-        Set<Integer> depths = typeDefinitionsDepths.keySet(); // keys are in
-                                                              // ascending order
-        for (Integer depth : depths) {
-            sortedTypeDefinition.addAll(typeDefinitionsDepths.get(depth));
-        }
-
-        return sortedTypeDefinition;
-    }
-
-    /**
-     * The method return how many immersion is necessary to get from type
-     * definition to base type.
-     *
-     * @param typeDefinition
-     *            is type definition for which is depth looked for.
-     * @return how many immersion is necessary to get from type definition to
-     *         base type
-     */
-    private int getTypeDefinitionDepth(final TypeDefinition<?> typeDefinition) {
-        if (typeDefinition == null) {
-            throw new IllegalArgumentException("Type definition can't be null");
-        }
-        int depth = 1;
-        TypeDefinition<?> baseType = typeDefinition.getBaseType();
-
-        if (baseType instanceof ExtendedType) {
-            depth = depth + getTypeDefinitionDepth(typeDefinition.getBaseType());
-        } else if (baseType instanceof UnionType) {
-            List<TypeDefinition<?>> childTypeDefinitions = ((UnionType) baseType).getTypes();
-            int maxChildDepth = 0;
-            int childDepth = 1;
-            for (TypeDefinition<?> childTypeDefinition : childTypeDefinitions) {
-                childDepth = childDepth + getTypeDefinitionDepth(childTypeDefinition.getBaseType());
-                if (childDepth > maxChildDepth) {
-                    maxChildDepth = childDepth;
-                }
-            }
-            return maxChildDepth;
-        }
-        return depth;
-    }
-
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/UnionDependencySort.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/UnionDependencySort.java
deleted file mode 100644 (file)
index 171e1f6..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.yang.types;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
-import org.opendaylight.yangtools.yang.model.util.ExtendedType;
-import org.opendaylight.yangtools.yang.parser.util.TopologicalSort;
-import org.opendaylight.yangtools.yang.parser.util.TopologicalSort.Node;
-import org.opendaylight.yangtools.yang.parser.util.TopologicalSort.NodeImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-
-public class UnionDependencySort {
-    private static final Logger logger = LoggerFactory
-            .getLogger(UnionDependencySort.class);
-
-    public static List<ExtendedType> sort(
-            final Set<TypeDefinition<?>> typeDefinitions) {
-        if (typeDefinitions == null) {
-            logger.error("Set of Type Definitions cannot be NULL!");
-            throw new IllegalArgumentException("Set of Type Definitions " +
-                    "cannot be NULL!");
-        }
-
-        final Set<ExtendedType> extUnionTypes =
-                unionsFromTypeDefinitions(typeDefinitions);
-
-        final Set<Node> unsorted = unionTypesToUnionNodes(extUnionTypes);
-
-        final List<Node> sortedNodes = TopologicalSort.sort(unsorted);
-        return Lists.transform(sortedNodes, new Function<Node, ExtendedType>() {
-            @Override
-            public ExtendedType apply(Node input) {
-                return ((UnionNode) input).getUnionType();
-            }
-        });
-    }
-
-    private static Set<ExtendedType> unionsFromTypeDefinitions(
-            final Set<TypeDefinition<?>> typeDefinitions) {
-        final Set<ExtendedType> unions = Sets.newHashSet();
-
-        for (final TypeDefinition<?> typedef : typeDefinitions) {
-            if ((typedef != null) && (typedef.getBaseType() != null)) {
-                if (typedef instanceof ExtendedType
-                        && typedef.getBaseType() instanceof UnionTypeDefinition) {
-                    unions.add((ExtendedType) typedef);
-                }
-            }
-        }
-        return unions;
-    }
-
-    private static Set<Node> unionTypesToUnionNodes(
-            final Set<ExtendedType> extUnionTypes) {
-        final Map<ExtendedType, Node> nodeMap = Maps.newHashMap();
-        final Set<Node> resultNodes = Sets.newHashSet();
-
-        for (final ExtendedType unionType : extUnionTypes) {
-            final Node node = new UnionNode(unionType);
-            nodeMap.put(unionType, node);
-            resultNodes.add(node);
-        }
-
-        for (final Node node : resultNodes) {
-            final UnionNode unionNode = (UnionNode) node;
-            final ExtendedType extUnionType = unionNode.getUnionType();
-
-            final UnionTypeDefinition unionType = (UnionTypeDefinition)
-                    extUnionType.getBaseType();
-
-            final List<TypeDefinition<?>> innerTypes = unionType.getTypes();
-            for (final TypeDefinition<?> typedef : innerTypes) {
-                if (extUnionTypes.contains(typedef)) {
-                    final Node toNode = nodeMap.get(typedef);
-                    unionNode.addEdge(toNode);
-                }
-            }
-        }
-
-        return resultNodes;
-    }
-
-    private static UnionNode unionTypeToUnionNode(
-            final ExtendedType extUnionType,
-            final Set<ExtendedType> extUnionTypes) {
-        final UnionNode node = new UnionNode(extUnionType);
-
-        if (extUnionType.getBaseType() instanceof UnionTypeDefinition) {
-            final UnionTypeDefinition unionType = (UnionTypeDefinition)
-                    extUnionType.getBaseType();
-
-            final List<TypeDefinition<?>> innerTypes = unionType.getTypes();
-            for (final TypeDefinition<?> typedef : innerTypes) {
-                if ((typedef != null) && (typedef instanceof ExtendedType)
-                        && (typedef.getBaseType() instanceof UnionTypeDefinition)) {
-                    if (extUnionTypes.contains(typedef)) {
-                        node.addEdge(new UnionNode((ExtendedType) typedef));
-                    }
-                }
-            }
-        }
-
-        return node;
-    }
-
-    @VisibleForTesting
-    static final class UnionNode extends NodeImpl {
-        private final ExtendedType unionType;
-
-        UnionNode(ExtendedType unionType) {
-            this.unionType = unionType;
-        }
-
-        ExtendedType getUnionType() {
-            return unionType;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (this == o) {
-                return true;
-            }
-            if (!(o instanceof UnionNode)) {
-                return false;
-            }
-            UnionNode unionNode = (UnionNode) o;
-            if (!unionType.equals(unionNode.unionType)) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public int hashCode() {
-            return unionType.hashCode();
-        }
-
-        @Override
-        public String toString() {
-            return "UnionNode{" +
-                    "unionType=" + unionType +
-                    '}';
-        }
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/package-info.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/package-info.java
deleted file mode 100644 (file)
index 199dfb9..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*\r
-  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
-  *\r
-  * This program and the accompanying materials are made available under the\r
-  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
-  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
-  */\r
-package org.opendaylight.controller.sal.binding.yang.types;
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/AugmentRleativeXPathTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/AugmentRleativeXPathTest.java
deleted file mode 100644 (file)
index ed84df5..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class AugmentRleativeXPathTest {
-
-    private final static List<File> augmentModels = new ArrayList<>();
-    private final static String augmentFolderPath = AugmentedTypeTest.class
-            .getResource("/augment-relative-xpath-models").getPath();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File augFolder = new File(augmentFolderPath);
-
-        for (final File fileEntry : augFolder.listFiles()) {
-            if (fileEntry.isFile()) {
-                augmentModels.add(fileEntry);
-            }
-        }
-    }
-
-    @Test
-    public void AugmentationWithRelativeXPathTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(augmentModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull("context is null", context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull("genTypes is null", genTypes);
-        assertFalse("genTypes is empty", genTypes.isEmpty());
-
-        GeneratedTransferObject gtInterfaceKey = null;
-        GeneratedType gtInterface = null;
-        GeneratedType gtTunnel = null;
-        GeneratedTransferObject gtTunnelKey = null;
-
-        for (final Type type : genTypes) {
-            if (type.getName().equals("InterfaceKey") && type.getPackageName().contains("augment._abstract.topology")) {
-                gtInterfaceKey = (GeneratedTransferObject) type;
-            } else if (type.getName().equals("Interface") && type.getPackageName().contains("augment._abstract.topology")) {
-                gtInterface = (GeneratedType) type;
-            } else if (type.getName().equals("Tunnel") && type.getPackageName().contains("augment._abstract.topology")) {
-                gtTunnel = (GeneratedType) type;
-            } else if (type.getName().equals("TunnelKey") && type.getPackageName().contains("augment._abstract.topology")) {
-                gtTunnelKey = (GeneratedTransferObject) type;
-            }
-        }
-
-        // 'Interface
-        assertNotNull("gtInterface is null", gtInterface);
-        final List<MethodSignature> gtInterfaceMethods = gtInterface.getMethodDefinitions();
-        assertNotNull("gtInterfaceMethods is null", gtInterfaceMethods);
-        MethodSignature getIfcKeyMethod = null;
-        for (final MethodSignature method : gtInterfaceMethods) {
-            if (method.getName().equals("getInterfaceKey")) {
-                getIfcKeyMethod = method;
-                break;
-            }
-        }
-        assertNotNull("getIfcKeyMethod is null", getIfcKeyMethod);
-        assertNotNull("getIfcKeyMethod.getReturnType() is null", getIfcKeyMethod.getReturnType());
-        assertFalse("getIfcKeyMethod.getReturnType() should not be Void",
-                getIfcKeyMethod.getReturnType().equals("java.lang.Void"));
-        assertTrue("getIfcKeyMethod.getReturnType().getName() must be InterfaceKey",
-                getIfcKeyMethod.getReturnType().getName().equals("InterfaceKey"));
-
-        // 'InterfaceKey'
-        assertNotNull("gtInterfaceKey is null", gtInterfaceKey);
-        final List<GeneratedProperty> properties = gtInterfaceKey.getProperties();
-        assertNotNull("properties is null", properties);
-        GeneratedProperty gtInterfaceId = null;
-        for (final GeneratedProperty property : properties) {
-            if (property.getName().equals("InterfaceId")) {
-                gtInterfaceId = property;
-                break;
-            }
-        }
-        assertNotNull("gtInterfaceId is null", gtInterfaceId);
-        assertNotNull("gtInterfaceId.getReturnType() is null", gtInterfaceId.getReturnType());
-        assertFalse("gtInterfaceId.getReturnType() should not be Void",
-                gtInterfaceId.getReturnType().equals("java.lang.Void"));
-        assertTrue("gtInterfaceId.getReturnType().getName() must be String",
-                gtInterfaceId.getReturnType().getName().equals("String"));
-
-        // 'Tunnel'
-        assertNotNull("gtTunnel is null", gtTunnel);
-        final List<MethodSignature> tunnelMethods = gtTunnel.getMethodDefinitions();
-        assertNotNull("tunnelMethods is null", tunnelMethods);
-        MethodSignature getTunnelKeyMethod = null;
-        for (MethodSignature method : tunnelMethods) {
-            if (method.getName().equals("getTunnelKey")) {
-                getTunnelKeyMethod = method;
-                break;
-            }
-        }
-        assertNotNull("getTunnelKeyMethod is null", getTunnelKeyMethod);
-        assertNotNull("getTunnelKeyMethod.getReturnType()",
-                getTunnelKeyMethod.getReturnType());
-        assertFalse("getTunnelKeyMethod.getReturnType() should not be Void",
-                getTunnelKeyMethod.getReturnType().equals("java.lang.Void"));
-        assertTrue("getTunnelKeyMethod.getReturnType().getName() must be TunnelKey",
-                getTunnelKeyMethod.getReturnType().getName().equals("TunnelKey"));
-
-        // 'TunnelKey'
-        assertNotNull("gtTunnelKey is null", gtTunnelKey);
-        final List<GeneratedProperty> tunnelKeyProperties = gtTunnelKey.getProperties();
-        assertNotNull("tunnelKeyProperties is null", tunnelKeyProperties);
-
-        GeneratedProperty gtTunnelId = null;
-        for (final GeneratedProperty property : tunnelKeyProperties) {
-            if (property.getName().equals("TunnelId")) {
-                gtTunnelId = property;
-            }
-        }
-        assertNotNull("gtTunnelId is null", gtTunnelId);
-        assertNotNull("gtTunnelId.getReturnType() is null",
-                gtTunnelId.getReturnType());
-        assertFalse("gtTunnelId.getReturnType() should not be Void",
-                gtTunnelId.getReturnType().equals("java.lang.Void"));
-        assertTrue("gtTunnelId.getReturnType().getName() must be Uri",
-                gtTunnelId.getReturnType().getName().equals("Uri"));
-    }
-
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/AugmentedTypeTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/AugmentedTypeTest.java
deleted file mode 100644 (file)
index f8958c1..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class AugmentedTypeTest {
-
-    private final static List<File> augmentModels = new ArrayList<>();
-    private final static String augmentFolderPath = AugmentedTypeTest.class
-            .getResource("/augment-test-models").getPath();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File augFolder = new File(augmentFolderPath);
-
-        for (final File fileEntry : augFolder.listFiles()) {
-            if (fileEntry.isFile()) {
-                augmentModels.add(fileEntry);
-            }
-        }
-    }
-
-    @Test
-    public void augmentedAbstractTopologyTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(augmentModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull("context is null", context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull("genTypes is null", genTypes);
-        assertFalse("genTypes is empty", genTypes.isEmpty());
-
-        GeneratedTransferObject gtInterfaceKey = null;
-        GeneratedType gtInterface = null;
-        GeneratedType gtTunnel = null;
-        GeneratedTransferObject gtTunnelKey = null;
-        GeneratedType gtNetworkLink2 = null;
-
-        for (final Type type : genTypes) {
-            if (type.getName().equals("InterfaceKey") && type.getPackageName().contains("augment._abstract.topology")) {
-                gtInterfaceKey = (GeneratedTransferObject) type;
-            } else if (type.getName().equals("Interface") && type.getPackageName().contains("augment._abstract.topology")) {
-                gtInterface = (GeneratedType) type;
-            } else if (type.getName().equals("Tunnel") && type.getPackageName().contains("augment._abstract.topology")) {
-                gtTunnel = (GeneratedType) type;
-            } else if (type.getName().equals("TunnelKey") && type.getPackageName().contains("augment._abstract.topology")) {
-                gtTunnelKey = (GeneratedTransferObject) type;
-            } else if (type.getName().equals("NetworkLink2") && type.getPackageName().contains("augment._abstract.topology")) {
-                gtNetworkLink2 = (GeneratedType) type;
-            }
-        }
-
-        // 'Interface
-        assertNotNull("gtInterface is null", gtInterface);
-        final List<MethodSignature> gtInterfaceMethods = gtInterface.getMethodDefinitions();
-        assertNotNull("gtInterfaceMethods is null", gtInterfaceMethods);
-        MethodSignature getIfcKeyMethod = null;
-        for (final MethodSignature method : gtInterfaceMethods) {
-            if (method.getName().equals("getInterfaceKey")) {
-                getIfcKeyMethod = method;
-                break;
-            }
-        }
-        assertNotNull("getIfcKeyMethod is null", getIfcKeyMethod);
-        assertNotNull("getIfcKeyMethod.getReturnType() is null", getIfcKeyMethod.getReturnType());
-        assertFalse("getIfcKeyMethod.getReturnType() should not be Void",
-                getIfcKeyMethod.getReturnType().equals("java.lang.Void"));
-        assertTrue("getIfcKeyMethod.getReturnType().getName() must be InterfaceKey",
-                getIfcKeyMethod.getReturnType().getName().equals("InterfaceKey"));
-
-        MethodSignature getHigherLayerIfMethod = null;
-        for (final MethodSignature method : gtInterfaceMethods) {
-            if (method.getName().equals("getHigherLayerIf")) {
-                getHigherLayerIfMethod = method;
-                break;
-            }
-        }
-        assertNotNull("getHigherLayerIfMethod is null", getHigherLayerIfMethod);
-        assertNotNull("getHigherLayerIfMethod.getReturnType() is null",
-                getHigherLayerIfMethod.getReturnType());
-        assertFalse("getHigherLayerIfMethod.getReturnType() should not be Void",
-                getHigherLayerIfMethod.getReturnType().equals("java.lang.Void"));
-        assertTrue("getHigherLayerIfMethod.getReturnType().getName() must be List",
-                getHigherLayerIfMethod.getReturnType().getName().equals("List"));
-
-        // 'InterfaceKey'
-        assertNotNull("gtInterfaceKey is null", gtInterfaceKey);
-        final List<GeneratedProperty> properties = gtInterfaceKey.getProperties();
-        assertNotNull("properties is null", properties);
-        GeneratedProperty gtInterfaceId = null;
-        for (final GeneratedProperty property : properties) {
-            if (property.getName().equals("InterfaceId")) {
-                gtInterfaceId = property;
-                break;
-            }
-        }
-        assertNotNull("gtInterfaceId is null", gtInterfaceId);
-        assertNotNull("gtInterfaceId.getReturnType() is null", gtInterfaceId.getReturnType());
-        assertFalse("gtInterfaceId.getReturnType() should not be Void",
-                gtInterfaceId.getReturnType().equals("java.lang.Void"));
-        assertTrue("gtInterfaceId.getReturnType().getName() must be String",
-                gtInterfaceId.getReturnType().getName().equals("String"));
-
-        // 'Tunnel'
-        assertNotNull("gtTunnel is null", gtTunnel);
-        final List<MethodSignature> tunnelMethods = gtTunnel.getMethodDefinitions();
-        assertNotNull("tunnelMethods is null", tunnelMethods);
-        MethodSignature getTunnelKeyMethod = null;
-        for (MethodSignature method : tunnelMethods) {
-            if (method.getName().equals("getTunnelKey")) {
-                getTunnelKeyMethod = method;
-                break;
-            }
-        }
-        assertNotNull("getTunnelKeyMethod is null", getTunnelKeyMethod);
-        assertNotNull("getTunnelKeyMethod.getReturnType()",
-                getTunnelKeyMethod.getReturnType());
-        assertFalse("getTunnelKeyMethod.getReturnType() should not be Void",
-                getTunnelKeyMethod.getReturnType().equals("java.lang.Void"));
-        assertTrue("getTunnelKeyMethod.getReturnType().getName() must be TunnelKey",
-                getTunnelKeyMethod.getReturnType().getName().equals("TunnelKey"));
-
-        // 'TunnelKey'
-        assertNotNull("gtTunnelKey is null", gtTunnelKey);
-        final List<GeneratedProperty> tunnelKeyProperties = gtTunnelKey.getProperties();
-        assertNotNull("tunnelKeyProperties is null", tunnelKeyProperties);
-
-        GeneratedProperty gtTunnelId = null;
-        for (final GeneratedProperty property : tunnelKeyProperties) {
-            if (property.getName().equals("TunnelId")) {
-                gtTunnelId = property;
-            }
-        }
-        assertNotNull("gtTunnelId is null", gtTunnelId);
-        assertNotNull("gtTunnelId.getReturnType() is null",
-                gtTunnelId.getReturnType());
-        assertFalse("gtTunnelId.getReturnType() should not be Void",
-                gtTunnelId.getReturnType().equals("java.lang.Void"));
-        assertTrue("gtTunnelId.getReturnType().getName() must be Integer",
-                gtTunnelId.getReturnType().getName().equals("Integer"));
-
-        // 'NetworkLink2'
-        assertNotNull("gtNetworkLink2 is null", gtNetworkLink2);
-
-        final List<MethodSignature> networkLink2Methods = gtNetworkLink2.getMethodDefinitions();
-        assertNotNull("networkLink2Methods is null", networkLink2Methods);
-
-//        FIXME: in some cases getIfcMethod is null which causes test fail. fix ASAP
-//      MethodSignature getIfcMethod = null;
-//      for (MethodSignature method : networkLink2Methods) {
-//          if (method.getName().equals("getInterface")) {
-//              getIfcMethod = method;
-//              break;
-//          }
-//      }
-//
-//      assertNotNull("getIfcMethod is null", getIfcMethod);
-//      assertNotNull("getIfcMethod.getReturnType() is null", getIfcMethod.getReturnType());
-//      assertFalse("getIfcMethod.getReturnType() should not be Void", getIfcMethod.getReturnType().equals("java.lang.Void"));
-//      assertTrue("getIfcMethod.getReturnType().getName() must be String", getIfcMethod.getReturnType().getName().equals("String"));
-    }
-
-    @Test
-    public void augmentedNetworkLinkTest() {
-
-    }
-
-    @Test
-    public void augmentedTopologyTunnelsTest() {
-
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BaseTypeProvider.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BaseTypeProvider.java
deleted file mode 100644 (file)
index 1ea5d16..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.opendaylight.controller.binding.generator.util.Types;
-import org.opendaylight.controller.sal.binding.generator.spi.TypeProvider;
-import org.opendaylight.controller.sal.binding.model.api.ConcreteType;
-import org.opendaylight.controller.sal.binding.model.api.ParameterizedType;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.controller.sal.binding.yang.types.BaseYangTypes;
-
-public class BaseTypeProvider {
-
-    @Test
-    public void test() {
-        TypeProvider provider = BaseYangTypes.BASE_YANG_TYPES_PROVIDER;
-
-        Type stringType = provider.javaTypeForYangType("string");
-        assertEquals("java.lang", stringType.getPackageName());
-        assertEquals("String", stringType.getName());
-        assertTrue(stringType instanceof ConcreteType);
-        ParameterizedType stringBooleanMap = Types.mapTypeFor(
-                provider.javaTypeForYangType("string"),
-                provider.javaTypeForYangType("boolean"));
-        assertTrue(!(stringBooleanMap instanceof ConcreteType));
-        assertEquals("java.util", stringBooleanMap.getPackageName());
-        assertEquals("Map", stringBooleanMap.getName());
-        assertEquals(2, stringBooleanMap.getActualTypeArguments().length);
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BinaryTypeTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BinaryTypeTest.java
deleted file mode 100644 (file)
index e8093e3..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0 which accompanies this distribution,
-* and is available at http://www.eclipse.org/legal/epl-v10.html
-*/
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class BinaryTypeTest {
-    private final static List<File> yangModels = new ArrayList<>();
-    private final static String yangModelsFolder = AugmentedTypeTest.class
-            .getResource("/binary-type-test-models").getPath();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File augFolder = new File(yangModelsFolder);
-        for (final File fileEntry : augFolder.listFiles()) {
-            if (fileEntry.isFile()) {
-                yangModels.add(fileEntry);
-            }
-        }
-    }
-
-    @Test
-    public void binaryTypeTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(yangModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull("context is null", context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull("genTypes is null", genTypes);
-        assertFalse("genTypes is empty", genTypes.isEmpty());
-
-        //TODO: implement test
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BitAndUnionTOEnclosingTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BitAndUnionTOEnclosingTest.java
deleted file mode 100644 (file)
index 1f35b70..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class BitAndUnionTOEnclosingTest {
-
-    private final static List<File> testModels = new ArrayList<File>();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File listModelFile = new File(ExtendedTypedefTest.class.getResource("/bit_and_union_in_leaf.yang")
-                .getPath());
-        testModels.add(listModelFile);
-    }
-
-    @Test
-    public void bitAndUnionEnclosingTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        GeneratedType parentContainer = null;
-
-        for (Type type : genTypes) {
-            if ((type instanceof GeneratedType) && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genTO = (GeneratedType) type;
-                if (genTO.getName().equals("ParentContainer")) {
-                    parentContainer = genTO;
-                    break;
-                }
-            }
-        }
-
-        assertNotNull("Parent container object wasn't found.", parentContainer);
-
-        GeneratedTransferObject bitLeaf = null;
-        GeneratedTransferObject unionLeaf = null;
-        List<GeneratedType> enclosedTypes = parentContainer.getEnclosedTypes();
-        for (GeneratedType genType : enclosedTypes) {
-            if (genType instanceof GeneratedTransferObject) {
-                if (genType.getName().equals("BitLeaf")) {
-                    bitLeaf = (GeneratedTransferObject) genType;
-                } else if (genType.getName().equals("UnionLeaf")) {
-                    unionLeaf = (GeneratedTransferObject) genType;
-                }
-            }
-        }
-
-        assertNotNull("BitLeaf TO builder wasn't found.", bitLeaf);
-        assertNotNull("UnionLeaf TO builder wasn't found.", unionLeaf);
-
-        assertEquals("BitLeaf has incorrect package name.",
-                "org.opendaylight.yang.gen.v1.urn.bit.union.in.leaf.rev2013626.ParentContainer",
-                bitLeaf.getPackageName());
-        assertEquals("UnionLeaf has incorrect package name.",
-                "org.opendaylight.yang.gen.v1.urn.bit.union.in.leaf.rev2013626.ParentContainer",
-                bitLeaf.getPackageName());
-
-        List<GeneratedProperty> propertiesBitLeaf = bitLeaf.getProperties();
-        GeneratedProperty firstBitProperty = null;
-        GeneratedProperty secondBitProperty = null;
-        GeneratedProperty thirdBitProperty = null;
-        for (GeneratedProperty genProperty : propertiesBitLeaf) {
-            if (genProperty.getName().equals("firstBit")) {
-                firstBitProperty = genProperty;
-            } else if (genProperty.getName().equals("secondBit")) {
-                secondBitProperty = genProperty;
-            } else if (genProperty.getName().equals("thirdBit")) {
-                thirdBitProperty = genProperty;
-            }
-        }
-
-        assertNotNull("firstBit property wasn't found", firstBitProperty);
-        assertNotNull("secondBit property wasn't found", secondBitProperty);
-        assertNotNull("thirdBit property wasn't found", thirdBitProperty);
-
-        assertEquals("firstBit property has incorrect type", "Boolean", firstBitProperty.getReturnType().getName());
-        assertEquals("secondBit property has incorrect type", "Boolean", secondBitProperty.getReturnType().getName());
-        assertEquals("thirdBit property has incorrect type", "Boolean", thirdBitProperty.getReturnType().getName());
-
-        GeneratedProperty uint32Property = null;
-        GeneratedProperty stringProperty = null;
-        GeneratedProperty uint8Property = null;
-        List<GeneratedProperty> propertiesUnionLeaf = unionLeaf.getProperties();
-        for (GeneratedProperty genProperty : propertiesUnionLeaf) {
-            if (genProperty.getName().equals("int32")) {
-                uint32Property = genProperty;
-            } else if (genProperty.getName().equals("string")) {
-                stringProperty = genProperty;
-            } else if (genProperty.getName().equals("uint8")) {
-                uint8Property = genProperty;
-            }
-        }
-
-        assertNotNull("uint32 property wasn't found", uint32Property);
-        assertNotNull("string property wasn't found", stringProperty);
-        assertNotNull("uint8 property wasn't found", uint8Property);
-
-        assertEquals("uint32 property has incorrect type", "Integer", uint32Property.getReturnType().getName());
-        assertEquals("string property has incorrect type", "String", stringProperty.getReturnType().getName());
-        assertEquals("uint8 property has incorrect type", "Short", uint8Property.getReturnType().getName());
-
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ChoiceCaseGenTypesTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ChoiceCaseGenTypesTest.java
deleted file mode 100644 (file)
index e283c65..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.opendaylight.controller.sal.binding.generator.impl.SupportTestUtil.containsInterface;
-import static org.opendaylight.controller.sal.binding.generator.impl.SupportTestUtil.containsSignatures;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class ChoiceCaseGenTypesTest {
-
-    private final static List<File> yangModels = new ArrayList<>();
-    private final static String yangModelsFolder = AugmentedTypeTest.class.getResource("/choice-case-type-test-models")
-            .getPath();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File augFolder = new File(yangModelsFolder);
-        for (final File fileEntry : augFolder.listFiles()) {
-            if (fileEntry.isFile()) {
-                yangModels.add(fileEntry);
-            }
-        }
-    }
-
-    private static GeneratedType checkGeneratedType(List<Type> genTypes, String genTypeName, String packageName,
-            int occurences) {
-        GeneratedType searchedGenType = null;
-        int searchedGenTypeCounter = 0;
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals(genTypeName) && genType.getPackageName().equals(packageName)) {
-                    searchedGenType = genType;
-                    searchedGenTypeCounter++;
-                }
-            }
-        }
-        assertNotNull("Generated type " + genTypeName + " wasn't found", searchedGenType);
-        assertEquals(genTypeName + " generated type has incorrect number of occurences.", occurences,
-                searchedGenTypeCounter);
-        return searchedGenType;
-
-    }
-
-    private static GeneratedType checkGeneratedType(List<Type> genTypes, String genTypeName, String packageName) {
-        return checkGeneratedType(genTypes, genTypeName, packageName, 1);
-    }
-
-    @Test
-    public void choiceCaseResolvingTypeTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(yangModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull("context is null", context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull("genTypes is null", genTypes);
-        assertFalse("genTypes is empty", genTypes.isEmpty());
-
-        // test for file choice-monitoring
-        String pcgPref = "org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.choice.monitoring.rev201371.netconf.state.datastores.datastore.locks";
-        GeneratedType genType = null;
-
-        checkGeneratedType(genTypes, "LockType", pcgPref); // choice
-
-        genType = checkGeneratedType(genTypes, "GlobalLock", pcgPref + ".lock.type"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getGlobalLock", "GlobalLock"));
-        containsInterface("LockType", genType);
-
-        genType = checkGeneratedType(genTypes, "PartialLock", pcgPref + ".lock.type"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getPartialLock", "List<PartialLock>"));
-        containsInterface("LockType", genType);
-
-        genType = checkGeneratedType(genTypes, "Fingerprint", pcgPref + ".lock.type"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getAlgorithmAndHash", "AlgorithmAndHash"));
-        containsInterface("LockType", genType);
-
-        genType = checkGeneratedType(genTypes, "AlgorithmAndHash", pcgPref + ".lock.type.fingerprint"); // choice
-
-        genType = checkGeneratedType(genTypes, "Md5", pcgPref + ".lock.type.fingerprint.algorithm.and.hash"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getMd5", "TlsFingerprintType"));
-        containsInterface("AlgorithmAndHash", genType);
-
-        genType = checkGeneratedType(genTypes, "Sha1", pcgPref + ".lock.type.fingerprint.algorithm.and.hash"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getSha1", "TlsFingerprintType"));
-        containsInterface("AlgorithmAndHash", genType);
-
-        genType = checkGeneratedType(genTypes, "Sha224", pcgPref + ".lock.type.fingerprint.algorithm.and.hash"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getSha224", "TlsFingerprintType"));
-        containsInterface("AlgorithmAndHash", genType);
-
-        genType = checkGeneratedType(genTypes, "Sha256", pcgPref + ".lock.type.fingerprint.algorithm.and.hash"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getSha256", "TlsFingerprintType"));
-        containsInterface("AlgorithmAndHash", genType);
-
-        genType = checkGeneratedType(genTypes, "Sha384", pcgPref + ".lock.type.fingerprint.algorithm.and.hash"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getSha384", "TlsFingerprintType"));
-        containsInterface("AlgorithmAndHash", genType);
-
-        genType = checkGeneratedType(genTypes, "Sha512", pcgPref + ".lock.type.fingerprint.algorithm.and.hash"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getSha512", "TlsFingerprintType"));
-        containsInterface("AlgorithmAndHash", genType);
-
-        // test for file augment-monitoring
-        // augment
-        // "/nm:netconf-state/nm:datastores/nm:datastore/nm:locks/nm:lock-type"
-        pcgPref = "org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.augment.monitoring.rev201371";
-        genType = null;
-
-        genType = checkGeneratedType(genTypes, "AutonomousLock", pcgPref
-                + ".netconf.state.datastores.datastore.locks.lock.type"); // choice
-        containsSignatures(genType, new MethodSignaturePattern("getAutonomousDef", "AutonomousDef"));
-        containsInterface("LockType", genType);
-
-        genType = checkGeneratedType(genTypes, "AnonymousLock", pcgPref
-                + ".netconf.state.datastores.datastore.locks.lock.type"); // choice
-        containsSignatures(genType, new MethodSignaturePattern("getLockTime", "Long"));
-        containsInterface("LockType", genType);
-
-        genType = checkGeneratedType(genTypes, "LeafAugCase", pcgPref
-                + ".netconf.state.datastores.datastore.locks.lock.type"); // choice
-        containsSignatures(genType, new MethodSignaturePattern("getLeafAugCase", "String"));
-        containsInterface("LockType", genType);
-
-        // augment
-        // "/nm:netconf-state/nm:datastores/nm:datastore/nm:locks/nm:lock-type/nm:partial-lock"
-        // {
-        genType = checkGeneratedType(genTypes, "PartialLock1", pcgPref); // case
-        containsSignatures(genType, new MethodSignaturePattern("getAugCaseByChoice", "AugCaseByChoice"));
-        containsInterface("Augmentation<PartialLock>", genType);
-
-        genType = checkGeneratedType(genTypes, "AugCaseByChoice", pcgPref
-                + ".netconf.state.datastores.datastore.locks.lock.type.partial.lock"); // choice
-
-        genType = checkGeneratedType(genTypes, "Foo", pcgPref
-                + ".netconf.state.datastores.datastore.locks.lock.type.partial.lock.aug._case.by.choice"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getFoo", "String"));
-        containsInterface("AugCaseByChoice", genType);
-
-        genType = checkGeneratedType(genTypes, "Bar", pcgPref
-                + ".netconf.state.datastores.datastore.locks.lock.type.partial.lock.aug._case.by.choice"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getBar", "Boolean"));
-        containsInterface("AugCaseByChoice", genType);
-
-        // augment "/nm:netconf-state/nm:datastores/nm:datastore" {
-        genType = checkGeneratedType(genTypes, "Datastore1", pcgPref);
-        containsSignatures(genType, new MethodSignaturePattern("getStorageFormat", "StorageFormat"));
-        containsInterface("Augmentation<Datastore>", genType);
-
-        genType = checkGeneratedType(genTypes, "StorageFormat", pcgPref + ".netconf.state.datastores.datastore"); // choice
-
-        genType = checkGeneratedType(genTypes, "UnknownFiles", pcgPref
-                + ".netconf.state.datastores.datastore.storage.format"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getFiles", "List<Files>"));
-        containsInterface("StorageFormat", genType);
-
-        genType = checkGeneratedType(genTypes, "Xml", pcgPref + ".netconf.state.datastores.datastore.storage.format"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getXmlDef", "XmlDef"));
-        containsInterface("StorageFormat", genType);
-
-        genType = checkGeneratedType(genTypes, "Yang", pcgPref + ".netconf.state.datastores.datastore.storage.format"); // case
-        containsSignatures(genType, new MethodSignaturePattern("getYangFileName", "String"));
-        containsInterface("StorageFormat", genType);
-
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ControllerTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ControllerTest.java
deleted file mode 100644 (file)
index 8731d7d..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class ControllerTest {
-
-    private final static List<File> controllerModels = new ArrayList<>();
-    private final static String controllerModelsFolderPath = ControllerTest.class
-            .getResource("/controller-models").getPath();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File ctrlFolder = new File(controllerModelsFolderPath);
-
-        for (final File fileEntry : ctrlFolder.listFiles()) {
-            if (fileEntry.isFile()) {
-                controllerModels.add(fileEntry);
-            }
-        }
-    }
-
-    @Test
-    public void controllerAugmentationTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(controllerModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull(genTypes);
-        assertTrue(!genTypes.isEmpty());
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/DefinedTypesProviderTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/DefinedTypesProviderTest.java
deleted file mode 100644 (file)
index 19972c9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-public class DefinedTypesProviderTest {
-
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ExtendedTypedefTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ExtendedTypedefTest.java
deleted file mode 100644 (file)
index f1bcdc5..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.controller.sal.binding.yang.types.BaseYangTypes;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class ExtendedTypedefTest {
-
-    private final static List<File> testModels = new ArrayList<File>();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File listModelFile = new File(ExtendedTypedefTest.class.getResource("/typedef_of_typedef.yang").getPath());
-        testModels.add(listModelFile);
-    }
-
-    @Test
-    public void constantGenerationTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        GeneratedTransferObject simpleTypedef4 = null;
-        GeneratedTransferObject extendedTypedefUnion = null;
-        GeneratedTransferObject unionTypedef = null;
-        for (final Type type : genTypes) {
-            if (type instanceof GeneratedTransferObject) {
-                if (type.getName().equals("SimpleTypedef4")) {
-                    simpleTypedef4 = (GeneratedTransferObject) type;
-                } else if (type.getName().equals("ExtendedTypedefUnion")) {
-                    extendedTypedefUnion = (GeneratedTransferObject) type;
-                } else if (type.getName().equals("UnionTypedef")) {
-                    unionTypedef = (GeneratedTransferObject) type;
-                }
-            }
-        }
-
-        // simple-typedef4
-        assertNotNull("SimpleTypedef4 not found", simpleTypedef4);
-        assertNotNull("ExtendedTypedefUnion not found", extendedTypedefUnion);
-        assertNotNull("UnionTypedef", unionTypedef);
-
-        List<GeneratedProperty> properties = simpleTypedef4.getProperties();
-        assertTrue("SimpleTypedef4 shouldn't have properties.", properties.isEmpty());
-
-        GeneratedTransferObject extendTO = simpleTypedef4.getExtends();
-        assertNotNull("SimpleTypedef4 should have extend.", extendTO);
-        assertEquals("Incorrect extension for SimpleTypedef4.", "SimpleTypedef3", extendTO.getName());
-        properties = extendTO.getProperties();
-        assertTrue("SimpleTypedef3 shouldn't have properties.", properties.isEmpty());
-
-        extendTO = extendTO.getExtends();
-        assertNotNull("SimpleTypedef3 should have extend.", extendTO);
-        assertEquals("Incorrect extension for SimpleTypedef3.", "SimpleTypedef2", extendTO.getName());
-        properties = extendTO.getProperties();
-        assertTrue("SimpleTypedef2 shouldn't have properties.", properties.isEmpty());
-
-        extendTO = extendTO.getExtends();
-        assertNotNull("SimpleTypedef2 should have extend.", extendTO);
-        assertEquals("SimpleTypedef2 should be extended with SimpleTypedef1.", "SimpleTypedef1", extendTO.getName());
-        properties = extendTO.getProperties();
-        assertEquals("Incorrect number of properties in class SimpleTypedef1.", 1, properties.size());
-
-        assertEquals("Incorrect property's name", "simpleTypedef1", properties.get(0).getName());
-        assertEquals("Property's incorrect type", BaseYangTypes.UINT8_TYPE, properties.get(0).getReturnType());
-
-        extendTO = extendTO.getExtends();
-        assertNull("SimpleTypedef1 shouldn't have extend.", extendTO);
-
-        // extended-typedef-union
-        assertNotNull("ExtendedTypedefUnion object not found", extendedTypedefUnion);
-        properties = extendedTypedefUnion.getProperties();
-        assertTrue("ExtendedTypedefUnion shouldn't have any property", properties.isEmpty());
-
-        extendTO = extendedTypedefUnion.getExtends();
-        assertEquals("Incorrect extension fo ExtendedTypedefUnion.", "UnionTypedef", extendTO.getName());
-        assertNull("UnionTypedef shouldn't be extended", extendTO.getExtends());
-        assertEquals("Incorrect number of properties for UnionTypedef.", 4, extendTO.getProperties().size());
-
-        GeneratedProperty simpleTypedef4Property = null;
-        GeneratedProperty simpleTypedef1Property = null;
-        GeneratedProperty byteTypeProperty = null;
-        GeneratedProperty typedefEnumFruitProperty = null;
-        for (GeneratedProperty genProperty : extendTO.getProperties()) {
-            if (genProperty.getName().equals("simpleTypedef1")) {
-                simpleTypedef1Property = genProperty;
-            } else if (genProperty.getName().equals("simpleTypedef4")) {
-                simpleTypedef4Property = genProperty;
-            } else if (genProperty.getName().equals("byteType")) {
-                byteTypeProperty = genProperty;
-            } else if (genProperty.getName().equals("typedefEnumFruit")) {
-                typedefEnumFruitProperty = genProperty;
-            }
-        }
-
-        assertNotNull("simpleTypedef4 property not found in UnionTypedef", simpleTypedef4Property);
-        assertNotNull("simpleTypedef1 property not found in UnionTypedef", simpleTypedef1Property);
-        assertNotNull("byteType property not found in UnionTypedef", byteTypeProperty);
-        assertNotNull("typedefEnumFruit property not found in UnionTypedef", typedefEnumFruitProperty);
-
-        assertEquals("Incorrect type for property simpleTypedef4.", "SimpleTypedef4", simpleTypedef4Property
-                .getReturnType().getName());
-        assertEquals("Incorrect type for property simpleTypedef1.", "SimpleTypedef1", simpleTypedef1Property
-                .getReturnType().getName());
-        assertEquals("Incorrect type for property byteType.", "ByteType", byteTypeProperty
-                .getReturnType().getName());
-        assertEquals("Incorrect type for property typedefEnumFruit.", "TypedefEnumFruit", typedefEnumFruitProperty
-                .getReturnType().getName());
-    }
-
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenEnumResolvingTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenEnumResolvingTest.java
deleted file mode 100644 (file)
index 42b68c5..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.Test;
-import org.opendaylight.controller.binding.generator.util.ReferencedTypeImpl;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.Enumeration;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class GenEnumResolvingTest {
-
-    private SchemaContext resolveSchemaContextFromFiles(
-            final String... yangFiles) {
-        final YangModelParser parser = new YangParserImpl();
-
-        final List<File> inputFiles = new ArrayList<File>();
-        for (int i = 0; i < yangFiles.length; ++i) {
-            inputFiles.add(new File(yangFiles[i]));
-        }
-
-        final Set<Module> modules = parser.parseYangModels(inputFiles);
-        return parser.resolveSchemaContext(modules);
-    }
-
-    @Test
-    public void testLeafEnumResolving() {
-        final String ietfInterfacesPath = getClass().getResource(
-                "/enum-test-models/ietf-interfaces@2012-11-15.yang").getPath();
-        final String ifTypePath = getClass().getResource(
-                "/enum-test-models/iana-if-type@2012-06-05.yang").getPath();
-        final String yangTypesPath = getClass().getResource(
-                "/enum-test-models/ietf-yang-types@2010-09-24.yang").getPath();
-
-        final SchemaContext context = resolveSchemaContextFromFiles(
-                ietfInterfacesPath, ifTypePath, yangTypesPath);
-        assertTrue(context != null);
-
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-        assertTrue(genTypes != null);
-
-        assertEquals("Expected count of all Generated Types from yang models " +
-                "is 22", 25, genTypes.size());
-
-        GeneratedType genInterface = null;
-        for (final Type type : genTypes) {
-            if (type instanceof GeneratedType) {
-                if (type.getName().equals("Interface")) {
-                    genInterface = (GeneratedType) type;
-                }
-            }
-        }
-        assertNotNull("Generated Type Interface is not present in list of " +
-                "Generated Types", genInterface);
-
-        Enumeration linkUpDownTrapEnable = null;
-        Enumeration operStatus = null;
-        final List<Enumeration> enums = genInterface.getEnumerations();
-        assertNotNull("Generated Type Interface cannot contain NULL reference" +
-                " to Enumeration types!", enums);
-        assertEquals("Generated Type Interface MUST contain 2 Enumeration " +
-                "Types", 2, enums.size());
-        for (final Enumeration e : enums) {
-            if (e.getName().equals("LinkUpDownTrapEnable")) {
-                linkUpDownTrapEnable = e;
-            } else if (e.getName().equals("OperStatus")) {
-                operStatus = e;
-            }
-        }
-
-        assertNotNull("Expected Enum LinkUpDownTrapEnable, but was NULL!",
-                linkUpDownTrapEnable);
-        assertNotNull("Expected Enum OperStatus, but was NULL!", operStatus);
-
-        assertNotNull("Enum LinkUpDownTrapEnable MUST contain Values definition " +
-                "not NULL reference!", linkUpDownTrapEnable.getValues());
-        assertNotNull("Enum OperStatus MUST contain Values definition not " +
-                "NULL reference!", operStatus.getValues());
-        assertEquals("Enum LinkUpDownTrapEnable MUST contain 2 values!", 2,
-                linkUpDownTrapEnable.getValues().size());
-        assertEquals("Enum OperStatus MUST contain 7 values!", 7,
-                operStatus.getValues().size());
-
-        final List<MethodSignature> methods = genInterface
-                .getMethodDefinitions();
-
-        assertNotNull("Generated Interface cannot contain NULL reference for " +
-                "Method Signature Definitions!", methods);
-
-        assertEquals("Expected count of method signature definitions is 14",
-                14, methods.size());
-        Enumeration ianaIfType = null;
-        for (final MethodSignature method : methods) {
-            if (method.getName().equals("getType")) {
-                if (method.getReturnType() instanceof Enumeration) {
-                    ianaIfType = (Enumeration)method.getReturnType();
-                }
-            }
-        }
-
-        assertNotNull("Method getType MUST return Enumeration Type, " +
-                "not NULL reference!", ianaIfType);
-        assertEquals("Enumeration getType MUST contain 272 values!", 272,
-                ianaIfType.getValues().size());
-    }
-
-    @Test
-    public void testTypedefEnumResolving() {
-        final String ianaIfTypePath = getClass().getResource(
-                "/leafref-test-models/iana-if-type@2012-06-05.yang").getPath();
-
-        final SchemaContext context = resolveSchemaContextFromFiles(ianaIfTypePath);
-        assertTrue(context != null);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-        assertTrue(genTypes != null);
-        assertEquals(3, genTypes.size());
-
-        final Type type = genTypes.get(1);
-        assertTrue(type instanceof Enumeration);
-
-        final Enumeration enumer = (Enumeration) type;
-        assertEquals("Enumeration type MUST contain 272 values!", 272,
-                enumer.getValues().size());
-    }
-
-    @Test
-    public void testLeafrefEnumResolving() {
-        final String ietfInterfacesPath = getClass().getResource(
-                "/enum-test-models/ietf-interfaces@2012-11-15.yang").getPath();
-        final String ifTypePath = getClass().getResource(
-                "/enum-test-models/iana-if-type@2012-06-05.yang").getPath();
-        final String yangTypesPath = getClass().getResource(
-                "/enum-test-models/ietf-yang-types@2010-09-24.yang").getPath();
-        final String topologyPath = getClass().getResource(
-                "/enum-test-models/abstract-topology@2013-02-08.yang")
-                .getPath();
-        final String inetTypesPath = getClass().getResource(
-                "/enum-test-models/ietf-inet-types@2010-09-24.yang")
-                .getPath();
-        final SchemaContext context = resolveSchemaContextFromFiles(
-                ietfInterfacesPath, ifTypePath, yangTypesPath, topologyPath,
-                inetTypesPath);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-        assertNotNull(genTypes);
-        assertTrue(!genTypes.isEmpty());
-
-        GeneratedType genInterface = null;
-        for (final Type type : genTypes) {
-            if (type instanceof GeneratedType) {
-                if (type.getPackageName().equals("org.opendaylight.yang.gen.v1.urn.model._abstract.topology.rev201328.topology.interfaces")
-                        && type.getName().equals("Interface")) {
-                    genInterface = (GeneratedType) type;
-                }
-            }
-        }
-        assertNotNull("Generated Type Interface is not present in list of " +
-                "Generated Types", genInterface);
-
-        Type linkUpDownTrapEnable = null;
-        Type operStatus = null;
-        final List<MethodSignature> methods = genInterface.getMethodDefinitions();
-        assertNotNull("Generated Type Interface cannot contain NULL reference" +
-                " to Enumeration types!", methods);
-        assertEquals("Generated Type Interface MUST contain 4 Methods ",
-                4, methods.size());
-        for (final MethodSignature method : methods) {
-            if (method.getName().equals("getLinkUpDownTrapEnable")) {
-                linkUpDownTrapEnable = method.getReturnType();
-            } else if (method.getName().equals("getOperStatus")) {
-                operStatus = method.getReturnType();
-            }
-        }
-
-        assertNotNull("Expected Referenced Enum LinkUpDownTrapEnable, but was NULL!",
-                linkUpDownTrapEnable);
-        assertTrue("Expected LinkUpDownTrapEnable of type ReferencedTypeImpl",
-                linkUpDownTrapEnable instanceof ReferencedTypeImpl);
-        assertEquals(linkUpDownTrapEnable.getPackageName(),
-                "org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev20121115.interfaces.Interface");
-
-        assertNotNull("Expected Referenced Enum OperStatus, but was NULL!",
-                operStatus);
-        assertTrue("Expected OperStatus of type ReferencedTypeImpl",
-                operStatus instanceof  ReferencedTypeImpl);
-        assertEquals(operStatus.getPackageName(),
-                "org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev20121115.interfaces.Interface");
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenTypesSubSetTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GenTypesSubSetTest.java
deleted file mode 100644 (file)
index 1ac5413..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class GenTypesSubSetTest {
-
-    private final static List<File> yangModels = new ArrayList<>();
-    private final static String yangModelsFolder = AugmentedTypeTest.class
-            .getResource("/leafref-test-models").getPath();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File augFolder = new File(yangModelsFolder);
-
-        for (final File fileEntry : augFolder.listFiles()) {
-            if (fileEntry.isFile()) {
-                yangModels.add(fileEntry);
-            }
-        }
-    }
-
-    @Test
-    public void genTypesFromSubsetOfTwoModulesTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(yangModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        final Set<Module> toGenModules = new HashSet<>();
-        for (final Module module : modules) {
-            if (module.getName().equals("abstract-topology")) {
-                toGenModules.add(module);
-            } else if (module.getName().equals("ietf-interfaces")) {
-                toGenModules.add(module);
-            }
-        }
-
-        assertEquals("Set of to Generate Modules must contain 2 modules", 2,
-                toGenModules.size());
-        assertNotNull("Schema Context is null", context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context, toGenModules);
-        assertNotNull("genTypes is null", genTypes);
-        assertFalse("genTypes is empty", genTypes.isEmpty());
-        assertEquals("Expected Generated Types from provided sub set of " +
-                "modules should be 23!", 25,
-                genTypes.size());
-    }
-
-    @Test
-    public void genTypesFromSubsetOfThreeModulesTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(yangModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        final Set<Module> toGenModules = new HashSet<>();
-        for (final Module module : modules) {
-            if (module.getName().equals("abstract-topology")) {
-                toGenModules.add(module);
-            } else if (module.getName().equals("ietf-interfaces")) {
-                toGenModules.add(module);
-            } else if (module.getName().equals("iana-if-type")) {
-                toGenModules.add(module);
-            }
-        }
-
-        assertEquals("Set of to Generate Modules must contain 3 modules", 3,
-                toGenModules.size());
-
-        assertNotNull("Schema Context is null", context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context, toGenModules);
-        assertNotNull("genTypes is null", genTypes);
-        assertFalse("genTypes is empty", genTypes.isEmpty());
-        assertEquals("Expected Generated Types from provided sub set of "  +
-                "modules should be 25!", 28, genTypes.size());
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesBitsTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesBitsTest.java
deleted file mode 100644 (file)
index 009fc9f..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
-import org.opendaylight.controller.sal.binding.model.api.MethodSignature.Parameter;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class GeneratedTypesBitsTest {
-
-    private SchemaContext resolveSchemaContextFromFiles(final String... yangFiles) {
-        final YangModelParser parser = new YangParserImpl();
-
-        final List<File> inputFiles = new ArrayList<File>();
-        for (int i = 0; i < yangFiles.length; ++i) {
-            inputFiles.add(new File(yangFiles[i]));
-        }
-
-        final Set<Module> modules = parser.parseYangModels(inputFiles);
-        return parser.resolveSchemaContext(modules);
-    }
-
-    @Test
-    public void testGeneretedTypesBitsTest() {
-        final String yangTypesPath = getClass().getResource("/simple-bits-demo.yang").getPath();
-
-        final SchemaContext context = resolveSchemaContextFromFiles(yangTypesPath);
-        assertTrue(context != null);
-
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-        assertTrue(genTypes != null);
-
-        List<MethodSignature> methodSignaturesList = null;
-
-        boolean leafParentFound = false;
-
-        boolean byteTypeFound = false;
-        int classPropertiesNumb = 0;
-        int toStringPropertiesNum = 0;
-        int equalPropertiesNum = 0;
-        int hashPropertiesNum = 0;
-
-        String nameReturnParamType = "";
-        String nameMethodeParamType = "";
-        boolean getByteLeafMethodFound = false;
-        boolean setByteLeafMethodFound = false;
-        int setByteLeafMethodParamNum = 0;
-
-        for (final Type type : genTypes) {
-            if (type instanceof GeneratedTransferObject) { // searching for
-                                                           // ByteType
-                final GeneratedTransferObject genTO = (GeneratedTransferObject) type;
-                if (genTO.getName().equals("ByteType")) {
-                    byteTypeFound = true;
-                    List<GeneratedProperty> genProperties = genTO.getProperties();
-                    classPropertiesNumb = genProperties.size();
-
-                    genProperties = null;
-                    genProperties = genTO.getToStringIdentifiers();
-                    toStringPropertiesNum = genProperties.size();
-
-                    genProperties = null;
-                    genProperties = genTO.getEqualsIdentifiers();
-                    equalPropertiesNum = genProperties.size();
-
-                    genProperties = null;
-                    genProperties = genTO.getHashCodeIdentifiers();
-                    hashPropertiesNum = genProperties.size();
-
-                }
-            } else if (type instanceof GeneratedType) { // searching for
-                                                        // interface
-                                                        // LeafParameterContainer
-                final GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("LeafParentContainer")) {
-                    leafParentFound = true;
-                    // check of methods
-                    methodSignaturesList = genType.getMethodDefinitions();
-                    if (methodSignaturesList != null) {
-                        for (MethodSignature methodSignature : methodSignaturesList) { // loop
-                                                                                       // through
-                                                                                       // all
-                                                                                       // methods
-                            if (methodSignature.getName().equals("getByteLeaf")) {
-                                getByteLeafMethodFound = true;
-
-                                nameReturnParamType = methodSignature.getReturnType().getName();
-                            } else if (methodSignature.getName().equals("setByteLeaf")) {
-                                setByteLeafMethodFound = true;
-
-                                List<Parameter> parameters = methodSignature.getParameters();
-                                setByteLeafMethodParamNum = parameters.size();
-                                for (Parameter parameter : parameters) {
-                                    nameMethodeParamType = parameter.getType().getName();
-                                }
-
-                            }
-
-                        }
-                    }
-                }
-            }
-
-        }
-
-        assertTrue(byteTypeFound);
-
-        assertEquals(classPropertiesNumb,8);
-
-        assertEquals(toStringPropertiesNum,8);
-        assertEquals(equalPropertiesNum,8);
-        assertEquals(hashPropertiesNum,8);
-        assertTrue(leafParentFound);
-
-        assertNotNull(methodSignaturesList);
-
-        assertTrue(getByteLeafMethodFound);
-        assertEquals(nameReturnParamType,"ByteType");
-
-        assertFalse(setByteLeafMethodFound);
-        assertEquals(0, setByteLeafMethodParamNum);
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesStringTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesStringTest.java
deleted file mode 100644 (file)
index 361fd56..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.Constant;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.ParameterizedType;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class GeneratedTypesStringTest {
-
-    private final static List<File> testModels = new ArrayList<File>();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File listModelFile = new File(GeneratedTypesStringTest.class.getResource("/simple-string-demo.yang")
-                .getPath());
-        testModels.add(listModelFile);
-    }
-
-    @Test
-    public void constantGenerationTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        boolean typedefStringFound = false;
-        boolean constantRegExListFound = false;
-        boolean constantRegExListTypeGeneric = false;
-        boolean constantRegExListTypeContainer = false;
-        boolean noStringInReqExListFound = false;
-        boolean constantRegExListValueOK = false;
-        boolean constantRegExListTypeOneGeneric = false;
-        for (final Type type : genTypes) {
-            if (type instanceof GeneratedTransferObject) {
-                final GeneratedTransferObject genTO = (GeneratedTransferObject) type;
-
-                if (genTO.getName().equals("TypedefString")) {
-                    typedefStringFound = true;
-
-                    List<Constant> constants = genTO.getConstantDefinitions();
-                    for (Constant con : constants) {
-                        if (con.getName().equals("PATTERN_CONSTANTS")) {
-                            constantRegExListFound = true;
-                        } else
-                            break;
-                        ParameterizedType pType;
-                        if (con.getType() instanceof ParameterizedType) {
-                            pType = (ParameterizedType) con.getType();
-                        } else
-                            break;
-
-                        Type[] types;
-                        if (pType.getName().equals("List")) {
-                            constantRegExListTypeContainer = true;
-                            types = pType.getActualTypeArguments();
-                        } else
-                            break;
-
-                        if (types.length == 1) {
-                            constantRegExListTypeOneGeneric = true;
-                        } else
-                            break;
-
-                        if (types[0].getName().equals("String")) {
-                            constantRegExListTypeGeneric = true;
-                        } else
-                            break;
-
-                        if (con.getValue() instanceof List) {
-                            constantRegExListValueOK = true;
-                        } else
-                            break;
-
-                        for (Object obj : (List<?>) con.getValue()) {
-                            if (!(obj instanceof String)) {
-                                noStringInReqExListFound = true;
-                                break;
-                            }
-                        }
-
-                    }
-                }
-            }
-
-        }
-
-        assertTrue("Typedef >>TypedefString<< wasn't found", typedefStringFound);
-        assertTrue("Constant PATTERN_CONSTANTS is missing in TO", constantRegExListFound);
-        assertTrue("Constant PATTERN_CONSTANTS doesn't have correct container type", constantRegExListTypeContainer);
-        assertTrue("Constant PATTERN_CONSTANTS has more than one generic type", constantRegExListTypeOneGeneric);
-        assertTrue("Constant PATTERN_CONSTANTS doesn't have correct generic type", constantRegExListTypeGeneric);
-        assertTrue("Constant PATTERN_CONSTANTS doesn't contain List object", constantRegExListValueOK);
-        assertTrue("In list found other type than String", !noStringInReqExListFound);
-
-    }
-
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/GeneratedTypesTest.java
deleted file mode 100644 (file)
index 88c4ae1..0000000
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class GeneratedTypesTest {
-
-    private SchemaContext resolveSchemaContextFromFiles(final String... yangFiles) {
-        final YangModelParser parser = new YangParserImpl();
-
-        final List<File> inputFiles = new ArrayList<File>();
-        for (int i = 0; i < yangFiles.length; ++i) {
-            inputFiles.add(new File(yangFiles[i]));
-        }
-
-        final Set<Module> modules = parser.parseYangModels(inputFiles);
-        return parser.resolveSchemaContext(modules);
-    }
-
-    @Test
-    public void testMultipleModulesResolving() {
-        final String topologyPath = getClass().getResource("/abstract-topology.yang").getPath();
-        final String typesPath = getClass().getResource("/ietf-inet-types@2010-09-24.yang").getPath();
-        final SchemaContext context = resolveSchemaContextFromFiles(topologyPath, typesPath);
-        assertNotNull(context);
-
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull(genTypes);
-        assertEquals(29, genTypes.size());
-    }
-
-    @Test
-    public void testLeafrefResolving() {
-        final String topologyPath = getClass().getResource("/leafref-test-models/abstract-topology@2013-02-08.yang")
-                .getPath();
-        final String interfacesPath = getClass().getResource("/leafref-test-models/ietf-interfaces@2012-11-15.yang")
-                .getPath();
-        // final String ifTypePath = getClass().getResource(
-        // "/leafref-test-models/iana-if-type@2012-06-05.yang").getPath();
-        final String inetTypesPath = getClass().getResource("/leafref-test-models/ietf-inet-types@2010-09-24.yang")
-                .getPath();
-        final String yangTypesPath = getClass().getResource("/leafref-test-models/ietf-yang-types@2010-09-24.yang")
-                .getPath();
-
-        assertNotNull(topologyPath);
-        assertNotNull(interfacesPath);
-        // assertTrue(ifTypePath != null);
-        assertNotNull(inetTypesPath);
-        assertNotNull(yangTypesPath);
-
-        // final SchemaContext context = resolveSchemaContextFromFiles(topologyPath, interfacesPath, ifTypePath,
-        // inetTypesPath, yangTypesPath);
-        final SchemaContext context = resolveSchemaContextFromFiles(topologyPath, interfacesPath, inetTypesPath,
-                yangTypesPath);
-        assertNotNull(context);
-        assertEquals(4, context.getModules().size());
-
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertEquals(57, genTypes.size());
-        assertNotNull(genTypes);
-
-        GeneratedTransferObject gtIfcKey = null;
-        GeneratedType gtIfc = null;
-        GeneratedType gtNetworkLink = null;
-        GeneratedType gtSource = null;
-        GeneratedType gtDest = null;
-        GeneratedType gtTunnel = null;
-        GeneratedTransferObject gtTunnelKey = null;
-        GeneratedType gtTopology = null;
-        for (final Type type : genTypes) {
-            String name = type.getName();
-            if ("InterfaceKey".equals(name)) {
-                gtIfcKey = (GeneratedTransferObject) type;
-            } else if ("Interface".equals(name)) {
-                gtIfc = (GeneratedType) type;
-            } else if ("NetworkLink".equals(name)) {
-                gtNetworkLink = (GeneratedType) type;
-            } else if ("SourceNode".equals(name)) {
-                gtSource = (GeneratedType) type;
-            } else if ("DestinationNode".equals(name)) {
-                gtDest = (GeneratedType) type;
-            } else if ("Tunnel".equals(name)) {
-                gtTunnel = (GeneratedType) type;
-            } else if ("TunnelKey".equals(name)) {
-                gtTunnelKey = (GeneratedTransferObject) type;
-            } else if ("Topology".equals(name)) {
-                gtTopology = (GeneratedType) type;
-            }
-        }
-
-        assertNotNull(gtIfcKey);
-        assertNotNull(gtIfc);
-        assertNotNull(gtNetworkLink);
-        assertNotNull(gtSource);
-        assertNotNull(gtDest);
-        assertNotNull(gtTunnel);
-        assertNotNull(gtTunnelKey);
-        assertNotNull(gtTopology);
-
-        // Topology
-        final List<MethodSignature> gtTopoMethods = gtTopology.getMethodDefinitions();
-        assertNotNull(gtTopoMethods);
-        MethodSignature condLeafref = null;
-        for (final MethodSignature method : gtTopoMethods) {
-            if (method.getName().equals("getCondLeafref")) {
-                condLeafref = method;
-            }
-        }
-        assertNotNull(condLeafref);
-        Type condLeafRT = condLeafref.getReturnType();
-        assertNotNull(condLeafRT);
-        assertEquals("java.lang.Object", condLeafRT.getFullyQualifiedName());
-
-        // InterfaceId
-        final List<GeneratedProperty> gtIfcKeyProps = gtIfcKey.getProperties();
-        assertNotNull(gtIfcKeyProps);
-        GeneratedProperty ifcIdProp = null;
-        for (final GeneratedProperty property : gtIfcKeyProps) {
-            if (property.getName().equals("InterfaceId")) {
-                ifcIdProp = property;
-            }
-        }
-        assertNotNull(ifcIdProp);
-        Type ifcIdPropType = ifcIdProp.getReturnType();
-        assertNotNull(ifcIdPropType);
-        assertEquals("java.lang.String", ifcIdPropType.getFullyQualifiedName());
-
-        // Interface
-        final List<MethodSignature> gtIfcMethods = gtIfc.getMethodDefinitions();
-        assertNotNull(gtIfcMethods);
-        MethodSignature getIfcKey = null;
-        MethodSignature getHigherLayerIf = null;
-        for (final MethodSignature method : gtIfcMethods) {
-            if (method.getName().equals("getInterfaceKey")) {
-                getIfcKey = method;
-            } else if (method.getName().equals("getHigherLayerIf")) {
-                getHigherLayerIf = method;
-            }
-        }
-        assertNotNull(getIfcKey);
-        Type getIfcKeyType = getIfcKey.getReturnType();
-        assertNotNull(getIfcKeyType);
-        assertNotSame("java.lang.Void", getIfcKeyType);
-        assertEquals("InterfaceKey", getIfcKeyType.getName());
-
-        assertNotNull(getHigherLayerIf);
-        Type getHigherLayerIfType = getHigherLayerIf.getReturnType();
-        assertNotNull(getHigherLayerIfType);
-        assertNotSame("java.lang.Void", getHigherLayerIfType);
-        assertEquals("List", getHigherLayerIfType.getName());
-
-        // NetworkLink
-        final List<MethodSignature> gtNetworkLinkMethods = gtNetworkLink.getMethodDefinitions();
-        assertNotNull(gtNetworkLinkMethods);
-        MethodSignature getIfc = null;
-        for (MethodSignature method : gtNetworkLinkMethods) {
-            if (method.getName().equals("getInterface")) {
-                getIfc = method;
-            }
-        }
-        assertNotNull(getIfc);
-        Type getIfcType = getIfc.getReturnType();
-        assertNotNull(getIfcType);
-        assertNotSame("java.lang.Void", getIfcType);
-        assertEquals("String", getIfcType.getName());
-
-        // SourceNode
-        final List<MethodSignature> gtSourceMethods = gtSource.getMethodDefinitions();
-        assertNotNull(gtSourceMethods);
-        MethodSignature getIdSource = null;
-        for (MethodSignature method : gtSourceMethods) {
-            if (method.getName().equals("getId")) {
-                getIdSource = method;
-            }
-        }
-        assertNotNull(getIdSource);
-        Type getIdType = getIdSource.getReturnType();
-        assertNotNull(getIdType);
-        assertNotSame("java.lang.Void", getIdType);
-        assertEquals("Uri", getIdType.getName());
-
-        // DestinationNode
-        final List<MethodSignature> gtDestMethods = gtDest.getMethodDefinitions();
-        assertNotNull(gtDestMethods);
-        MethodSignature getIdDest = null;
-        for (MethodSignature method : gtDestMethods) {
-            if (method.getName().equals("getId")) {
-                getIdDest = method;
-            }
-        }
-        assertNotNull(getIdDest);
-        Type getIdDestType = getIdDest.getReturnType();
-        assertNotNull(getIdDestType);
-        assertNotSame("java.lang.Void", getIdDestType);
-        assertEquals("Uri", getIdDestType.getName());
-
-        // Tunnel
-        final List<MethodSignature> gtTunnelMethods = gtTunnel.getMethodDefinitions();
-        assertNotNull(gtTunnelMethods);
-        MethodSignature getTunnelKey = null;
-        for (MethodSignature method : gtTunnelMethods) {
-            if (method.getName().equals("getTunnelKey")) {
-                getTunnelKey = method;
-            }
-        }
-        assertNotNull(getTunnelKey);
-        Type getTunnelKeyType = getTunnelKey.getReturnType();
-        assertNotNull(getTunnelKeyType);
-        assertNotSame("java.lang.Void", getTunnelKeyType);
-        assertEquals("TunnelKey", getTunnelKeyType.getName());
-
-        // TunnelKey
-        final List<GeneratedProperty> gtTunnelKeyProps = gtTunnelKey.getProperties();
-        assertNotNull(gtTunnelKeyProps);
-        GeneratedProperty tunnelId = null;
-        for (final GeneratedProperty property : gtTunnelKeyProps) {
-            if (property.getName().equals("TunnelId")) {
-                tunnelId = property;
-            }
-        }
-        assertNotNull(tunnelId);
-        Type tunnelIdType = tunnelId.getReturnType();
-        assertNotNull(tunnelIdType);
-        assertNotSame("java.lang.Void", tunnelIdType);
-        assertEquals("Uri", tunnelIdType.getName());
-    }
-
-    @Test
-    public void testContainerResolving() {
-        final String filePath = getClass().getResource("/simple-container-demo.yang").getPath();
-        final SchemaContext context = resolveSchemaContextFromFiles(filePath);
-        assert (context != null);
-
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull(genTypes);
-        assertEquals(4, genTypes.size());
-
-        final GeneratedType simpleContainer = (GeneratedType) genTypes.get(1);
-        final GeneratedType nestedContainer = (GeneratedType) genTypes.get(2);
-
-        assertEquals("SimpleContainer", simpleContainer.getName());
-        assertEquals("NestedContainer", nestedContainer.getName());
-        assertEquals(3, simpleContainer.getMethodDefinitions().size());
-        assertEquals(2, nestedContainer.getMethodDefinitions().size());
-
-        int getFooMethodCounter = 0;
-        int getBarMethodCounter = 0;
-        int getNestedContainerCounter = 0;
-
-        String getFooMethodReturnTypeName = "";
-        String getBarMethodReturnTypeName = "";
-        String getNestedContainerReturnTypeName = "";
-        for (final MethodSignature method : simpleContainer.getMethodDefinitions()) {
-            if (method.getName().equals("getFoo")) {
-                getFooMethodCounter++;
-                getFooMethodReturnTypeName = method.getReturnType().getName();
-            }
-
-            if (method.getName().equals("getBar")) {
-                getBarMethodCounter++;
-                getBarMethodReturnTypeName = method.getReturnType().getName();
-            }
-
-            if (method.getName().equals("getNestedContainer")) {
-                getNestedContainerCounter++;
-                getNestedContainerReturnTypeName = method.getReturnType().getName();
-            }
-        }
-
-        assertEquals(1, getFooMethodCounter);
-        assertEquals("Integer", getFooMethodReturnTypeName);
-
-        assertEquals(1, getBarMethodCounter);
-        assertEquals("String", getBarMethodReturnTypeName);
-
-        assertEquals(1, getNestedContainerCounter);
-        assertEquals("NestedContainer", getNestedContainerReturnTypeName);
-
-        getFooMethodCounter = 0;
-        getBarMethodCounter = 0;
-
-        getFooMethodReturnTypeName = "";
-        getBarMethodReturnTypeName = "";
-
-        for (final MethodSignature method : nestedContainer.getMethodDefinitions()) {
-
-            if (method.getName().equals("getFoo")) {
-                getFooMethodCounter++;
-                getFooMethodReturnTypeName = method.getReturnType().getName();
-            }
-
-            if (method.getName().equals("getBar")) {
-                getBarMethodCounter++;
-                getBarMethodReturnTypeName = method.getReturnType().getName();
-            }
-        }
-
-        assertEquals(1, getFooMethodCounter);
-        assertEquals("Short", getFooMethodReturnTypeName);
-
-        assertEquals(1, getBarMethodCounter);
-        assertEquals("String", getBarMethodReturnTypeName);
-    }
-
-    @Test
-    public void testLeafListResolving() {
-        final String filePath = getClass().getResource("/simple-leaf-list-demo.yang").getPath();
-        final SchemaContext context = resolveSchemaContextFromFiles(filePath);
-        assertNotNull(context);
-
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull(genTypes);
-        assertEquals(4, genTypes.size());
-
-        final GeneratedType simpleContainer = (GeneratedType) genTypes.get(1);
-        final GeneratedType nestedContainer = (GeneratedType) genTypes.get(2);
-
-        assertEquals("SimpleContainer", simpleContainer.getName());
-        assertEquals("NestedContainer", nestedContainer.getName());
-        assertEquals(3, simpleContainer.getMethodDefinitions().size());
-        assertEquals(2, nestedContainer.getMethodDefinitions().size());
-
-        int getFooMethodCounter = 0;
-        int getBarMethodCounter = 0;
-        int getNestedContainerCounter = 0;
-
-        String getFooMethodReturnTypeName = "";
-        String getBarMethodReturnTypeName = "";
-        String getNestedContainerReturnTypeName = "";
-        for (final MethodSignature method : simpleContainer.getMethodDefinitions()) {
-            if (method.getName().equals("getFoo")) {
-                getFooMethodCounter++;
-                getFooMethodReturnTypeName = method.getReturnType().getName();
-            }
-
-            if (method.getName().equals("getBar")) {
-                getBarMethodCounter++;
-                getBarMethodReturnTypeName = method.getReturnType().getName();
-            }
-
-            if (method.getName().equals("getNestedContainer")) {
-                getNestedContainerCounter++;
-                getNestedContainerReturnTypeName = method.getReturnType().getName();
-            }
-        }
-
-        assertEquals(1, getFooMethodCounter);
-        assertEquals("List", getFooMethodReturnTypeName);
-
-        assertEquals(1, getBarMethodCounter);
-        assertEquals("String", getBarMethodReturnTypeName);
-
-        assertEquals(1, getNestedContainerCounter);
-        assertEquals("NestedContainer", getNestedContainerReturnTypeName);
-
-        getFooMethodCounter = 0;
-        getBarMethodCounter = 0;
-
-        getFooMethodReturnTypeName = "";
-        getBarMethodReturnTypeName = "";
-
-        for (final MethodSignature method : nestedContainer.getMethodDefinitions()) {
-            if (method.getName().equals("getFoo")) {
-                getFooMethodCounter++;
-                getFooMethodReturnTypeName = method.getReturnType().getName();
-            }
-
-            if (method.getName().equals("getBar")) {
-                getBarMethodCounter++;
-                getBarMethodReturnTypeName = method.getReturnType().getName();
-            }
-        }
-
-        assertEquals(1, getFooMethodCounter);
-        assertEquals("Short", getFooMethodReturnTypeName);
-
-        assertEquals(1, getBarMethodCounter);
-        assertEquals("List", getBarMethodReturnTypeName);
-    }
-
-    @Test
-    public void testListResolving() {
-        final String filePath = getClass().getResource("/simple-list-demo.yang").getPath();
-        final SchemaContext context = resolveSchemaContextFromFiles(filePath);
-        assertNotNull(context);
-
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull(genTypes);
-        assertEquals(6, genTypes.size());
-
-        int listParentContainerMethodsCount = 0;
-        int simpleListMethodsCount = 0;
-        int listChildContainerMethodsCount = 0;
-        int listKeyClassCount = 0;
-
-        int getSimpleListKeyMethodCount = 0;
-        int getListChildContainerMethodCount = 0;
-        int getFooMethodCount = 0;
-        int setFooMethodCount = 0;
-        int getSimpleLeafListMethodCount = 0;
-        int setSimpleLeafListMethodCount = 0;
-        int getBarMethodCount = 0;
-
-        String getSimpleListKeyMethodReturnTypeName = "";
-        String getListChildContainerMethodReturnTypeName = "";
-
-        int listKeyClassPropertyCount = 0;
-        String listKeyClassPropertyName = "";
-        String listKeyClassPropertyTypeName = "";
-        boolean listKeyClassPropertyReadOnly = false;
-
-        int hashMethodParameterCount = 0;
-        String hashMethodParameterName = "";
-        String hashMethodParameterReturnTypeName = "";
-
-        int equalMethodParameterCount = 0;
-        String equalMethodParameterName = "";
-        String equalMethodParameterReturnTypeName = "";
-
-        for (final Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                final GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("ListParentContainer")) {
-                    listParentContainerMethodsCount = genType.getMethodDefinitions().size();
-                } else if (genType.getName().equals("SimpleList")) {
-                    simpleListMethodsCount = genType.getMethodDefinitions().size();
-                    final List<MethodSignature> methods = genType.getMethodDefinitions();
-                    for (final MethodSignature method : methods) {
-                        if (method.getName().equals("getSimpleListKey")) {
-                            getSimpleListKeyMethodCount++;
-                            getSimpleListKeyMethodReturnTypeName = method.getReturnType().getName();
-                        } else if (method.getName().equals("getListChildContainer")) {
-                            getListChildContainerMethodCount++;
-                            getListChildContainerMethodReturnTypeName = method.getReturnType().getName();
-                        } else if (method.getName().equals("getFoo")) {
-                            getFooMethodCount++;
-                        } else if (method.getName().equals("setFoo")) {
-                            setFooMethodCount++;
-                        } else if (method.getName().equals("getSimpleLeafList")) {
-                            getSimpleLeafListMethodCount++;
-                        } else if (method.getName().equals("setSimpleLeafList")) {
-                            setSimpleLeafListMethodCount++;
-                        } else if (method.getName().equals("getBar")) {
-                            getBarMethodCount++;
-                        }
-                    }
-                } else if (genType.getName().equals("ListChildContainer")) {
-                    listChildContainerMethodsCount = genType.getMethodDefinitions().size();
-                }
-            } else if (type instanceof GeneratedTransferObject) {
-                final GeneratedTransferObject genTO = (GeneratedTransferObject) type;
-                final List<GeneratedProperty> properties = genTO.getProperties();
-                final List<GeneratedProperty> hashProps = genTO.getHashCodeIdentifiers();
-                final List<GeneratedProperty> equalProps = genTO.getEqualsIdentifiers();
-
-                listKeyClassCount++;
-                listKeyClassPropertyCount = properties.size();
-                listKeyClassPropertyName = properties.get(0).getName();
-                listKeyClassPropertyTypeName = properties.get(0).getReturnType().getName();
-                listKeyClassPropertyReadOnly = properties.get(0).isReadOnly();
-
-                hashMethodParameterCount = hashProps.size();
-                hashMethodParameterName = hashProps.get(0).getName();
-                hashMethodParameterReturnTypeName = hashProps.get(0).getReturnType().getName();
-
-                equalMethodParameterCount = equalProps.size();
-                equalMethodParameterName = equalProps.get(0).getName();
-                equalMethodParameterReturnTypeName = equalProps.get(0).getReturnType().getName();
-
-            }
-        }
-
-        assertEquals(1, listParentContainerMethodsCount);
-        assertEquals(1, listChildContainerMethodsCount);
-        assertEquals(1, getSimpleListKeyMethodCount);
-        assertEquals(1, listKeyClassCount);
-
-        assertEquals(1, listKeyClassPropertyCount);
-        assertEquals("ListKey", listKeyClassPropertyName);
-        assertEquals("Byte", listKeyClassPropertyTypeName);
-        assertEquals(true, listKeyClassPropertyReadOnly);
-        assertEquals(1, hashMethodParameterCount);
-        assertEquals("ListKey", hashMethodParameterName);
-        assertEquals("Byte", hashMethodParameterReturnTypeName);
-        assertEquals(1, equalMethodParameterCount);
-        assertEquals("ListKey", equalMethodParameterName);
-        assertEquals("Byte", equalMethodParameterReturnTypeName);
-
-        assertEquals("SimpleListKey", getSimpleListKeyMethodReturnTypeName);
-
-        assertEquals(1, getListChildContainerMethodCount);
-        assertEquals("ListChildContainer", getListChildContainerMethodReturnTypeName);
-        assertEquals(1, getFooMethodCount);
-        assertEquals(0, setFooMethodCount);
-        assertEquals(1, getSimpleLeafListMethodCount);
-        assertEquals(0, setSimpleLeafListMethodCount);
-        assertEquals(1, getBarMethodCount);
-
-        assertEquals(5, simpleListMethodsCount);
-    }
-
-    @Test
-    public void testListCompositeKeyResolving() {
-        final String filePath = getClass().getResource("/list-composite-key.yang").getPath();
-        final SchemaContext context = resolveSchemaContextFromFiles(filePath);
-
-        assertNotNull(context);
-
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull(genTypes);
-        assertEquals(8, genTypes.size());
-
-        int genTypesCount = 0;
-        int genTOsCount = 0;
-
-        int compositeKeyListKeyPropertyCount = 0;
-        int compositeKeyListKeyCount = 0;
-        int innerListKeyPropertyCount = 0;
-
-        for (final Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                genTypesCount++;
-            } else if (type instanceof GeneratedTransferObject) {
-                final GeneratedTransferObject genTO = (GeneratedTransferObject) type;
-
-                if (genTO.getName().equals("CompositeKeyListKey")) {
-                    compositeKeyListKeyCount++;
-                    final List<GeneratedProperty> properties = genTO.getProperties();
-                    for (final GeneratedProperty prop : properties) {
-                        if (prop.getName().equals("Key1")) {
-                            compositeKeyListKeyPropertyCount++;
-                        } else if (prop.getName().equals("Key2")) {
-                            compositeKeyListKeyPropertyCount++;
-                        }
-                    }
-                    genTOsCount++;
-                } else if (genTO.getName().equals("InnerListKey")) {
-                    final List<GeneratedProperty> properties = genTO.getProperties();
-                    innerListKeyPropertyCount = properties.size();
-                    genTOsCount++;
-                }
-            }
-        }
-        assertEquals(1, compositeKeyListKeyCount);
-        assertEquals(2, compositeKeyListKeyPropertyCount);
-
-        assertEquals(1, innerListKeyPropertyCount);
-
-        assertEquals(6, genTypesCount);
-        assertEquals(2, genTOsCount);
-    }
-
-    @Test
-    public void testGeneratedTypes() {
-        final String filePath = getClass().getResource("/demo-topology.yang").getPath();
-        final SchemaContext context = resolveSchemaContextFromFiles(filePath);
-        assertNotNull(context);
-
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull(genTypes);
-        assertEquals(15, genTypes.size());
-
-        int genTypesCount = 0;
-        int genTOsCount = 0;
-        for (final Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                genTypesCount++;
-            } else if (type instanceof GeneratedTransferObject) {
-                genTOsCount++;
-            }
-        }
-
-        assertEquals(12, genTypesCount);
-        assertEquals(3, genTOsCount);
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/MethodSignaturePattern.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/MethodSignaturePattern.java
deleted file mode 100644 (file)
index 6e4d03a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-public class MethodSignaturePattern {
-    final String name;
-    final String type;
-
-    public MethodSignaturePattern(String methodName, String methodType) {
-        this.name = methodName;
-        this.type = methodType;
-    }
-
-    public String getName() {
-        return this.name;
-    }
-
-    public String getType() {
-        return this.type;
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/SupportTestUtil.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/SupportTestUtil.java
deleted file mode 100644 (file)
index 101abdb..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
-import org.opendaylight.controller.sal.binding.model.api.ParameterizedType;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-
-public class SupportTestUtil {
-
-    public static void containsSignatures(final GeneratedType genType,
-            final MethodSignaturePattern... searchedSignsWhat) {
-        final List<MethodSignature> searchedSignsIn = genType.getMethodDefinitions();
-        containsSignatures(searchedSignsIn, searchedSignsWhat);
-    }
-
-    public static void containsSignatures(final List<MethodSignature> searchedSignsIn,
-            final MethodSignaturePattern... searchedSignsWhat) {
-        if (searchedSignsIn == null) {
-            throw new IllegalArgumentException("List of method signatures in which should be searched can't be null");
-        }
-        if (searchedSignsWhat == null) {
-            throw new IllegalArgumentException("Array of method signatures which should be searched can't be null");
-        }
-
-        for (MethodSignaturePattern searchedSignWhat : searchedSignsWhat) {
-            boolean nameMatchFound = false;
-            String typeNameFound = "";
-            for (MethodSignature searchedSignIn : searchedSignsIn) {
-                if (searchedSignWhat.getName().equals(searchedSignIn.getName())) {
-                    nameMatchFound = true;
-                    typeNameFound = resolveFullNameOfReturnType(searchedSignIn.getReturnType());
-                    if (searchedSignWhat.getType().equals(typeNameFound)) {
-                        break;
-                    }
-                }
-            }
-            assertTrue("Method " + searchedSignWhat.getName() + " wasn't found.", nameMatchFound);
-            assertEquals("Return type in method " + searchedSignWhat.getName() + " doesn't match expected type ",
-                    searchedSignWhat.getType(), typeNameFound);
-
-        }
-    }
-
-    public static String resolveFullNameOfReturnType(final Type type) {
-        final StringBuilder nameBuilder = new StringBuilder();
-        if (type instanceof ParameterizedType) {
-            nameBuilder.append(type.getName() + "<");
-            ParameterizedType parametrizedTypes = (ParameterizedType) type;
-            for (Type parametrizedType : parametrizedTypes.getActualTypeArguments()) {
-                nameBuilder.append(parametrizedType.getName() + ",");
-            }
-            if (nameBuilder.charAt(nameBuilder.length() - 1) == ',') {
-                nameBuilder.deleteCharAt(nameBuilder.length() - 1);
-            }
-            nameBuilder.append(">");
-        } else {
-            nameBuilder.append(type.getName());
-        }
-        return nameBuilder.toString();
-    }
-
-    public static void containsInterface(String interfaceNameSearched, GeneratedType genType) {
-        List<Type> caseCImplements = genType.getImplements();
-        boolean interfaceFound = false;
-        for (Type caseCImplement : caseCImplements) {
-            String interfaceName = resolveFullNameOfReturnType(caseCImplement);
-            if (interfaceName.equals(interfaceNameSearched)) {
-                interfaceFound = true;
-                break;
-            }
-        }
-        assertTrue("Generated type " + genType.getName() + " doesn't implement inrerface " + interfaceNameSearched,
-                interfaceFound);
-    }
-
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/UnionTypeDefTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/UnionTypeDefTest.java
deleted file mode 100644 (file)
index 08ecff8..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class UnionTypeDefTest {
-    private final static List<File> yangModels = new ArrayList<>();
-    private final static String yangModelsFolder = AugmentedTypeTest.class
-            .getResource("/union-test-models").getPath();
-
-    @BeforeClass
-    public static void loadTestResources() {
-        final File augFolder = new File(yangModelsFolder);
-
-        for (final File fileEntry : augFolder.listFiles()) {
-            if (fileEntry.isFile()) {
-                yangModels.add(fileEntry);
-            }
-        }
-    }
-
-    @Test
-    public void unionTypeResolvingTest() {
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(yangModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull("context is null", context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        assertNotNull("genTypes is null", genTypes);
-        assertFalse("genTypes is empty", genTypes.isEmpty());
-
-        //TODO: implement test
-    }
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/UsesTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/UsesTest.java
deleted file mode 100644 (file)
index 532d786..0000000
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.generator.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.opendaylight.controller.sal.binding.generator.impl.SupportTestUtil.containsInterface;
-import static org.opendaylight.controller.sal.binding.generator.impl.SupportTestUtil.containsSignatures;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
-import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-
-public class UsesTest {
-
-    private static List<File> loadTestResources(String testFile) {
-        final List<File> testModels = new ArrayList<File>();
-        final File listModelFile = new File(UsesTest.class.getResource(testFile).getPath());
-        testModels.add(listModelFile);
-        return testModels;
-    }
-
-    @Test
-    public void usesInGroupingDependenciesTest() {
-        List<File> testModels = loadTestResources("/uses-of-grouping/uses-of-grouping-dependencies.yang");
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-        GeneratedType groupingU = null;
-        GeneratedType groupingX = null;
-        GeneratedType groupingV = null;
-
-        int groupingUCounter = 0;
-        int groupingXCounter = 0;
-        int groupingVCounter = 0;
-
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("GroupingU")) {
-                    groupingU = genType;
-                    groupingUCounter++;
-                } else if (genType.getName().equals("GroupingV")) {
-                    groupingV = genType;
-                    groupingVCounter++;
-                } else if (genType.getName().equals("GroupingX")) {
-                    groupingX = genType;
-                    groupingXCounter++;
-                }
-            }
-        }
-
-        assertNotNull("Generated type for grouping-U wasn't generated.", groupingU);
-        assertEquals("GroupingU interface generated more than one time.", 1, groupingUCounter);
-        assertEquals("GroupingU is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.dependencies.rev2013718", groupingU.getPackageName());
-
-        assertNotNull("Generated type for grouping-V wasn't generated.", groupingV);
-        assertEquals("GroupingV interface generated more than one time.", 1, groupingVCounter);
-        assertEquals("GroupingV is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.dependencies.rev2013718", groupingV.getPackageName());
-
-        assertNotNull("Generated type for grouping-X wasn't generated.", groupingX);
-        assertEquals("GroupingX interface generated more than one time.", 1, groupingXCounter);
-        assertEquals("GroupingX is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.dependencies.rev2013718", groupingX.getPackageName());
-
-        containsInterface("GroupingV", groupingU);
-        containsInterface("GroupingX", groupingU);
-        containsInterface("GroupingZ", groupingV);
-        containsInterface("GroupingZZ", groupingV);
-        containsInterface("GroupingY", groupingX);
-    }
-
-    @Test
-    public void usesInCaseTest() {
-        List<File> testModels = loadTestResources("/uses-of-grouping/uses-of-grouping-case.yang");
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        GeneratedType groupingCaseTest = null;
-        int groupingCaseTestCounter = 0;
-        GeneratedType caseC = null;
-        int caseCCounter = 0;
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("C")) {
-                    caseC = genType;
-                    caseCCounter++;
-                } else if (genType.getName().equals("GroupingCaseTest")) {
-                    groupingCaseTest = genType;
-                    groupingCaseTestCounter++;
-                }
-            }
-        }
-
-        assertNotNull("Generated type for case C wasn't generated.", caseC);
-        assertEquals("Case C interface generated more than one time.", 1, caseCCounter);
-        assertEquals(
-                "Case C is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses._case.rev2013718.container.with.choicetest.choice.test",
-                caseC.getPackageName());
-
-        assertNotNull("Generated type for grouping-case-test wasn't generated.", groupingCaseTest);
-        assertEquals("GroupingCaseTest interface generated more than one time.", 1, groupingCaseTestCounter);
-        assertEquals("GroupingCaseTest is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses._case.rev2013718", groupingCaseTest.getPackageName());
-
-        containsInterface("GroupingCaseTest", caseC);
-        assertTrue("Case C shouldn't contain any method.", caseC.getMethodDefinitions().isEmpty());
-
-        assertEquals("Number of method in GroupingCaseTest is incorrect", 1, groupingCaseTest.getMethodDefinitions()
-                .size());
-        containsSignatures(groupingCaseTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafGroupingCaseTest1", "String"));
-    }
-
-    @Test
-    public void usesInContainerTest() {
-        List<File> testModels = loadTestResources("/uses-of-grouping/uses-of-grouping-container.yang");
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        int containerTestCount = 0;
-        int groupingContainerTestCounter = 0;
-        GeneratedType containerTest = null;
-        GeneratedType groupingContainerTest = null;
-
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("GroupingContainerTest")) {
-                    groupingContainerTest = genType;
-                    groupingContainerTestCounter++;
-                } else if (genType.getName().equals("ContainerTest")) {
-                    containerTest = genType;
-                    containerTestCount++;
-                }
-            }
-        }
-
-        assertNotNull("Generated type for grouping-container-test wasn't generated", groupingContainerTest);
-        assertEquals("GroupingContainerTest interface - incorrect number of occurences", 1,
-                groupingContainerTestCounter);
-        assertEquals("GroupingContainerTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.container.rev2013718",
-                groupingContainerTest.getPackageName());
-
-        assertNotNull("Generated type for container-test wasn't generated", containerTest);
-        assertEquals("ContainerTest interface - incorrect number of occurences", 1, containerTestCount);
-        assertEquals("ContainerTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.container.rev2013718", containerTest.getPackageName());
-
-        containsInterface("GroupingContainerTest", containerTest);
-
-        assertEquals("Number of method in GroupingContainerTestis incorrect", 2, groupingContainerTest
-                .getMethodDefinitions().size());
-        assertEquals("Number of method in ContainerTest is incorrect", 1, containerTest.getMethodDefinitions().size());
-
-        containsSignatures(groupingContainerTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafGroupingContainerTest1", "String"), new MethodSignaturePattern("getLeafGroupingContainerTest2",
-                "Short"));
-
-        containsSignatures(containerTest.getMethodDefinitions(), new MethodSignaturePattern("getContainerLeafTest",
-                "String"));
-    }
-
-    @Test
-    public void usesInGroupingTest() {
-        List<File> testModels = loadTestResources("/uses-of-grouping/uses-of-grouping-grouping.yang");
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        int groupingTestCount = 0;
-        int groupingGroupingTestCounter = 0;
-        GeneratedType groupingTest = null;
-        GeneratedType groupingGroupingTest = null;
-
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("GroupingGroupingTest")) {
-                    groupingGroupingTest = genType;
-                    groupingGroupingTestCounter++;
-                } else if (genType.getName().equals("GroupingTest")) {
-                    groupingTest = genType;
-                    groupingTestCount++;
-                }
-            }
-        }
-
-        assertNotNull("Generated type for grouping-grouping-test wasn't generated", groupingGroupingTest);
-        assertEquals("GroupingGroupingTest interface - incorrect number of occurences", 1, groupingGroupingTestCounter);
-        assertEquals("GroupingGroupingTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.grouping.rev2013718",
-                groupingGroupingTest.getPackageName());
-
-        assertNotNull("Generated type for grouping-test wasn't generated", groupingTest);
-        assertEquals("GroupingTest interface - incorrect number of occurences", 1, groupingTestCount);
-        assertEquals("GroupingTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.grouping.rev2013718", groupingTest.getPackageName());
-
-        containsInterface("GroupingGroupingTest", groupingTest);
-
-        assertEquals("Number of method in GroupingGroupingTest is incorrect", 1, groupingGroupingTest
-                .getMethodDefinitions().size());
-        assertEquals("Number of method in GroupingTest is incorrect", 1, groupingTest.getMethodDefinitions().size());
-
-        containsSignatures(groupingGroupingTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafGroupingGrouping", "String"));
-
-        containsSignatures(groupingTest.getMethodDefinitions(), new MethodSignaturePattern("getLeafGroupingTest",
-                "Byte"));
-    }
-
-    @Test
-    public void usesInListTest() {
-        List<File> testModels = loadTestResources("/uses-of-grouping/uses-of-grouping-list.yang");
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        int listTestCounter = 0;
-        int groupingListTestCounter = 0;
-        int containerGroupingListTestCounter = 0;
-        int listGroupingListTestCounter = 0;
-        GeneratedType listTest = null;
-        GeneratedType groupingListTest = null;
-        GeneratedType containerGroupingListTest = null;
-        GeneratedType listGroupingListTest = null;
-
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("GroupingListTest")) {
-                    groupingListTest = genType;
-                    groupingListTestCounter++;
-                } else if (genType.getName().equals("ListTest")) {
-                    listTest = genType;
-                    listTestCounter++;
-                } else if (genType.getName().equals("ContainerGroupingListTest")) {
-                    containerGroupingListTest = genType;
-                    containerGroupingListTestCounter++;
-                } else if (genType.getName().equals("ListGroupingListTest")) {
-                    listGroupingListTest = genType;
-                    listGroupingListTestCounter++;
-                }
-            }
-        }
-
-        assertNotNull("Generated type for grouping-list-test wasn't generated", groupingListTest);
-        assertEquals("GroupingListTest interface - incorrect number of occurences", 1, groupingListTestCounter);
-        assertEquals("GroupingListTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.list.rev2013718", groupingListTest.getPackageName());
-
-        assertNotNull("Generated type for list-test wasn't generated", listTest);
-        assertEquals("ListTest interface - incorrect number of occurences", 1, listTestCounter);
-        assertEquals("ListTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.list.rev2013718", listTest.getPackageName());
-
-        assertNotNull("Generated type for container-grouping-list-test wasn't generated", containerGroupingListTest);
-        assertEquals("ContainerGroupingListTest interface - incorrect number of occurences", 1,
-                containerGroupingListTestCounter);
-        assertEquals("ContainerGroupingListTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.list.rev2013718.grouping.list.test",
-                containerGroupingListTest.getPackageName());
-
-        assertNotNull("Generated type for list-grouping-list-test wasn't generated", listGroupingListTest);
-        assertEquals("ListGroupingListTest interface - incorrect number of occurences", 1, listGroupingListTestCounter);
-        assertEquals("ListGroupingListTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.list.rev2013718.grouping.list.test",
-                listGroupingListTest.getPackageName());
-
-        containsInterface("GroupingListTest", listTest);
-
-        assertEquals("Number of method in GroupingListTest is incorrect", 4, groupingListTest.getMethodDefinitions()
-                .size());
-        assertEquals("Number of method in ListTest is incorrect", 1, listTest.getMethodDefinitions().size());
-        assertEquals("Number of method in ContainerGroupingListTest is incorrect", 1, containerGroupingListTest
-                .getMethodDefinitions().size());
-        assertEquals("Number of method in ListGroupingListTest is incorrect", 1, listGroupingListTest
-                .getMethodDefinitions().size());
-
-        containsSignatures(groupingListTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getContainerGroupingListTest", "ContainerGroupingListTest"), new MethodSignaturePattern(
-                "getLeafGroupingListTest", "String"), new MethodSignaturePattern("getLeaffllistGroupingListTest",
-                "List<String>"), new MethodSignaturePattern("getListGroupingListTest", "List<ListGroupingListTest>"));
-        containsSignatures(listTest.getMethodDefinitions(), new MethodSignaturePattern("getListLeafTest", "String"));
-        containsSignatures(containerGroupingListTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafContainerGroupingListTest", "Short"));
-        containsSignatures(listGroupingListTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafListGroupingListTest", "Integer"));
-    }
-
-    @Test
-    public void usesInModulTest() {
-        List<File> testModels = loadTestResources("/uses-of-grouping/uses-of-grouping-modul.yang");
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        int groupingModulTestCounter = 0;
-        int groupingUsesModulDataCounter = 0;
-        GeneratedType groupingModulTest = null;
-        GeneratedType groupingUsesModulData = null;
-
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("GroupingModulTest")) {
-                    groupingModulTest = genType;
-                    groupingModulTestCounter++;
-                } else if (genType.getName().equals("GroupingUsesModulData")) {
-                    groupingUsesModulData = genType;
-                    groupingUsesModulDataCounter++;
-                }
-            }
-        }
-
-        assertNotNull("Generated type for grouping-list-test wasn't generated", groupingModulTest);
-        assertEquals("GroupingModulTest interface - incorrect number of occurences", 1, groupingModulTestCounter);
-        assertEquals("GroupingModulTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.modul.rev2013718", groupingModulTest.getPackageName());
-
-        assertNotNull("Generated type for modul wasn't generated", groupingUsesModulData);
-        assertEquals("GroupingUsesModulData interface - incorrect number of occurences", 1,
-                groupingUsesModulDataCounter);
-        assertEquals("GroupingUsesModulData isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.modul.rev2013718",
-                groupingUsesModulData.getPackageName());
-
-        containsInterface("GroupingModulTest", groupingUsesModulData);
-
-        assertEquals("Number of method in GroupingUsesModulData is incorrect", 0, groupingUsesModulData
-                .getMethodDefinitions().size());
-        assertEquals("Number of method in GroupingModulTest is incorrect", 2, groupingModulTest.getMethodDefinitions()
-                .size());
-
-        containsSignatures(groupingModulTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafGroupingModulTest", "String"), new MethodSignaturePattern("getLeafGroupingModulTest2", "Short"));
-    }
-
-    @Test
-    public void usesInRpcTest() {
-        List<File> testModels = loadTestResources("/uses-of-grouping/uses-of-grouping-rpc.yang");
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        int rpcTestInputCounter = 0;
-        int rpcTestOutputCounter = 0;
-        int groupingRpcInputTestCounter = 0;
-        int groupingRpcOutputTestCounter = 0;
-        int containerGroupingRpcInputTestCounter = 0;
-        GeneratedType rpcTestInput = null;
-        GeneratedType rpcTestOutput = null;
-        GeneratedType groupingRpcInputTest = null;
-        GeneratedType groupingRpcOutputTest = null;
-        GeneratedType containerGroupingRpcInputTest = null;
-
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("RpcTestInput")) {
-                    rpcTestInput = genType;
-                    rpcTestInputCounter++;
-                } else if (genType.getName().equals("RpcTestOutput")) {
-                    rpcTestOutput = genType;
-                    rpcTestOutputCounter++;
-                } else if (genType.getName().equals("GroupingRpcInputTest")) {
-                    groupingRpcInputTest = genType;
-                    groupingRpcInputTestCounter++;
-                } else if (genType.getName().equals("GroupingRpcOutputTest")) {
-                    groupingRpcOutputTest = genType;
-                    groupingRpcOutputTestCounter++;
-                } else if (genType.getName().equals("ContainerGroupingRpcInputTest")) {
-                    containerGroupingRpcInputTest = genType;
-                    containerGroupingRpcInputTestCounter++;
-                }
-
-            }
-        }
-
-        assertNotNull("Generated type for RPC test input wasn't generated", rpcTestInput);
-        assertEquals("RpcTestInput interface - incorrect number of occurences", 1, rpcTestInputCounter);
-        assertEquals("RpcTestInput isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.rpc.rev2013718", rpcTestInput.getPackageName());
-
-        assertNotNull("Generated type for RPC test output wasn't generated", rpcTestOutput);
-        assertEquals("RpcTestOutput interface - incorrect number of occurences", 1, rpcTestOutputCounter);
-        assertEquals("RpcTestOutput isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.rpc.rev2013718", rpcTestOutput.getPackageName());
-
-        assertNotNull("Generated type for grouping-rpc-input-test wasn't generated", groupingRpcInputTest);
-        assertEquals("RpcTestOutput interface - incorrect number of occurences", 1, groupingRpcInputTestCounter);
-        assertEquals("GroupingRpcInputTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.rpc.rev2013718", groupingRpcInputTest.getPackageName());
-
-        assertNotNull("Generated type for grouping-rpc-output-test wasn't generated", groupingRpcOutputTest);
-        assertEquals("RpcTestOutput interface - incorrect number of occurences", 1, groupingRpcOutputTestCounter);
-        assertEquals("GroupingRpcOutputTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.rpc.rev2013718", groupingRpcOutputTest.getPackageName());
-
-        assertNotNull("Generated type for container-grouping-rpc-input-test wasn't generated",
-                containerGroupingRpcInputTest);
-        assertEquals("ContainerGroupingRpcInputTest interface - incorrect number of occurences", 1,
-                containerGroupingRpcInputTestCounter);
-        assertEquals("ContainerGroupingRpcInputTest isn't in correct package",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.rpc.rev2013718.grouping.rpc.input.test",
-                containerGroupingRpcInputTest.getPackageName());
-
-        containsInterface("GroupingRpcInputTest", rpcTestInput);
-        containsInterface("GroupingRpcOutputTest", rpcTestOutput);
-
-        assertEquals("Number of method in RpcTestInput is incorrect", 0, rpcTestInput.getMethodDefinitions().size());
-        assertEquals("Number of method in RpcTestOutput is incorrect", 0, rpcTestOutput.getMethodDefinitions().size());
-        assertEquals("Number of method in GroupingRpcInputTest is incorrect", 2, groupingRpcInputTest
-                .getMethodDefinitions().size());
-        assertEquals("Number of method in GroupingRpcOutputTest is incorrect", 1, groupingRpcOutputTest
-                .getMethodDefinitions().size());
-        assertEquals("Number of method in ContainerGroupingRpcInputTest is incorrect", 1, containerGroupingRpcInputTest
-                .getMethodDefinitions().size());
-
-        containsSignatures(groupingRpcInputTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getContainerGroupingRpcInputTest", "ContainerGroupingRpcInputTest"), new MethodSignaturePattern(
-                "getLeaflistGroupingRpcInputTest", "List<Short>"));
-        containsSignatures(groupingRpcOutputTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafGroupingRpcOutputTest", "Byte"));
-        containsSignatures(containerGroupingRpcInputTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafContainerGroupingRpcInputTest", "String"));
-    }
-
-    @Test
-    public void usesInAugmentTest() {
-        List<File> testModels = loadTestResources("/uses-of-grouping/uses-of-grouping-augment.yang");
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        GeneratedType containerAugment1 = null;
-        GeneratedType groupingAugmentTest = null;
-        int containerAugment1Counter = 0;
-        int groupingAugmentTestCounter = 0;
-
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("ContainerAugment1")) {
-                    containerAugment1 = genType;
-                    containerAugment1Counter++;
-                } else if (genType.getName().equals("GroupingAugmentTest")) {
-                    groupingAugmentTest = genType;
-                    groupingAugmentTestCounter++;
-                }
-            }
-        }
-
-        assertNotNull("Generated type for augment /container-augment wasn't generated.", containerAugment1);
-        assertEquals("ContainerAugment1 interface generated more than one time.", 1, containerAugment1Counter);
-        assertEquals("ContainerAugment1 is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.augment.rev2013718", containerAugment1.getPackageName());
-
-        assertNotNull("Generated type for grouping-augment-test wasn't generated.", groupingAugmentTest);
-        assertEquals("GroupingAugmentTest interface generated more than one time.", 1, groupingAugmentTestCounter);
-        assertEquals("groupingAugmentTest is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.augment.rev2013718",
-                groupingAugmentTest.getPackageName());
-
-        containsInterface("GroupingAugmentTest", containerAugment1);
-
-        assertEquals("Number of method in GroupingCaseTest is incorrect", 0, containerAugment1.getMethodDefinitions()
-                .size());
-
-        assertEquals("Number of method in ContainerAugment1 is incorrect", 0, containerAugment1.getMethodDefinitions()
-                .size());
-        assertEquals("Number of method in GroupingCaseTest is incorrect", 1, groupingAugmentTest.getMethodDefinitions()
-                .size());
-
-        containsSignatures(groupingAugmentTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafGroupingAugmentTest", "String"));
-    }
-
-    @Test
-    public void usesInNotification() {
-        List<File> testModels = loadTestResources("/uses-of-grouping/uses-of-grouping-notification.yang");
-        final YangModelParser parser = new YangParserImpl();
-        final Set<Module> modules = parser.parseYangModels(testModels);
-        final SchemaContext context = parser.resolveSchemaContext(modules);
-
-        assertNotNull(context);
-        final BindingGenerator bindingGen = new BindingGeneratorImpl();
-        final List<Type> genTypes = bindingGen.generateTypes(context);
-
-        GeneratedType notificationTest = null;
-        GeneratedType groupingNotificationTest = null;
-        GeneratedType containerGroupingNotificationTest = null;
-        int notificationTestCounter = 0;
-        int groupingNotificationTestCounter = 0;
-        int containerGroupingNotificationTestCounter = 0;
-
-        for (Type type : genTypes) {
-            if (type instanceof GeneratedType && !(type instanceof GeneratedTransferObject)) {
-                GeneratedType genType = (GeneratedType) type;
-                if (genType.getName().equals("NotificationTest")) {
-                    notificationTest = genType;
-                    notificationTestCounter++;
-                } else if (genType.getName().equals("GroupingNotificationTest")) {
-                    groupingNotificationTest = genType;
-                    groupingNotificationTestCounter++;
-                } else if (genType.getName().equals("ContainerGroupingNotificationTest")) {
-                    containerGroupingNotificationTest = genType;
-                    containerGroupingNotificationTestCounter++;
-                }
-            }
-        }
-
-        assertNotNull("Generated type for notification-test wasn't generated.", notificationTest);
-        assertEquals("NotificationTest interface generated more than one time.", 1, notificationTestCounter);
-        assertEquals("NotificationTest is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.notification.rev2013718",
-                notificationTest.getPackageName());
-
-        assertNotNull("Generated type for grouping-notification-test wasn't generated.", groupingNotificationTest);
-        assertEquals("GroupingNotificationTest interface generated more than one time.", 1,
-                groupingNotificationTestCounter);
-        assertEquals("groupingNotificationTest is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.notification.rev2013718",
-                groupingNotificationTest.getPackageName());
-
-        assertNotNull("Generated type for container-grouping-notification-test wasn't generated.",
-                containerGroupingNotificationTest);
-        assertEquals("ContainerGroupingNotificationTest interface generated more than one time.", 1,
-                containerGroupingNotificationTestCounter);
-        assertEquals("ContainerGroupingNotificationTest is in wrong package.",
-                "org.opendaylight.yang.gen.v1.urn.grouping.uses.notification.rev2013718.grouping.notification.test",
-                containerGroupingNotificationTest.getPackageName());
-
-        containsInterface("GroupingNotificationTest", notificationTest);
-
-        assertEquals("Number of method in NotificationTest is incorrect", 1, notificationTest.getMethodDefinitions()
-                .size());
-        assertEquals("Number of method in GroupingNotificationTest is incorrect", 2, groupingNotificationTest
-                .getMethodDefinitions().size());
-        assertEquals("Number of method in ContainerGroupingNotificationTest is incorrect", 1,
-                containerGroupingNotificationTest.getMethodDefinitions().size());
-
-        containsSignatures(notificationTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafNotificationTest", "String"));
-        containsSignatures(groupingNotificationTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getContainerGroupingNotificationTest", "ContainerGroupingNotificationTest"),
-                new MethodSignaturePattern("getLeaffllistGroupingNotificationTest", "List<String>"));
-        containsSignatures(containerGroupingNotificationTest.getMethodDefinitions(), new MethodSignaturePattern(
-                "getLeafContainerGroupingNotificationTest", "Long"));
-    }
-
-}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/abstract-topology.yang b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/abstract-topology.yang
deleted file mode 100644 (file)
index 863b223..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-module abstract-topology {
-    yang-version 1;
-    namespace "urn:model:abstract:topology";
-    prefix "tp";
-
-    import ietf-inet-types { 
-        prefix "inet"; 
-        revision-date 2010-09-24;
-    }
-
-    organization "OPEN DAYLIGHT";
-    contact "http://www.opendaylight.org/";
-
-    description
-        "This module contains the definitions of elements that creates network 
-    topology i.e. definition of network nodes and links. This module is not designed to be used solely for network representation. This module SHOULD be used as base module in defining the network topology.";
-
-    revision "2013-02-08" {
-        reference "~~~ WILL BE DEFINED LATER";
-    }
-    
-    revision "2013-01-01" {
-        reference "~~~ WILL BE DEFINED LATER";
-    }
-    
-    typedef node-id-ref {
-        type leafref {
-            path "/tp:topology/tp:network-nodes/tp:network-node/tp:node-id";
-        }
-        description "This type is used for leafs that reference network node instance.";
-    }
-
-    typedef link-id-ref {
-        type leafref {
-            path "/tp:topology/tp:network-links/tp:network-link/tp:link-id";
-        }
-        description "This type is used for leafs that reference network link instance.";
-    }
-
-    container topology {
-        description "This is the model of abstract topology which contains only Network Nodes and Network Links. Each topology MUST be identified by unique topology-id for reason that the store could contain many topologies.";
-
-        leaf topology-id {
-            type inet:uri;
-            description "It is presumed that datastore will contain many topologies. To distinguish between topologies it is vital to have
-            UNIQUE topology identifier.";
-        }
-
-        container network-nodes {
-            list network-node {
-                key "node-id";
-
-                leaf node-id {
-                    type inet:uri;
-                    description "The Topology identifier of network-node.";
-                }
-
-                container attributes {
-                    description "Aditional attributes that can Network Node contains.";
-                }
-                description "The list of network nodes defined for topology.";
-            }
-        }
-        
-        container network-links {
-            list network-link {
-                key "link-id";
-
-                leaf link-id {
-                    type inet:uri;
-                    description "";
-                }
-
-                container source-node {
-                    leaf id {
-                        type node-id-ref;
-                        description "Source node identifier.";
-                    }
-                }
-
-                container destination-node {
-                    leaf id {
-                        type node-id-ref;
-                        description "Destination node identifier.";
-                    }
-                }
-
-                container attributes {
-                    description "Aditional attributes that can Network Link contains.";
-                }
-                description "The Network Link which is defined by Local (Source) and Remote (Destination) Network Nodes. Every link MUST be defined either by identifier and
-                his local and remote Network Nodes (In real applications it is common that many links are originated from one node and end up in same remote node). To ensure that we would always know to distinguish between links, every link SHOULD have identifier.";
-            }
-        }
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/abstract-topology@2013-02-08.yang b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/abstract-topology@2013-02-08.yang
deleted file mode 100644 (file)
index d80a3e9..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-module abstract-topology {
-    yang-version 1;
-    namespace "urn:model:abstract:topology";
-    prefix "tp";
-
-    import ietf-inet-types { 
-        prefix "inet"; 
-        revision-date 2010-09-24;
-    }
-
-    organization "OPEN DAYLIGHT";
-    contact "http://www.opendaylight.org/";
-
-    description
-        "This module contains the definitions of elements that creates network 
-    topology i.e. definition of network nodes and links. This module is not designed 
-    to be used solely for network representation. This module SHOULD be used as base 
-    module in defining the network topology.";
-
-    revision "2013-02-08" {
-        reference "http://www.opendaylight.org/";
-    }
-    
-    typedef node-id-ref {
-        type leafref {
-            path "/tp:topology/tp:network-nodes/tp:network-node/tp:node-id";
-        }
-        description "This type is used for leafs that reference network node instance.";
-    }
-
-    typedef link-id-ref {
-        type leafref {
-            path "/tp:topology/tp:network-links/tp:network-link/tp:link-id";
-        }
-        description "This type is used for leafs that reference network link instance.";
-    }
-
-    container topology {
-        description "This is the model of abstract topology which contains 
-        only Network Nodes and Network Links. Each topology MUST be identified by unique 
-        topology-id for reason that the store could contain many topologies.";
-
-        leaf topology-id {
-            type inet:uri;
-            description "It is presumed that datastore will contain many topologies. 
-            To distinguish between topologies it is vital to have
-            UNIQUE topology identifier.";
-        }
-
-        container network-nodes {
-            list network-node {
-                key "node-id";
-
-                leaf node-id {
-                    type inet:uri;
-                    description "The Topology identifier of network-node.";
-                }
-
-                container attributes {
-                    description "Aditional attributes that can Network Node contains.";
-                }
-                description "The list of network nodes defined for topology.";
-            }
-        }
-        
-        container network-links {
-            list network-link {
-                key "link-id";
-
-                leaf link-id {
-                    type inet:uri;
-                    description "";
-                }
-
-                container source-node {
-                    leaf id {
-                        type node-id-ref;
-                        description "Source node identifier.";
-                    }
-                }
-
-                container destination-node {
-                    leaf id {
-                        type node-id-ref;
-                        description "Destination node identifier.";
-                    }
-                }
-
-                container attributes {
-                    description "Aditional attributes that can Network Link contains.";
-                }
-                description "The Network Link which is defined by Local (Source) and Remote (Destination) 
-                Network Nodes. Every link MUST be defined either by identifier and
-                his local and remote Network Nodes (In real applications it is common that 
-                many links are originated from one node and end up in same remote node). 
-                To ensure that we would always know to distinguish between links, every link 
-                SHOULD have identifier.";
-            }
-        }
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/augment-abstract-topology@2013-05-03.yang b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/augment-relative-xpath-models/augment-abstract-topology@2013-05-03.yang
deleted file mode 100644 (file)
index 4ffe723..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-module augment-abstract-topology {
-    yang-version 1;
-    namespace "urn:model:augment:abstract:topology";
-    prefix "atp";
-
-    import ietf-inet-types { 
-        prefix "inet";
-        revision-date 2010-09-24;
-    }
-
-    import ietf-interfaces {
-        prefix "if";
-        revision-date 2012-11-15;
-    }
-
-    import abstract-topology {
-        prefix "at";
-        revision-date 2013-02-08;
-    }
-
-    organization "OPEN DAYLIGHT";
-    contact "http://www.opendaylight.org/";
-
-    revision "2013-05-03" {
-        reference "http://www.opendaylight.org/";
-    }
-
-    augment "at:topology" {
-        container interfaces {
-            list interface {
-                key "interface-id";
-
-                leaf interface-id {
-                    type