X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fcode-generator%2Fbinding-generator-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fgenerator%2Fimpl%2FAugmentedTypeTest.java;h=f8958c13b53cf086a87638138b88423f2bb4c75b;hb=0b203f52cbe128efa17a6c400b6653c8e6a84ba8;hp=19dfd9577f8224c589a5db90a8abc9ae61adc0bc;hpb=ee36e17cd29fd1b5ebdf895a6deb14c4e1d8c9e2;p=controller.git 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 index 19dfd9577f..f8958c13b5 100644 --- 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 @@ -22,10 +22,10 @@ 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.controller.yang.model.api.Module; -import org.opendaylight.controller.yang.model.api.SchemaContext; -import org.opendaylight.controller.yang.model.parser.api.YangModelParser; -import org.opendaylight.controller.yang.parser.impl.YangParserImpl; +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 { @@ -63,16 +63,16 @@ public class AugmentedTypeTest { GeneratedTransferObject gtTunnelKey = null; GeneratedType gtNetworkLink2 = null; - for(final Type type : genTypes) { - if(type.getName().equals("InterfaceKey") && type.getPackageName().contains("augment._abstract.topology")) { + 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")) { + } 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")) { + } 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")) { + } 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")) { + } else if (type.getName().equals("NetworkLink2") && type.getPackageName().contains("augment._abstract.topology")) { gtNetworkLink2 = (GeneratedType) type; } } @@ -90,8 +90,10 @@ public class AugmentedTypeTest { } 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")); + 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) { @@ -101,9 +103,12 @@ public class AugmentedTypeTest { } } 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")); + 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); @@ -118,8 +123,10 @@ public class AugmentedTypeTest { } 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")); + 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); @@ -133,9 +140,12 @@ public class AugmentedTypeTest { } } 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")); + 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); @@ -149,16 +159,20 @@ public class AugmentedTypeTest { } } 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")); + 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 networkLink2Methods = gtNetworkLink2.getMethodDefinitions(); assertNotNull("networkLink2Methods is null", networkLink2Methods); -// FIXME: in some cases getIfcMethod is null which causes test fail. fix ASAP + +// 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")) { @@ -166,7 +180,7 @@ public class AugmentedTypeTest { // 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"));