VNMappingUnit implements AutoCloseable { private boolean checkAttributeIntegerValueSatisfied(Long attributeValue, Long requiredAttributeValue, PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern) throws VNMappingException { int result = attributeValue.compareTo(requiredAttributeValue); switch ( attributeMatchPattern ) { case LessThan: return 0 > result; case NotLessThan: return 0 <= result; case Equal: return 0 == result; case NotEqual: return 0 != result; case GreaterThan: return 0 < result; case NotGreaterThan: return 0 >= result; default: throw new VNMappingException("Unsupported attribute match pattern " + attributeMatchPattern + " for the attribute integer value."); } } VNMappingUnit(DataBroker dataBroker,
                         PNComputationUnit pnComputationUnit,
                         PNResourcesTracker pnResourcesTracker); void virtualNetworkMapping(VirtualNetwork virtualNetwork, UserVnPnMapping userVnPnMapping,
                                      List<PhysicalPath> physicalPaths); void virtualNetworkMapping(VirtualNetwork virtualNetwork, List<VirtualLink> unmappedVirtualLinks,
                                      UserVnPnMapping userVnPnMapping, List<PhysicalPath> physicalPaths); @Override void close();  }
@Test public void testCheckAttributeIntegerValueSatisfied() throws Exception { method = class1.getDeclaredMethod("checkAttributeIntegerValueSatisfied",new Class[]{Long.class, Long.class, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern.class }); method.setAccessible(true); Long attributeValue = 2L; Long requiredAttributeValue = 1L; org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern = org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern.LessThan; org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern1 = org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern.NotLessThan; org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern2 = org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern.Equal; org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern3 = org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern.NotEqual; org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern4 = org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern.GreaterThan; org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern5 = org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network.rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern.NotGreaterThan; Assert.assertTrue((boolean)method.invoke(vnMappingUnit,attributeValue,requiredAttributeValue,attributeMatchPattern) == false); Assert.assertTrue((boolean)method.invoke(vnMappingUnit,attributeValue,requiredAttributeValue,attributeMatchPattern1) == true); Assert.assertTrue((boolean)method.invoke(vnMappingUnit,attributeValue,requiredAttributeValue,attributeMatchPattern2) == false); Assert.assertTrue((boolean) method.invoke(vnMappingUnit, attributeValue, requiredAttributeValue, attributeMatchPattern3) == true); Assert.assertTrue((boolean) method.invoke(vnMappingUnit, attributeValue, requiredAttributeValue, attributeMatchPattern4) == true); Assert.assertTrue((boolean)method.invoke(vnMappingUnit,attributeValue,requiredAttributeValue,attributeMatchPattern5) == false); }