import org.opendaylight.transportpce.networkmodel.dto.TopologyShard;
import org.opendaylight.transportpce.networkmodel.util.test.JsonUtil;
import org.opendaylight.transportpce.networkmodel.util.test.NetworkmodelTestUtil;
import org.opendaylight.transportpce.networkmodel.dto.TopologyShard;
import org.opendaylight.transportpce.networkmodel.util.test.JsonUtil;
import org.opendaylight.transportpce.networkmodel.util.test.NetworkmodelTestUtil;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.Network;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.mapping.Mapping;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.mapping.MappingBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.mapping.MappingKey;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.network.Nodes;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.network.NodesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.network.nodes.NodeInfoBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.Network;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.mapping.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.mapping.MappingBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.mapping.MappingKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.network.NodesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.network.nodes.NodeInfoBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Node1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev200327.xpdr.odu.switching.pools.OduSwitchingPools;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Node1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev200327.xpdr.odu.switching.pools.OduSwitchingPools;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.If10GEODU2e;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.IfOCH;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.IfOCHOTU4ODU4;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.If10GEODU2e;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.IfOCH;
import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev200327.IfOCHOTU4ODU4;
-import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev201019.OtnLinkType;
-import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev201019.TerminationPoint1;
+import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.OtnLinkType;
+import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.TerminationPoint1;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.node.SupportingNode;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.TpId;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.node.SupportingNode;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.TpId;
try (Reader reader = new FileReader("src/test/resources/portMapping.json", StandardCharsets.UTF_8);
JsonReader portMappingReader = new JsonReader(reader)) {
Network portMapping = (Network) JsonUtil.getInstance().getDataObjectFromJson(portMappingReader,
try (Reader reader = new FileReader("src/test/resources/portMapping.json", StandardCharsets.UTF_8);
JsonReader portMappingReader = new JsonReader(reader)) {
Network portMapping = (Network) JsonUtil.getInstance().getDataObjectFromJson(portMappingReader,
for (Nodes nodes : portMapping.nonnullNodes().values()) {
if (nodes.getNodeId().equals("XPDR-A1")) {
this.portMappingTpdr = nodes;
for (Nodes nodes : portMapping.nonnullNodes().values()) {
if (nodes.getNodeId().equals("XPDR-A1")) {
this.portMappingTpdr = nodes;
"otn link type should be OTU4",
OtnLinkType.OTU4,
sortedLinks.get(0).augmentation(
"otn link type should be OTU4",
OtnLinkType.OTU4,
sortedLinks.get(0).augmentation(
- NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, 100000),
- NetworkmodelTestUtil.createTpList(false));
+ NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(100000)),
+ NetworkmodelTestUtil.createTpList(false), OtnLinkType.ODTU4);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
sortedLinks.get(1).getLinkId().getValue());
assertEquals("SPDRA-XPDR1", sortedLinks.get(0).getSource().getSourceNode().getValue());
assertEquals("SPDRZ-XPDR1", sortedLinks.get(0).getDestination().getDestNode().getValue());
sortedLinks.get(1).getLinkId().getValue());
assertEquals("SPDRA-XPDR1", sortedLinks.get(0).getSource().getSourceNode().getValue());
assertEquals("SPDRZ-XPDR1", sortedLinks.get(0).getDestination().getDestNode().getValue());
List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
for (Link link : otu4Links) {
otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
}
TopologyShard topoShard =
List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
for (Link link : otu4Links) {
otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
}
TopologyShard topoShard =
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
- NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, 99000),
- NetworkmodelTestUtil.createTpList(false));
+ NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(99000)),
+ NetworkmodelTestUtil.createTpList(false), OtnLinkType.OTU4);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
assertNull("list of tps should be null", topoShard.getTps());
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
assertNull("list of tps should be null", topoShard.getTps());
public void deleteOtnLinksForODU4NormalTest() {
TopologyShard topoShard =
OpenRoadmOtnTopology.deleteOtnLinks(
public void deleteOtnLinksForODU4NormalTest() {
TopologyShard topoShard =
OpenRoadmOtnTopology.deleteOtnLinks(
- NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, 0),
- NetworkmodelTestUtil.createTpList(true));
+ NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(0)),
+ NetworkmodelTestUtil.createTpList(true), OtnLinkType.OTU4);
assertNotNull("TopologyShard should never be null", topoShard);
assertEquals("list of links should contain 2 links", 2, topoShard.getLinks().size());
assertEquals(
assertNotNull("TopologyShard should never be null", topoShard);
assertEquals("list of links should contain 2 links", 2, topoShard.getLinks().size());
assertEquals(
List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
for (Link link : otu4Links) {
otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
}
TopologyShard topoShard =
List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
for (Link link : otu4Links) {
otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
}
TopologyShard topoShard =
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
// tests update for 10G creation
TopologyShard topoShard =
OpenRoadmOtnTopology.updateOtnLinks(
// tests update for 10G creation
TopologyShard topoShard =
OpenRoadmOtnTopology.updateOtnLinks(
- "10G", (short)1, (short)1, false);
+ Uint32.valueOf(10), (short)1, (short)1, (short)8, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
- topoShard = OpenRoadmOtnTopology.updateOtnLinks(topoShard.getLinks(), topoShard.getTps(), "10G", (short)1,
- (short)1, true);
+ topoShard = OpenRoadmOtnTopology.updateOtnLinks(topoShard.getLinks(), topoShard.getTps(), Uint32.valueOf(10),
+ (short)1, (short)1, (short)8, true);
sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
// tests update for 1G creation
TopologyShard topoShard =
OpenRoadmOtnTopology.updateOtnLinks(
// tests update for 1G creation
TopologyShard topoShard =
OpenRoadmOtnTopology.updateOtnLinks(
- "1G", (short)1, (short)1, false);
+ Uint32.valueOf(1), (short)1, (short)1, (short)1, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
- "1G", (short)1, (short)1, true);
+ Uint32.valueOf(1), (short)1, (short)1, (short)1, true);
sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
List<Link> odu4LinksWithBadBWParam = new ArrayList<>();
for (Link link : odu4Links) {
odu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
List<Link> odu4LinksWithBadBWParam = new ArrayList<>();
for (Link link : odu4Links) {
odu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
OpenRoadmOtnTopology.updateOtnLinks(
odu4LinksWithBadBWParam,
NetworkmodelTestUtil.createTpList(true),
OpenRoadmOtnTopology.updateOtnLinks(
odu4LinksWithBadBWParam,
NetworkmodelTestUtil.createTpList(true),
- "1G", (short)1, (short)1, false);
+ Uint32.valueOf(1), (short)1, (short)1, (short)10, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
- List<Link> odu4LinksWithBadBWParam = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, 8000);
+ List<Link> odu4LinksWithBadBWParam = NetworkmodelTestUtil
+ .createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(8000));
TopologyShard topoShard =
OpenRoadmOtnTopology.updateOtnLinks(
odu4LinksWithBadBWParam,
NetworkmodelTestUtil.createTpList(true),
TopologyShard topoShard =
OpenRoadmOtnTopology.updateOtnLinks(
odu4LinksWithBadBWParam,
NetworkmodelTestUtil.createTpList(true),
- "10G", (short)1, (short)1, false);
+ Uint32.valueOf(10), (short)1, (short)1, (short)10, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
assertEquals(
"XPDR" + xpdrNb + "-NETWORK1",
tpList.get(4).getSupportingTerminationPoint().values().stream().findFirst()
assertEquals(
"XPDR" + xpdrNb + "-NETWORK1",
tpList.get(4).getSupportingTerminationPoint().values().stream().findFirst()
if (xpdrNb.equals(Uint16.valueOf(1))) {
assertEquals("should contain 5 TPs", 5, tpList.size());
assertEquals("XPDR1-CLIENT1", tpList.get(0).getTpId().getValue());
if (xpdrNb.equals(Uint16.valueOf(1))) {
assertEquals("should contain 5 TPs", 5, tpList.size());
assertEquals("XPDR1-CLIENT1", tpList.get(0).getTpId().getValue());
.or(containsString(String.valueOf(If10GEODU2.class)))
.or(containsString(String.valueOf(If10GE.class))));
}
.or(containsString(String.valueOf(If10GEODU2.class)))
.or(containsString(String.valueOf(If10GE.class))));
}
String.valueOf(tpList.get(2)
.augmentation(
org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529
String.valueOf(tpList.get(2)
.augmentation(
org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529