@Test public void testCheckAttributeRangeValueSatisfied() throws Exception { method = class1.getDeclaredMethod("checkAttributeRangeValueSatisfied",new Class[]{Long.class, RangeValue.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 = 1L; RangeValue requiredAttributeValue = mock(RangeValue.class); 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.Between; when(requiredAttributeValue.getMin()).thenReturn(0L); when(requiredAttributeValue.getMax()).thenReturn(2L); Assert.assertTrue((boolean) method.invoke(vnMappingUnit, attributeValue, requiredAttributeValue, attributeMatchPattern)); }
private boolean checkAttributeRangeValueSatisfied(Long attributeValue, RangeValue requiredAttributeValue, PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern) throws VNMappingException { switch ( attributeMatchPattern ) { case Between: return attributeValue > requiredAttributeValue.getMin() && attributeValue < requiredAttributeValue.getMax(); default: throw new VNMappingException("Unsupported attribute match pattern " + attributeMatchPattern + " for the attribute range value."); } }
VNMappingUnit implements AutoCloseable { private boolean checkAttributeRangeValueSatisfied(Long attributeValue, RangeValue requiredAttributeValue, PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern) throws VNMappingException { switch ( attributeMatchPattern ) { case Between: return attributeValue > requiredAttributeValue.getMin() && attributeValue < requiredAttributeValue.getMax(); default: throw new VNMappingException("Unsupported attribute match pattern " + attributeMatchPattern + " for the attribute range value."); } } }
VNMappingUnit implements AutoCloseable { private boolean checkAttributeRangeValueSatisfied(Long attributeValue, RangeValue requiredAttributeValue, PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern) throws VNMappingException { switch ( attributeMatchPattern ) { case Between: return attributeValue > requiredAttributeValue.getMin() && attributeValue < requiredAttributeValue.getMax(); default: throw new VNMappingException("Unsupported attribute match pattern " + attributeMatchPattern + " for the attribute range value."); } } VNMappingUnit(DataBroker dataBroker,
                         PNComputationUnit pnComputationUnit,
                         PNResourcesTracker pnResourcesTracker); }
VNMappingUnit implements AutoCloseable { private boolean checkAttributeRangeValueSatisfied(Long attributeValue, RangeValue requiredAttributeValue, PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern) throws VNMappingException { switch ( attributeMatchPattern ) { case Between: return attributeValue > requiredAttributeValue.getMin() && attributeValue < requiredAttributeValue.getMax(); default: throw new VNMappingException("Unsupported attribute match pattern " + attributeMatchPattern + " for the attribute range 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(); }
VNMappingUnit implements AutoCloseable { private boolean checkAttributeRangeValueSatisfied(Long attributeValue, RangeValue requiredAttributeValue, PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern) throws VNMappingException { switch ( attributeMatchPattern ) { case Between: return attributeValue > requiredAttributeValue.getMin() && attributeValue < requiredAttributeValue.getMax(); default: throw new VNMappingException("Unsupported attribute match pattern " + attributeMatchPattern + " for the attribute range 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();  }