+
+ private void checkOtnLink(Link link, Uuid topoUuid, Uuid node1Uuid, Uuid node2Uuid, Uuid tp1Uuid, Uuid tp2Uuid,
+ Uuid linkUuid, String linkName) {
+ assertEquals("bad name for the link", linkName, link.getName().get(new NameKey("otn link name")).getValue());
+ assertEquals("bad uuid for link", linkUuid, link.getUuid());
+ assertEquals("Available capacity unit should be MBPS",
+ CapacityUnit.MBPS, link.getAvailableCapacity().getTotalSize().getUnit());
+ String prefix = linkName.split("-")[0];
+ if ("OTU4".equals(prefix)) {
+ assertEquals("Available capacity -total size value should be 0",
+ Uint64.valueOf(0), link.getAvailableCapacity().getTotalSize().getValue());
+ } else if ("ODU4".equals(prefix)) {
+ assertEquals("Available capacity -total size value should be 100 000",
+ Uint64.valueOf(100000), link.getAvailableCapacity().getTotalSize().getValue());
+ }
+ assertEquals("Total capacity unit should be GBPS",
+ CapacityUnit.GBPS, link.getTotalPotentialCapacity().getTotalSize().getUnit());
+ assertEquals("Total capacity -total size value should be 100",
+ Uint64.valueOf(100), link.getTotalPotentialCapacity().getTotalSize().getValue());
+ if ("OTU4".equals(prefix)) {
+ assertEquals("otn link should be between 2 nodes of protocol layers PHOTONIC_MEDIA",
+ LayerProtocolName.PHOTONICMEDIA.getName(), link.getLayerProtocolName().get(0).getName());
+ } else if ("ODU4".equals(prefix)) {
+ assertEquals("otn link should be between 2 nodes of protocol layers ODU",
+ LayerProtocolName.ODU.getName(), link.getLayerProtocolName().get(0).getName());
+ }
+ assertEquals("transitional link should be BIDIRECTIONAL",
+ ForwardingDirection.BIDIRECTIONAL, link.getDirection());
+ List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210
+ .link.NodeEdgePoint> nodeEdgePointList = new ArrayList<>(link.nonnullNodeEdgePoint().values());
+ assertEquals("topology uuid should be the same for the two termination point of the link",
+ topoUuid, nodeEdgePointList.get(0).getTopologyUuid());
+ assertEquals("topology uuid should be the same for the two termination point of the link",
+ topoUuid, nodeEdgePointList.get(1).getTopologyUuid());
+ assertThat("otn links should terminate on two distinct nodes",
+ nodeEdgePointList.get(0).getNodeUuid().getValue(),
+ either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue())));
+ assertThat("otn links should terminate on two distinct nodes",
+ nodeEdgePointList.get(1).getNodeUuid().getValue(),
+ either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue())));
+ assertThat("otn links should terminate on two distinct tps",
+ nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(),
+ either(containsString(tp1Uuid.getValue())).or(containsString(tp2Uuid.getValue())));
+ assertThat("otn links should terminate on two distinct tps",
+ nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(),
+ either(containsString(tp1Uuid.getValue())).or(containsString(tp2Uuid.getValue())));
+ assertEquals("operational state should be ENABLED",
+ OperationalState.ENABLED, link.getOperationalState());
+ assertEquals("administrative state should be UNLOCKED",
+ AdministrativeState.UNLOCKED, link.getAdministrativeState());
+ }
+