2 * Copyright © 2020 Orange Labs, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.transportpce.networkmodel.util;
10 import static org.hamcrest.CoreMatchers.containsString;
11 import static org.hamcrest.CoreMatchers.either;
12 import static org.hamcrest.CoreMatchers.hasItem;
13 import static org.hamcrest.CoreMatchers.hasItems;
14 import static org.hamcrest.CoreMatchers.not;
15 import static org.hamcrest.MatcherAssert.assertThat;
16 import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
17 import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertNotNull;
20 import static org.junit.Assert.assertNull;
21 import static org.junit.Assert.assertTrue;
22 import static org.junit.Assert.fail;
24 import com.google.gson.stream.JsonReader;
25 import java.io.FileReader;
26 import java.io.IOException;
27 import java.io.Reader;
28 import java.nio.charset.StandardCharsets;
29 import java.util.ArrayList;
30 import java.util.HashMap;
31 import java.util.List;
33 import java.util.stream.Collectors;
34 import org.junit.Test;
35 import org.opendaylight.transportpce.networkmodel.dto.TopologyShard;
36 import org.opendaylight.transportpce.networkmodel.util.test.JsonUtil;
37 import org.opendaylight.transportpce.networkmodel.util.test.NetworkmodelTestUtil;
38 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev220630.OtnLinkType;
39 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.Network;
40 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.Mapping;
41 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.MappingBuilder;
42 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.MappingKey;
43 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.network.Nodes;
44 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.network.NodesBuilder;
45 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.network.nodes.NodeInfoBuilder;
46 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Node1;
47 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.TerminationPoint1;
48 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes;
49 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev201211.xpdr.odu.switching.pools.OduSwitchingPools;
50 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev201211.xpdr.odu.switching.pools.odu.switching.pools.NonBlockingList;
51 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmLinkType;
52 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmNodeType;
53 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.OpenroadmTpType;
54 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev211210.xpdr.tp.supported.interfaces.SupportedInterfaceCapability;
55 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev210924.ODU2;
56 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev210924.ODU2e;
57 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev210924.ODU4;
58 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.Link1;
59 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.networks.network.node.SwitchingPools;
60 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If100GE;
61 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If100GEODU4;
62 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If10GE;
63 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If10GEODU2;
64 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.If10GEODU2e;
65 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.IfOCH;
66 import org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.IfOCHOTU4ODU4;
67 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node;
68 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.node.SupportingNode;
69 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.TpId;
70 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link;
71 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.LinkBuilder;
72 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPoint;
73 import org.opendaylight.yangtools.yang.common.QName;
74 import org.opendaylight.yangtools.yang.common.Uint16;
75 import org.opendaylight.yangtools.yang.common.Uint32;
76 import org.slf4j.Logger;
77 import org.slf4j.LoggerFactory;
79 public class OpenRoadmOtnTopologyTest {
81 private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmOtnTopologyTest.class);
82 private Nodes portMappingTpdr;
83 private Nodes portMappingSpdr;
84 private Nodes portMappingBad;
86 public OpenRoadmOtnTopologyTest() {
87 try (Reader reader = new FileReader("src/test/resources/portMapping.json", StandardCharsets.UTF_8);
88 JsonReader portMappingReader = new JsonReader(reader)) {
89 Network portMapping = (Network) JsonUtil.getInstance().getDataObjectFromJson(portMappingReader,
90 QName.create("http://org/opendaylight/transportpce/portmapping", "2022-03-16", "network"));
91 for (Nodes nodes : portMapping.nonnullNodes().values()) {
92 if (nodes.getNodeId().equals("XPDR-A1")) {
93 this.portMappingTpdr = nodes;
95 this.portMappingSpdr = nodes;
98 Map<MappingKey,Mapping> mappingList = new HashMap<>();
99 Mapping mapping = new MappingBuilder().setLogicalConnectionPoint("XPDR0-NETWORK0").build();
100 mappingList.put(mapping.key(),mapping);
101 this.portMappingBad = new NodesBuilder()
102 .setNodeId(this.portMappingTpdr.getNodeId())
103 .setNodeInfo(new NodeInfoBuilder(this.portMappingTpdr.getNodeInfo()).setNodeType(NodeTypes.Ila).build())
104 .setMapping(mappingList)
106 LOG.info("tpdr portMapping = {}", this.portMappingTpdr.toString());
107 LOG.info("spdr portMapping = {}", this.portMappingSpdr.toString());
108 LOG.info("ila portMapping = {}", this.portMappingBad.toString());
109 } catch (IOException e) {
110 LOG.error("Cannot init OpenRoadmOtnTopologyTest ", e);
111 fail("Cannot init OpenRoadmOtnTopologyTest ");
116 public void createTopologyShardForTpdrTest() {
117 TopologyShard topologyShard = OpenRoadmOtnTopology.createTopologyShard(this.portMappingTpdr);
118 assertNotNull("TopologyShard should never be null", topologyShard);
119 assertEquals("Should contain a single node", 1, topologyShard.getNodes().size());
120 assertEquals("Should contain no link", 0, topologyShard.getLinks().size());
121 Node node = topologyShard.getNodes().get(0);
122 assertEquals("XPDR-A1-XPDR1", node.getNodeId().getValue());
123 // tests supporting nodes
124 List<SupportingNode> supportingNodes = node.nonnullSupportingNode().values().stream()
125 .sorted((sn1, sn2) -> sn1.getNetworkRef().getValue().compareTo(sn2.getNetworkRef().getValue()))
126 .collect(Collectors.toList());
127 assertEquals("Should contain 3 supporting nodes", 3, supportingNodes.size());
128 assertEquals("clli-network", supportingNodes.get(0).getNetworkRef().getValue());
129 assertEquals("NodeA", supportingNodes.get(0).getNodeRef().getValue());
130 assertEquals("openroadm-network", supportingNodes.get(1).getNetworkRef().getValue());
131 assertEquals("XPDR-A1", supportingNodes.get(1).getNodeRef().getValue());
132 assertEquals("openroadm-topology", supportingNodes.get(2).getNetworkRef().getValue());
133 assertEquals("XPDR-A1-XPDR1", supportingNodes.get(2).getNodeRef().getValue());
134 assertEquals(OpenroadmNodeType.TPDR, node.augmentation(Node1.class).getNodeType());
138 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.Node1.class)
142 List<TerminationPoint> tps = node.augmentation(
143 org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class)
144 .nonnullTerminationPoint().values().stream()
145 .sorted((tp1, tp2) -> tp1.getTpId().getValue().compareTo(tp2.getTpId().getValue()))
146 .collect(Collectors.toList());
147 assertEquals("node should contain 4 TPs", 4, tps.size());
149 assertEquals("XPDR1-CLIENT1", tps.get(0).getTpId().getValue());
153 .augmentation(TerminationPoint1.class)
154 .getAssociatedConnectionMapTp()
159 "only If100GE interface capabitily expected",
161 tps.get(0).augmentation(
162 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
163 .TerminationPoint1.class)
164 .getTpSupportedInterfaces()
165 .getSupportedInterfaceCapability()
168 If100GE.class.getName(),
169 tps.get(0).augmentation(
170 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
171 .TerminationPoint1.class)
172 .getTpSupportedInterfaces().nonnullSupportedInterfaceCapability()
173 .values().stream().findFirst()
174 .get().getIfCapType().getName());
176 "first TP must be of type client",
177 OpenroadmTpType.XPONDERCLIENT,
178 tps.get(0).augmentation(TerminationPoint1.class).getTpType());
180 assertEquals("XPDR1-NETWORK1", tps.get(2).getTpId().getValue());
183 tps.get(2).augmentation(TerminationPoint1.class)
184 .getAssociatedConnectionMapTp()
189 "only IfOCH interface capabitily expected",
191 tps.get(2).augmentation(
192 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
193 .TerminationPoint1.class)
194 .getTpSupportedInterfaces()
195 .getSupportedInterfaceCapability()
198 IfOCH.class.getName(),
199 tps.get(2).augmentation(
200 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
201 .TerminationPoint1.class)
202 .getTpSupportedInterfaces()
203 .getSupportedInterfaceCapability()
204 .values().stream().findFirst()
209 "the rate should be null",
210 tps.get(2).augmentation(
211 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
212 .TerminationPoint1.class)
213 .getXpdrTpPortConnectionAttributes()
216 "third TP must be of type network",
217 OpenroadmTpType.XPONDERNETWORK,
218 tps.get(2).augmentation(TerminationPoint1.class).getTpType());
222 public void createTopologyShardForSpdrTest() {
223 TopologyShard topologyShard = OpenRoadmOtnTopology.createTopologyShard(this.portMappingSpdr);
224 assertNotNull("TopologyShard should never be null", topologyShard);
225 assertEquals("Should contain two nodes", 2, topologyShard.getNodes().size());
226 assertEquals("Should contain no link", 0, topologyShard.getLinks().size());
227 List<Node> nodes = topologyShard.getNodes().stream()
228 .sorted((n1, n2) -> n1.getNodeId().getValue().compareTo(n2.getNodeId().getValue()))
229 .collect(Collectors.toList());
230 for (Node node : nodes) {
236 public void createOtnLinksForOTU4NormalTest() {
237 String nodeA = "SPDRA";
238 String tpA = "XPDR1-NETWORK1";
239 String nodeZ = "SPDRZ";
240 String tpZ = "XPDR1-NETWORK1";
241 List<Link> links = OpenRoadmOtnTopology.createOtnLinks(nodeA, tpA, nodeZ, tpZ, OtnLinkType.OTU4).getLinks();
242 assertEquals("2 OTU4 links should have been created", 2, links.size());
243 List<Link> sortedLinks = links.stream()
244 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
245 .collect(Collectors.toList());
247 "name of OTU4 linkid AZ",
248 "OTU4-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1",
249 sortedLinks.get(0).getLinkId().getValue());
251 "name of OTU4 linkid ZA",
252 "OTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
253 sortedLinks.get(1).getLinkId().getValue());
254 assertEquals("SPDRA-XPDR1", sortedLinks.get(0).getSource().getSourceNode().getValue());
255 assertEquals("SPDRZ-XPDR1", sortedLinks.get(0).getDestination().getDestNode().getValue());
256 assertEquals("SPDRZ-XPDR1", sortedLinks.get(1).getSource().getSourceNode().getValue());
257 assertEquals("SPDRA-XPDR1", sortedLinks.get(1).getDestination().getDestNode().getValue());
259 "available BW at OTU4 creation should be 100G (100000)",
260 Uint32.valueOf(100000),
261 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth());
263 "used BW at OTU4 creation should be 0",
265 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth());
267 OpenroadmLinkType.OTNLINK,
268 sortedLinks.get(0).augmentation(
269 org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Link1.class)
272 "opposite link must be present",
273 "OTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
274 sortedLinks.get(0).augmentation(
275 org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Link1.class)
279 "otn link type should be OTU4",
281 sortedLinks.get(0).augmentation(
282 org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev220630.Link1.class)
287 public void createOtnLinksForNotManagedOtnlinktypeTest() {
288 String nodeA = "SPDRA";
289 String tpA = "XPDR1-NETWORK1";
290 String nodeZ = "SPDRZ";
291 String tpZ = "XPDR1-NETWORK1";
292 TopologyShard topoShard = OpenRoadmOtnTopology.createOtnLinks(nodeA, tpA, nodeZ, tpZ, OtnLinkType.ODU0);
293 assertNotNull("TopologyShard should never be null", topoShard);
294 assertNull("TopologyShard should not contain any node", topoShard.getNodes());
295 assertNull("TopologyShard should not contain any link", topoShard.getLinks());
299 public void createOtnLinksForODU4NormalTest() {
300 TopologyShard topoShard = OpenRoadmOtnTopology
302 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(100000)),
303 NetworkmodelTestUtil.createTpList(false), OtnLinkType.ODTU4);
304 assertNotNull("TopologyShard should never be null", topoShard);
305 assertNull("list of nodes should be null", topoShard.getNodes());
306 List<Link> sortedLinks = topoShard.getLinks().stream()
307 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
308 .collect(Collectors.toList());
309 assertEquals("list of links should contain 4 links", 4, sortedLinks.size());
310 assertTrue("link 3 should be of type OTU4", sortedLinks.get(2).getLinkId().getValue().startsWith("OTU4-"));
312 "after odu4 creation, available BW of supported OTU4 should be 0",
314 sortedLinks.get(2).augmentation(Link1.class).getAvailableBandwidth());
316 "after odu4 creation, used BW of supported OTU4 should be 100 000",
317 Uint32.valueOf(100000),
318 sortedLinks.get(2).augmentation(Link1.class).getUsedBandwidth());
321 "ODTU4-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1",
322 sortedLinks.get(0).getLinkId().getValue());
324 "ODTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
325 sortedLinks.get(1).getLinkId().getValue());
326 assertEquals("SPDRA-XPDR1", sortedLinks.get(0).getSource().getSourceNode().getValue());
327 assertEquals("SPDRZ-XPDR1", sortedLinks.get(0).getDestination().getDestNode().getValue());
328 assertEquals("SPDRZ-XPDR1", sortedLinks.get(1).getSource().getSourceNode().getValue());
329 assertEquals("SPDRA-XPDR1", sortedLinks.get(1).getDestination().getDestNode().getValue());
331 "after odu4 creation, its available BW should be 100 000",
332 Uint32.valueOf(100000),
333 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth());
335 "after odu4 creation, its used BW should be 0",
337 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth());
339 OpenroadmLinkType.OTNLINK,
342 org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Link1.class)
345 "opposite link must be present",
346 "ODTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
349 org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.Link1.class)
353 "otn link type should be ODTU4",
356 .augmentation(org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev220630
360 assertEquals("list of TPs should contain 2 updated TPs", 2, topoShard.getTps().size());
362 "after ODU4 creation, its termination point should contain a TsPool list",
363 topoShard.getTps().get(0)
365 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
366 .TerminationPoint1.class)
367 .getXpdrTpPortConnectionAttributes()
370 "Ts pool list should be full, with 80 trib slots",
372 topoShard.getTps().get(0)
374 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
375 .TerminationPoint1.class)
376 .getXpdrTpPortConnectionAttributes()
380 "after ODU4 creation, its termination point should contain a TpnPool list",
381 topoShard.getTps().get(0)
383 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
384 .TerminationPoint1.class)
385 .getXpdrTpPortConnectionAttributes()
386 .getOdtuTpnPool().values().stream().findFirst()
390 "Tpn pool list should be full, with 80 trib ports",
392 topoShard.getTps().get(0)
394 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
395 .TerminationPoint1.class)
396 .getXpdrTpPortConnectionAttributes()
397 .getOdtuTpnPool().values().stream().findFirst()
404 public void createOtnLinksForODU4WhenOTU4HaveBadBWParamsTest() {
405 List<Link> otu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(100000));
406 List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
407 for (Link link : otu4Links) {
408 otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
410 TopologyShard topoShard =
411 OpenRoadmOtnTopology.createOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(false),
413 assertNotNull("TopologyShard should never be null", topoShard);
414 assertNull("list of nodes should be null", topoShard.getNodes());
415 assertNull("list of links should be null", topoShard.getLinks());
416 assertNull("list of tps should be null", topoShard.getTps());
418 otu4LinksWithBadBWParam.clear();
420 OpenRoadmOtnTopology.createOtnLinks(
421 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(99000)),
422 NetworkmodelTestUtil.createTpList(false), OtnLinkType.OTU4);
423 assertNull("list of nodes should be null", topoShard.getNodes());
424 assertNull("list of links should be null", topoShard.getLinks());
425 assertNull("list of tps should be null", topoShard.getTps());
429 public void deleteOtnLinksForODU4NormalTest() {
430 TopologyShard topoShard =
431 OpenRoadmOtnTopology.deleteOtnLinks(
432 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(0)),
433 NetworkmodelTestUtil.createTpList(true), OtnLinkType.OTU4);
434 assertNotNull("TopologyShard should never be null", topoShard);
435 assertEquals("list of links should contain 2 links", 2, topoShard.getLinks().size());
437 "after ODU4 deletion, available BW of supported OTU4 should be 100 000",
438 Uint32.valueOf(100000),
439 topoShard.getLinks().get(0).augmentation(Link1.class).getAvailableBandwidth());
441 "after ODU4 deletion, used BW of supported OTU4 should be 0",
443 topoShard.getLinks().get(0).augmentation(Link1.class).getUsedBandwidth());
445 assertEquals("list of TPs should contain 2 updated TPs", 2, topoShard.getTps().size());
447 "after ODU4 deletion, its termination points should not contain any TsPool list",
448 topoShard.getTps().get(0)
450 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
451 .TerminationPoint1.class)
452 .getXpdrTpPortConnectionAttributes()
455 "after ODU4 deletion, its termination points should not contain any TpnPool list",
456 topoShard.getTps().get(0)
458 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
459 .TerminationPoint1.class)
460 .getXpdrTpPortConnectionAttributes()
465 public void deleteOtnLinksForODU4WhenOTU4HaveBadBWParamsTest() {
466 List<Link> otu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(0));
467 List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
468 for (Link link : otu4Links) {
469 otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
471 TopologyShard topoShard =
472 OpenRoadmOtnTopology.deleteOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(true),
474 assertNotNull("TopologyShard should never be null", topoShard);
475 assertNull("list of nodes should be null", topoShard.getNodes());
476 assertNull("list of links should be null", topoShard.getLinks());
477 assertNull("list of tps should be null", topoShard.getTps());
481 public void updateOtnLinksFor10GTest() {
482 // tests update for 10G creation
483 TopologyShard topoShard =
484 OpenRoadmOtnTopology.updateOtnLinks(
485 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
486 NetworkmodelTestUtil.createTpList(true),
487 Uint32.valueOf(10), (short)1, (short)1, (short)8, false);
488 assertNotNull("TopologyShard should never be null", topoShard);
489 assertNull("list of nodes should be null", topoShard.getNodes());
490 List<Link> sortedLinks = topoShard.getLinks().stream()
491 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
492 .collect(Collectors.toList());
493 assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
494 assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
496 "after 10G creation, available BW of supported ODU4 should be 90000",
497 Uint32.valueOf(90000),
498 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth());
500 "after 10G creation, used BW of supported ODU4 should be 10000",
501 Uint32.valueOf(10000),
502 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth());
505 "after 10G creation, 8 (over 80) trib slot should be occupied",
507 topoShard.getTps().get(0)
509 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
510 .TerminationPoint1.class)
511 .getXpdrTpPortConnectionAttributes()
515 "trib slot 1-8 should no longer be present in Trib slot list",
516 topoShard.getTps().get(0)
518 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
519 .TerminationPoint1.class)
520 .getXpdrTpPortConnectionAttributes()
522 not(hasItems(Uint16.valueOf(1), Uint16.valueOf(8))));
524 "trib slot 9 should always be present in trib slot list",
525 topoShard.getTps().get(0)
527 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
528 .TerminationPoint1.class)
529 .getXpdrTpPortConnectionAttributes()
531 hasItem(Uint16.valueOf(9)));
533 "after 10G creation, 1 (over 80) trib port should be occupied",
535 topoShard.getTps().get(0)
537 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
538 .TerminationPoint1.class)
539 .getXpdrTpPortConnectionAttributes()
540 .getOdtuTpnPool().values().stream().findFirst()
545 "trib port 1 should no longer be present",
546 topoShard.getTps().get(0)
548 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
549 .TerminationPoint1.class)
550 .getXpdrTpPortConnectionAttributes()
551 .getOdtuTpnPool().values().stream().findFirst()
554 not(hasItem(Uint16.valueOf(1))));
556 // tests update for 10G deletion
558 topoShard = OpenRoadmOtnTopology.updateOtnLinks(topoShard.getLinks(), topoShard.getTps(), Uint32.valueOf(10),
559 (short)1, (short)1, (short)8, true);
560 sortedLinks = topoShard.getLinks().stream()
561 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
562 .collect(Collectors.toList());
563 assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
564 assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
566 "after 10G deletion, available BW of supported ODU4 should be 100 000",
567 Uint32.valueOf(100000),
568 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth());
570 "after 10G deletion, used BW of supported ODU4 should be 0",
572 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth());
575 "after 10G deletion, trib slot list should be full",
577 topoShard.getTps().get(0)
579 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
580 .TerminationPoint1.class)
581 .getXpdrTpPortConnectionAttributes()
585 "after 10G deletion, trib slot list should contain items 1-8",
586 topoShard.getTps().get(0)
588 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
589 .TerminationPoint1.class)
590 .getXpdrTpPortConnectionAttributes()
592 hasItems(Uint16.valueOf(1), Uint16.valueOf(8), Uint16.valueOf(9)));
594 "after 10G deletion, trib port list should be full",
596 topoShard.getTps().get(0)
598 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
599 .TerminationPoint1.class)
600 .getXpdrTpPortConnectionAttributes()
601 .getOdtuTpnPool().values().stream().findFirst()
606 "after 10G deletion, trib port list should contain items 1",
607 topoShard.getTps().get(0)
609 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
610 .TerminationPoint1.class)
611 .getXpdrTpPortConnectionAttributes()
612 .getOdtuTpnPool().values().stream().findFirst()
615 hasItem(Uint16.valueOf(1)));
619 public void updateOtnLinksFor1GCreationTest() {
620 // tests update for 1G creation
621 TopologyShard topoShard =
622 OpenRoadmOtnTopology.updateOtnLinks(
623 NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
624 NetworkmodelTestUtil.createTpList(true),
625 Uint32.valueOf(1), (short)1, (short)1, (short)1, false);
626 assertNotNull("TopologyShard should never be null", topoShard);
627 assertNull("list of nodes should be null", topoShard.getNodes());
628 List<Link> sortedLinks = topoShard.getLinks().stream()
629 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
630 .collect(Collectors.toList());
631 assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
632 assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
634 "after 1G creation, available BW of supported ODU4 should be 99000",
635 Uint32.valueOf(99000),
636 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth());
638 "after 1G creation, used BW of supported ODU4 should be 1000",
639 Uint32.valueOf(1000),
640 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth());
643 "after 1G creation, 1 (over 80) trib slot should be occupied",
645 topoShard.getTps().get(0)
647 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
648 .TerminationPoint1.class)
649 .getXpdrTpPortConnectionAttributes()
653 "trib slot 1 should no longer be present in Trib slot list",
654 topoShard.getTps().get(0)
656 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
657 .TerminationPoint1.class)
658 .getXpdrTpPortConnectionAttributes()
660 not(hasItem(Uint16.valueOf(1))));
662 "trib slot 2 should always be present in Trib slot list",
663 topoShard.getTps().get(0)
665 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
666 .TerminationPoint1.class)
667 .getXpdrTpPortConnectionAttributes().getTsPool(),
668 hasItem(Uint16.valueOf(2)));
670 "after 1G creation, 1 (over 80) trib port should be occupied",
672 topoShard.getTps().get(0)
674 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
675 .TerminationPoint1.class)
676 .getXpdrTpPortConnectionAttributes()
677 .getOdtuTpnPool().values().stream().findFirst()
682 "trib port 1 should no longer be present in Trib port list",
683 topoShard.getTps().get(0)
685 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
686 .TerminationPoint1.class)
687 .getXpdrTpPortConnectionAttributes()
688 .getOdtuTpnPool().values().stream().findFirst()
691 not(hasItem(Uint16.valueOf(1))));
693 // tests update for 1G deletion
696 OpenRoadmOtnTopology.updateOtnLinks(
697 topoShard.getLinks(),
699 Uint32.valueOf(1), (short)1, (short)1, (short)1, true);
700 sortedLinks = topoShard.getLinks().stream()
701 .sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
702 .collect(Collectors.toList());
703 assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
704 assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
706 "after 1G deletion, available BW of supported ODU4 should be 100 000",
707 Uint32.valueOf(100000),
708 sortedLinks.get(0).augmentation(Link1.class).getAvailableBandwidth());
710 "after 1G deletion, used BW of supported ODU4 should be 0",
712 sortedLinks.get(0).augmentation(Link1.class).getUsedBandwidth());
715 "after 1G deletion, trib slot list should be full",
717 topoShard.getTps().get(0)
719 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
720 .TerminationPoint1.class)
721 .getXpdrTpPortConnectionAttributes()
725 "after 1G deletion, trib slot list should contain items 1 and 2",
726 topoShard.getTps().get(0)
728 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
729 .TerminationPoint1.class)
730 .getXpdrTpPortConnectionAttributes()
732 hasItems(Uint16.valueOf(1), Uint16.valueOf(2)));
734 "after 1G deletion, trib port list should be full",
736 topoShard.getTps().get(0)
738 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
739 .TerminationPoint1.class)
740 .getXpdrTpPortConnectionAttributes()
741 .getOdtuTpnPool().values().stream().findFirst()
746 "after 1G deletion, trib port list should contain items 1",
747 topoShard.getTps().get(0)
749 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
750 .TerminationPoint1.class)
751 .getXpdrTpPortConnectionAttributes()
752 .getOdtuTpnPool().values().stream().findFirst()
755 hasItem(Uint16.valueOf(1)));
759 public void updateOtnLinksForODU4WhenBWParamsNotPresentTest() {
760 List<Link> odu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000));
761 List<Link> odu4LinksWithBadBWParam = new ArrayList<>();
762 for (Link link : odu4Links) {
763 odu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
765 TopologyShard topoShard =
766 OpenRoadmOtnTopology.updateOtnLinks(
767 odu4LinksWithBadBWParam,
768 NetworkmodelTestUtil.createTpList(true),
769 Uint32.valueOf(1), (short)1, (short)1, (short)10, false);
770 assertNotNull("TopologyShard should never be null", topoShard);
771 assertNull("list of nodes should be null", topoShard.getNodes());
772 assertNull("list of links should be null", topoShard.getLinks());
773 assertNull("list of tps should be null", topoShard.getTps());
777 public void updateOtnLinksForODU4WhenAvailBWNotSufficientTest() {
778 List<Link> odu4LinksWithBadBWParam = NetworkmodelTestUtil
779 .createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(8000));
780 TopologyShard topoShard =
781 OpenRoadmOtnTopology.updateOtnLinks(
782 odu4LinksWithBadBWParam,
783 NetworkmodelTestUtil.createTpList(true),
784 Uint32.valueOf(10), (short)1, (short)1, (short)10, false);
785 assertNotNull("TopologyShard should never be null", topoShard);
786 assertNull("list of nodes should be null", topoShard.getNodes());
787 assertNull("list of links should be null", topoShard.getLinks());
788 assertNull("list of tps should be null", topoShard.getTps());
791 private void checkSpdrNode(Node node) {
793 .augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.Node1.class)
794 .getXpdrAttributes().getXpdrNumber();
795 assertEquals("SPDR-SA1-XPDR" + xpdrNb, node.getNodeId().getValue());
796 if (xpdrNb.equals(Uint16.valueOf(1))) {
797 assertEquals(OpenroadmNodeType.MUXPDR, node.augmentation(Node1.class).getNodeType());
798 } else if (xpdrNb.equals(Uint16.valueOf(2))) {
799 assertEquals(OpenroadmNodeType.SWITCH, node.augmentation(Node1.class).getNodeType());
801 // tests supporting nodes
802 List<SupportingNode> supportingNodes = node.nonnullSupportingNode().values().stream()
803 .sorted((sn1, sn2) -> sn1.getNetworkRef().getValue().compareTo(sn2.getNetworkRef().getValue()))
804 .collect(Collectors.toList());
805 assertEquals("Should contain 3 supporting nodes", 3, supportingNodes.size());
806 assertEquals("clli-network", supportingNodes.get(0).getNetworkRef().getValue());
807 assertEquals("NodeSA", supportingNodes.get(0).getNodeRef().getValue());
808 assertEquals("openroadm-network", supportingNodes.get(1).getNetworkRef().getValue());
809 assertEquals("SPDR-SA1", supportingNodes.get(1).getNodeRef().getValue());
810 assertEquals("openroadm-topology", supportingNodes.get(2).getNetworkRef().getValue());
811 assertEquals("SPDR-SA1-XPDR" + xpdrNb, supportingNodes.get(2).getNodeRef().getValue());
812 checkSpdrSwitchingPools(
815 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210.Node1.class)
816 .getSwitchingPools());
817 List<TerminationPoint> tpList = node.augmentation(
818 org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class)
819 .nonnullTerminationPoint().values().stream()
820 .sorted((tp1, tp2) -> tp1.getTpId().getValue().compareTo(tp2.getTpId().getValue()))
821 .collect(Collectors.toList());
822 checkSpdrTpList(xpdrNb, tpList);
825 private void checkSpdrSwitchingPools(Uint16 xpdrNb, SwitchingPools sp) {
826 List<OduSwitchingPools> oduSwitchingPools = new ArrayList<>(sp.nonnullOduSwitchingPools().values());
828 "switching-pools augmentation should contain a single odu-switching-pools",
830 oduSwitchingPools.size());
832 "switching-pool-number should be 1",
834 oduSwitchingPools.get(0).getSwitchingPoolNumber());
836 "switching-pool-type should be non-blocking",
838 oduSwitchingPools.get(0).getSwitchingPoolType().getName());
840 List<NonBlockingList> nonBlockingList =
841 new ArrayList<>(oduSwitchingPools.get(0).nonnullNonBlockingList().values());
842 if (xpdrNb.equals(Uint16.valueOf(1))) {
844 "Mux should contain 4 non blocking list",
846 nonBlockingList.size());
849 nonBlockingList.get(0).getNblNumber());
850 List<NonBlockingList> nblList = oduSwitchingPools.get(0).nonnullNonBlockingList().values().stream()
851 .sorted((nbl1, nbl2) -> nbl1.getNblNumber().compareTo(nbl2.getNblNumber()))
852 .collect(Collectors.toList());
853 for (NonBlockingList nbl : nblList) {
855 "for a 10G mux, interconnect BW should be 10G",
857 nbl.getAvailableInterconnectBandwidth());
858 assertEquals(Uint32.valueOf(1000000000), nbl.getInterconnectBandwidthUnit());
860 "for a 10G mux, non blocking list should contain 2 entries (client + network ports)",
863 String nb = nbl.getNblNumber().toString();
866 containsInAnyOrder(new TpId("XPDR1-NETWORK1"),
867 new TpId("XPDR1-CLIENT" + nb)));
869 } else if (xpdrNb.equals(Uint16.valueOf(2))) {
871 "Switch should contain a single non blocking list",
873 nonBlockingList.size());
876 nonBlockingList.get(0).getNblNumber());
878 "for a 100G Switch, non blocking list should contain 8 entries (4 clients + 4 network ports)",
879 nonBlockingList.get(0).getTpList(),
882 nonBlockingList.get(0).getTpList(),
884 new TpId("XPDR2-CLIENT1"), new TpId("XPDR2-NETWORK1"), new TpId("XPDR2-CLIENT2"),
885 new TpId("XPDR2-NETWORK2"), new TpId("XPDR2-CLIENT3"), new TpId("XPDR2-NETWORK3"),
886 new TpId("XPDR2-CLIENT4"), new TpId("XPDR2-NETWORK4")));
890 private void checkSpdrTpList(Uint16 xpdrNb, List<TerminationPoint> tpList) {
891 LOG.info("tpList = {}", tpList);
893 "only IfOCHOTU4ODU4 interface capabitily expected",
897 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
898 .TerminationPoint1.class)
899 .getTpSupportedInterfaces()
900 .getSupportedInterfaceCapability().values().stream().findFirst()
904 "the rate should be ODU4",
908 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
909 .TerminationPoint1.class)
910 .getXpdrTpPortConnectionAttributes()
913 "openroadm-topology",
914 tpList.get(4).getSupportingTerminationPoint().values().stream().findFirst()
915 .get().getNetworkRef().getValue());
917 "SPDR-SA1-XPDR" + xpdrNb,
918 tpList.get(4).getSupportingTerminationPoint().values().stream().findFirst()
919 .get().getNodeRef().getValue());
921 "XPDR" + xpdrNb + "-NETWORK1",
922 tpList.get(4).getSupportingTerminationPoint().values().stream().findFirst()
923 .get().getTpRef().getValue());
924 if (xpdrNb.equals(Uint16.valueOf(1))) {
925 assertEquals("should contain 5 TPs", 5, tpList.size());
926 assertEquals("XPDR1-CLIENT1", tpList.get(0).getTpId().getValue());
927 assertEquals("XPDR1-CLIENT2", tpList.get(1).getTpId().getValue());
928 assertEquals("XPDR1-NETWORK1", tpList.get(4).getTpId().getValue());
930 "supported interface capability of tp-id XPDR1-CLIENT2 should contain 2 if-cap-type",
934 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
935 .TerminationPoint1.class)
936 .getTpSupportedInterfaces()
937 .getSupportedInterfaceCapability().values().size());
939 "supported interface capability of tp-id XPDR1-CLIENT3 should contain 3 if-cap-type",
943 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
944 .TerminationPoint1.class)
945 .getTpSupportedInterfaces()
946 .getSupportedInterfaceCapability().values().size());
947 List<SupportedInterfaceCapability> sicListClient1 = tpList.get(0)
949 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
950 .TerminationPoint1.class)
951 .getTpSupportedInterfaces()
952 .getSupportedInterfaceCapability().values().stream().collect(Collectors.toList());
953 for (SupportedInterfaceCapability supportedInterfaceCapability : sicListClient1) {
954 assertThat("tp should have 2 if-cap-type: if-10GE-ODU2e, if-10GE-ODU2",
955 String.valueOf(supportedInterfaceCapability.getIfCapType()),
956 either(containsString(String.valueOf(If10GEODU2e.class)))
957 .or(containsString(String.valueOf(If10GEODU2.class))));
959 List<SupportedInterfaceCapability> sicListClient3 = tpList.get(3)
961 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
962 .TerminationPoint1.class)
963 .getTpSupportedInterfaces()
964 .getSupportedInterfaceCapability().values().stream().collect(Collectors.toList());
965 for (SupportedInterfaceCapability supportedInterfaceCapability : sicListClient3) {
966 assertThat("tp should have 3 if-cap-type: if-10GE-ODU2e, if-10GE-ODU2, if-10GE",
967 String.valueOf(supportedInterfaceCapability.getIfCapType()),
968 either(containsString(String.valueOf(If10GEODU2e.class)))
969 .or(containsString(String.valueOf(If10GEODU2.class)))
970 .or(containsString(String.valueOf(If10GE.class))));
972 assertThat("the rate should be ODU2 or ODU2e",
973 String.valueOf(tpList.get(2)
975 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
976 .TerminationPoint1.class)
977 .getXpdrTpPortConnectionAttributes()
979 either(containsString(String.valueOf(ODU2e.class)))
980 .or(containsString(String.valueOf(ODU2.class))));
982 "TP should be of type client",
983 OpenroadmTpType.XPONDERCLIENT,
984 tpList.get(2).augmentation(TerminationPoint1.class).getTpType());
986 "TP should be of type network",
987 OpenroadmTpType.XPONDERNETWORK,
988 tpList.get(4).augmentation(TerminationPoint1.class).getTpType());
989 } else if (xpdrNb.equals(Uint16.valueOf(2))) {
990 assertEquals("should contain 8 TPs", 8, tpList.size());
991 assertEquals("XPDR2-CLIENT1", tpList.get(0).getTpId().getValue());
992 assertEquals("XPDR2-CLIENT2", tpList.get(1).getTpId().getValue());
993 assertEquals("XPDR2-NETWORK1", tpList.get(4).getTpId().getValue());
994 assertEquals("XPDR2-NETWORK2", tpList.get(5).getTpId().getValue());
996 "only IfOCHOTU4ODU4 interface capabitily expected",
1000 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
1001 .TerminationPoint1.class)
1002 .getTpSupportedInterfaces()
1003 .getSupportedInterfaceCapability().values().stream().findFirst()
1007 "supported interface capability of tp should contain 2 IfCapType",
1011 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
1012 .TerminationPoint1.class)
1013 .getTpSupportedInterfaces()
1014 .getSupportedInterfaceCapability().values().size());
1015 List<SupportedInterfaceCapability> sicListClient3 = tpList.get(2)
1017 org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev211210
1018 .TerminationPoint1.class)
1019 .getTpSupportedInterfaces()
1020 .getSupportedInterfaceCapability().values().stream().collect(Collectors.toList());
1021 for (SupportedInterfaceCapability supportedInterfaceCapability : sicListClient3) {
1022 assertThat("tp should have 2 if-cap-type: if-100GE-ODU4, if-100GE",
1023 String.valueOf(supportedInterfaceCapability.getIfCapType()),
1024 either(containsString(String.valueOf(If100GEODU4.class)))
1025 .or(containsString(String.valueOf(If100GE.class))));
1028 "TP should be of type client", OpenroadmTpType.XPONDERCLIENT,
1029 tpList.get(2).augmentation(TerminationPoint1.class).getTpType());
1031 "TP should be of type network", OpenroadmTpType.XPONDERNETWORK,
1032 tpList.get(6).augmentation(TerminationPoint1.class).getTpType());