- assertEquals("termination direction should be BIDIRECTIONAL",
- TerminationDirection.BIDIRECTIONAL, nep.getTerminationDirection());
- assertEquals("operational state of client nep should be ENABLED",
- OperationalState.ENABLED, nep.getOperationalState());
- assertEquals("link-port-role of client nep should be SYMMETRIC",
- PortRole.SYMMETRIC, nep.getLinkPortRole());
- }
-
- private void checkTransitionalLink(Link link, Uuid node1Uuid, Uuid node2Uuid, String tp1, String tp2,
- String ietfNodeId) {
- Uuid linkUuid = new Uuid(UUID.nameUUIDFromBytes((tp1 + "to" + tp2)
- .getBytes(Charset.forName("UTF-8"))).toString());
- assertEquals("bad uuid for link between DSR node " + tp1 + " and iOTSI port " + tp2, linkUuid, link.getUuid());
- assertEquals("Available capacity unit should be GBPS",
- CapacityUnit.GBPS, link.getAvailableCapacity().getTotalSize().getUnit());
- assertEquals("Available capacity -total size value should be 100",
- Uint64.valueOf(100), link.getAvailableCapacity().getTotalSize().getValue());
- assertEquals("transitional link should be between 2 nodes of protocol layers ODU and PHOTONIC_MEDIA",
- 2, link.getTransitionedLayerProtocolName().size());
- assertThat("transitional link should be between 2 nodes of protocol layers ODU and PHOTONIC_MEDIA",
- link.getTransitionedLayerProtocolName(),
- hasItems(LayerProtocolName.ODU.getName(), LayerProtocolName.PHOTONICMEDIA.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",
- topologyUuid, nodeEdgePointList.get(0).getTopologyUuid());
- assertEquals("topology uuid should be the same for the two termination point of the link",
- topologyUuid, nodeEdgePointList.get(1).getTopologyUuid());
- assertThat("transitional links should terminate on DSR node and Photonic node",
- nodeEdgePointList.get(0).getNodeUuid().getValue(),
- either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue())));
- assertThat("transitional links should terminate on DSR node and Photonic node",
- nodeEdgePointList.get(1).getNodeUuid().getValue(),
- either(containsString(node1Uuid.getValue())).or(containsString(node2Uuid.getValue())));
- Uuid nep1Uuid = new Uuid(UUID.nameUUIDFromBytes(tp1.getBytes(Charset.forName("UTF-8"))).toString());
- Uuid nep2Uuid = new Uuid(UUID.nameUUIDFromBytes(tp2.getBytes(Charset.forName("UTF-8"))).toString());
- assertThat("transitional links should terminate on " + tp1 + " and " + tp2 + " neps",
- nodeEdgePointList.get(0).getNodeEdgePointUuid().getValue(),
- either(containsString(nep1Uuid.getValue())).or(containsString(nep2Uuid.getValue())));
- assertThat("transitional links should terminate on DSR node and Photonic node",
- nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(),
- either(containsString(nep1Uuid.getValue())).or(containsString(nep2Uuid.getValue())));