import org.opendaylight.transportpce.tapi.utils.TapiTopologyDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.transportpce.test.utils.TopologyDataUtils;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Link1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.TerminationPoint1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.TerminationPoint1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Link1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.TerminationPoint1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.TerminationPoint1Builder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmLinkType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmTpType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmLinkType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmTpType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NetworkId;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
private static final Logger LOG = LoggerFactory.getLogger(ConvertORTopoToFullTapiTopoTest.class);
private static Node otnMuxA;
- private static Node otnMuxC;
private static Node otnSwitch;
private static Node tpdr100G;
private static Node roadmA;
private static Node roadmC;
private static Network openroadmNet;
- private static Map<LinkKey, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226
- .networks.network.Link> otnLinks;
private static Map<LinkKey, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226
.networks.network.Link> ortopoLinks;
private static Uuid topologyUuid;
.child(Node.class, new NodeKey(new NodeId("SPDR-SC1-XPDR1")));
FluentFuture<Optional<Node>> muxCFuture = dataBroker.newReadOnlyTransaction()
.read(LogicalDatastoreType.CONFIGURATION, muxCIID);
- otnMuxC = muxCFuture.get().get();
+ muxCFuture.get().get();
KeyedInstanceIdentifier<Node, NodeKey> switchIID = InstanceIdentifier.create(Networks.class)
.child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network
.class, new NetworkKey(new NetworkId("otn-topology")))
.augmentation(Network1.class);
FluentFuture<Optional<Network1>> linksFuture = dataBroker.newReadOnlyTransaction()
.read(LogicalDatastoreType.CONFIGURATION, linksIID);
- otnLinks = linksFuture.get().get().getLink();
+ linksFuture.get().get().getLink();
InstanceIdentifier<Network1> links1IID = InstanceIdentifier.create(Networks.class)
.child(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network
assertEquals("otsi node should manage a single protocol layer : PHOTONIC_MEDIA",
1, node.getLayerProtocolName().size());
assertEquals("otsi node should manage a single protocol layer : PHOTONIC_MEDIA",
- LayerProtocolName.PHOTONICMEDIA, node.getLayerProtocolName().get(0));
+ LayerProtocolName.PHOTONICMEDIA, node.getLayerProtocolName().stream().findFirst().get());
switch (otsiNodeType) {
case "switch":
3, nep.getSupportedCepLayerProtocolQualifier().size());
assertThat("client nep should support 3 kind of cep",
nep.getSupportedCepLayerProtocolQualifier(),
- hasItems(ODUTYPEODU2.class, ODUTYPEODU2E.class, DIGITALSIGNALTYPE10GigELAN.class));
+ hasItems(ODUTYPEODU2.VALUE, ODUTYPEODU2E.VALUE, DIGITALSIGNALTYPE10GigELAN.VALUE));
assertEquals("client nep should be of DSR protocol type", LayerProtocolName.DSR, nep.getLayerProtocolName());
checkCommonPartOfNep(nep, false);
}
assertThat("eODU nep should support 1, 2 or 3 kind of cep, depending on client port",
nep.getSupportedCepLayerProtocolQualifier().size(), anyOf(is(1), is(2), is(3)));
assertTrue("eODU nep should support 1 kind of cep",
- nep.getSupportedCepLayerProtocolQualifier().stream().anyMatch(splc -> splc.equals(ODUTYPEODU0.class)
- || splc.equals(ODUTYPEODU2.class) || splc.equals(ODUTYPEODU2E.class)
- || splc.equals(ODUTYPEODU4.class)));
+ nep.getSupportedCepLayerProtocolQualifier().stream().anyMatch(splc -> splc.equals(ODUTYPEODU0.VALUE)
+ || splc.equals(ODUTYPEODU2.VALUE) || splc.equals(ODUTYPEODU2E.VALUE)
+ || splc.equals(ODUTYPEODU4.VALUE)));
assertEquals("eODU nep should be of ODU protocol type", LayerProtocolName.ODU, nep.getLayerProtocolName());
checkCommonPartOfNep(nep, withSip);
}
1, nep.getSupportedCepLayerProtocolQualifier().size());
assertThat("network nep should support 1 kind of cep",
nep.getSupportedCepLayerProtocolQualifier(),
- hasItem(ODUTYPEODU4.class));
+ hasItem(ODUTYPEODU4.VALUE));
assertEquals("network nep should be of ODU protocol type", LayerProtocolName.ODU, nep.getLayerProtocolName());
checkCommonPartOfNep(nep, withSip);
}
2, nep.getSupportedCepLayerProtocolQualifier().size());
assertThat("client nep should support 2 kind of cep",
nep.getSupportedCepLayerProtocolQualifier(),
- hasItems(ODUTYPEODU4.class, DIGITALSIGNALTYPE100GigE.class));
+ hasItems(ODUTYPEODU4.VALUE, DIGITALSIGNALTYPE100GigE.VALUE));
assertEquals("client nep should be of DSR protocol type", LayerProtocolName.DSR, nep.getLayerProtocolName());
checkCommonPartOfNep(nep, false);
}
1, nep.getSupportedCepLayerProtocolQualifier().size());
assertThat("client nep should support 2 kind of cep",
nep.getSupportedCepLayerProtocolQualifier(),
- hasItems(DIGITALSIGNALTYPE100GigE.class));
+ hasItems(DIGITALSIGNALTYPE100GigE.VALUE));
assertEquals("client nep should be of DSR protocol type", LayerProtocolName.DSR, nep.getLayerProtocolName());
checkCommonPartOfNep(nep, false);
}
2, nep.getSupportedCepLayerProtocolQualifier().size());
assertThat("OTSi nep should support 2 kind of cep",
nep.getSupportedCepLayerProtocolQualifier(),
- hasItems(PHOTONICLAYERQUALIFIEROMS.class, PHOTONICLAYERQUALIFIEROTSi.class));
+ hasItems(PHOTONICLAYERQUALIFIEROMS.VALUE, PHOTONICLAYERQUALIFIEROTSi.VALUE));
assertEquals("OTSi nep should be of PHOTONIC_MEDIA protocol type",
LayerProtocolName.PHOTONICMEDIA, nep.getLayerProtocolName());
checkCommonPartOfNep(nep, withSip);
1, nep.getSupportedCepLayerProtocolQualifier().size());
assertThat("OTSi nep should support 2 kind of cep",
nep.getSupportedCepLayerProtocolQualifier(),
- hasItems(PHOTONICLAYERQUALIFIEROMS.class));
+ hasItems(PHOTONICLAYERQUALIFIEROMS.VALUE));
assertEquals("OTSi nep should be of PHOTONIC_MEDIA protocol type",
LayerProtocolName.PHOTONICMEDIA, nep.getLayerProtocolName());
checkCommonPartOfNep(nep, withSip);
new NameKey("OMS link name")).getValue());
assertEquals("bad uuid for link", linkUuid, link.getUuid());
assertEquals("oms link should be between 2 nodes of protocol layers PHOTONIC_MEDIA",
- LayerProtocolName.PHOTONICMEDIA.getName(), link.getLayerProtocolName().get(0).getName());
+ LayerProtocolName.PHOTONICMEDIA.getName(),
+ link.getLayerProtocolName().stream().findFirst().get().getName());
assertEquals("otn tapi link should be BIDIRECTIONAL",
ForwardingDirection.BIDIRECTIONAL, link.getDirection());
List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210
new NameKey("XPDR-RDM link name")).getValue());
assertEquals("bad uuid for link", linkUuid, link.getUuid());
assertEquals("oms link should be between 2 nodes of protocol layers PHOTONIC_MEDIA",
- LayerProtocolName.PHOTONICMEDIA.getName(), link.getLayerProtocolName().get(0).getName());
+ LayerProtocolName.PHOTONICMEDIA.getName(),
+ link.getLayerProtocolName().stream().findFirst().get().getName());
assertEquals("otn tapi link should be BIDIRECTIONAL",
ForwardingDirection.BIDIRECTIONAL, link.getDirection());
List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210