Light refactor on PceOpticalNode 48/94548/7
authormanuedelf <emmanuelle.delfour@orange.com>
Wed, 25 Nov 2020 19:28:15 +0000 (20:28 +0100)
committermanuedelf <emmanuelle.delfour@orange.com>
Sat, 9 Jan 2021 14:41:35 +0000 (15:41 +0100)
- remove useless class attributes
- simplify case SRGTXRXPP in initSrgTps method

Signed-off-by: manuedelf <emmanuelle.delfour@orange.com>
Change-Id: I6181506acfabecc92dc6527df91c3a6e5893ffe4

pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceCalculation.java
pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOpticalNode.java
pce/src/test/java/org/opendaylight/transportpce/pce/PcePathDescriptionTests.java
pce/src/test/java/org/opendaylight/transportpce/pce/constraints/PceConstraintsTest.java
pce/src/test/java/org/opendaylight/transportpce/pce/graph/PceGraphEdgeTest.java
pce/src/test/java/org/opendaylight/transportpce/pce/graph/PceGraphTest.java
pce/src/test/java/org/opendaylight/transportpce/pce/networkanalyzer/PceLinkTest.java
pce/src/test/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOpticalNodeTest.java

index 033b3a9eb7b1cc8ffd24594a31668324a0850b1b..bfd2822a14cda27c001694ad12a648f088966dbb 100644 (file)
@@ -474,9 +474,8 @@ public class PceCalculation {
         }
         OpenroadmNodeType nodeType = node1.getNodeType();
 
-        PceOpticalNode pceNode = new PceOpticalNode(node, nodeType, node.getNodeId(),
-            input.getServiceAEnd().getServiceFormat(), "optical");
-        pceNode.validateAZxponder(anodeId, znodeId);
+        PceOpticalNode pceNode = new PceOpticalNode(node, nodeType);
+        pceNode.validateAZxponder(anodeId, znodeId, input.getServiceAEnd().getServiceFormat());
         pceNode.initWLlist();
 
         if (!pceNode.isValid()) {
@@ -616,7 +615,7 @@ public class PceCalculation {
                 this.azSrgs.add(nodeId);
                 break;
             case XPONDER:
-                pceNode.initXndrTps();
+                pceNode.initXndrTps(input.getServiceAEnd().getServiceFormat());
                 break;
             default:
                 LOG.warn("endPceNode: Node {} is not SRG or XPONDER !", nodeId);
index 59732b95613b38da187e9e1afb8b9093dd37d08c..f753196dad65148c99059f69c3d189385f7edc7c 100644 (file)
@@ -19,7 +19,6 @@ import org.opendaylight.transportpce.common.fixedflex.GridConstant;
 import org.opendaylight.transportpce.pce.SortPortsByName;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.TerminationPoint1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev200529.Node1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev200529.networks.network.node.termination.point.pp.attributes.UsedWavelength;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmNodeType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmTpType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.available.freq.map.AvailFreqMapsKey;
@@ -35,11 +34,9 @@ public class PceOpticalNode implements PceNode {
 
     private boolean valid = true;
 
-    private final Node node;
-    private final NodeId nodeId;
-    private final OpenroadmNodeType nodeType;
-    private final ServiceFormat serviceFormat;
-    private final String pceNodeType;
+    private Node node;
+    private NodeId nodeId;
+    private OpenroadmNodeType nodeType;
 
     // wavelength calculation per node type
     private List<Long> availableWLindex = new ArrayList<>();
@@ -50,15 +47,12 @@ public class PceOpticalNode implements PceNode {
     private Map<String, String> clientPerNwTp = new HashMap<>();
     private final AvailFreqMapsKey freqMapKey = new AvailFreqMapsKey(GridConstant.C_BAND);
 
-    public PceOpticalNode(Node node, OpenroadmNodeType nodeType, NodeId nodeId, ServiceFormat serviceFormat,
-        String pceNodeType) {
-        this.node = node;
-        this.nodeId = nodeId;
-        this.nodeType = nodeType;
-        this.serviceFormat = serviceFormat;
-        this.pceNodeType = pceNodeType;
-
-        if ((node == null) || (nodeId == null) || (nodeType == null)) {
+    public PceOpticalNode(Node node, OpenroadmNodeType nodeType) {
+        if (node != null && node.getNodeId() != null && nodeType != null) {
+            this.node = node;
+            this.nodeId = node.getNodeId();
+            this.nodeType = nodeType;
+        } else {
             LOG.error("PceNode: one of parameters is not populated : nodeId, node type");
             this.valid = false;
         }
@@ -86,7 +80,7 @@ public class PceOpticalNode implements PceNode {
             TerminationPoint1 cntp1 = tp.augmentation(TerminationPoint1.class);
             org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev200529.TerminationPoint1 nttp1 = tp
                 .augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev200529
-                .TerminationPoint1.class);
+                        .TerminationPoint1.class);
             OpenroadmTpType type = cntp1.getTpType();
             LOG.info("type = {} for tp {}", type.getName(), tp);
 
@@ -100,19 +94,10 @@ public class PceOpticalNode implements PceNode {
                 case SRGRXPP:
                 case SRGTXPP:
                 case SRGTXRXPP:
-                    boolean used = true;
                     LOG.info("initSrgTpList: SRG-PP tp = {} found", tp.getTpId().getValue());
-                    try {
-                        List<UsedWavelength> usedWavelengths =
-                            new ArrayList<>(nttp1.getPpAttributes().getUsedWavelength().values());
-                        if (usedWavelengths.isEmpty()) {
-                            used = false;
-                        }
-                    } catch (NullPointerException e) {
-                        LOG.warn("initSrgTpList: 'usedWavelengths' for tp={} is null !", tp.getTpId().getValue());
-                        used = false;
-                    }
-                    if (!used) {
+                    if (nttp1 == null || nttp1.getPpAttributes() == null
+                            || nttp1.getPpAttributes().getUsedWavelength() == null
+                            || nttp1.getPpAttributes().getUsedWavelength().values().isEmpty()) {
                         LOG.info("initSrgTpList: adding SRG-PP tp '{}'", tp.getTpId().getValue());
                         this.availableSrgPp.put(tp.getTpId().getValue(), cntp1.getTpType());
                     } else {
@@ -176,7 +161,7 @@ public class PceOpticalNode implements PceNode {
         LOG.debug("initWLlist: availableWLindex size = {} in {}", this.availableWLindex.size(), this);
     }
 
-    public void initXndrTps() {
+    public void initXndrTps(ServiceFormat serviceFormat) {
         LOG.info("PceNod: initXndrTps for node : {}", this.nodeId);
         if (!isValid()) {
             return;
@@ -219,11 +204,11 @@ public class PceOpticalNode implements PceNode {
                         LOG.error("initXndrTps: XPONDER {} NW TP doesn't have defined Client {}",
                             this, tp.getTpId().getValue());
                     }
-                } else if (ServiceFormat.OTU.equals(this.serviceFormat)) {
+                } else if (ServiceFormat.OTU.equals(serviceFormat)) {
                     LOG.info("Infrastructure OTU4 connection");
                     this.valid = true;
                 } else {
-                    LOG.error("Service Format {} not managed yet", this.serviceFormat.getName());
+                    LOG.error("Service Format {} not managed yet", serviceFormat.getName());
                 }
             }
         }
@@ -279,7 +264,7 @@ public class PceOpticalNode implements PceNode {
     }
 
 
-    public void validateAZxponder(String anodeId, String znodeId) {
+    public void validateAZxponder(String anodeId, String znodeId, ServiceFormat serviceFormat) {
         if (!isValid()) {
             return;
         }
@@ -289,7 +274,7 @@ public class PceOpticalNode implements PceNode {
         // Detect A and Z
         if (this.getSupNetworkNodeId().equals(anodeId) || (this.getSupNetworkNodeId().equals(znodeId))) {
             LOG.info("validateAZxponder: A or Z node detected == {}", nodeId.getValue());
-            initXndrTps();
+            initXndrTps(serviceFormat);
             return;
         }
         LOG.debug("validateAZxponder: XPONDER is ignored == {}", nodeId.getValue());
@@ -332,7 +317,7 @@ public class PceOpticalNode implements PceNode {
 
     @Override
     public String getPceNodeType() {
-        return this.pceNodeType;
+        return "optical";
     }
 
     @Override
index c22a068f8e4dc3b82f5398844dabb30ca88cacfb..52a56a8335c474e06c349160a93384d492d2470c 100644 (file)
@@ -25,7 +25,6 @@ import org.opendaylight.transportpce.pce.utils.NodeUtils;
 import org.opendaylight.transportpce.pce.utils.PceTestData;
 import org.opendaylight.transportpce.test.AbstractTest;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmNodeType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev190531.ServiceFormat;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
 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.NodeBuilder;
@@ -50,13 +49,11 @@ public class PcePathDescriptionTests extends AbstractTest {
         //  Link link=genereateLinkBuilder();
 
         NodeBuilder node1Builder = NodeUtils.getNodeBuilder(NodeUtils.geSupportingNodes());
-        node = node1Builder.build();
+        node = node1Builder.setNodeId(new NodeId("test")).build();
         PceOpticalNode pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("OpenROADM-3-2-DEG1"), ServiceFormat.Ethernet,
-                "DEGREE");
+                OpenroadmNodeType.SRG);
         PceOpticalNode pceOpticalNode2 = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("OpenROADM-3-1-DEG1"), ServiceFormat.Ethernet,
-                "DEGREE");
+                OpenroadmNodeType.SRG);
 
         pceLink = new PceLink(link, pceOpticalNode, pceOpticalNode2);
         pceLink.setClient("XPONDER-CLIENT");
index 291f075529d3b2fcbf5fc2974ffeaa5aa0cd1aad..1ad4a2bf5c41c8cfad479b9e94c62ee2b6703c24 100644 (file)
@@ -107,7 +107,7 @@ public class PceConstraintsTest extends AbstractTest {
     @Test
     public void getIncludePceNodesTest() {
         Assert.assertTrue(pceConstraints.getIncludePceNodes().size() == 0);
-        pceConstraints.setIncludePceNode(new PceOpticalNode(null, null, null, null, null));
+        pceConstraints.setIncludePceNode(new PceOpticalNode(null, null));
         Assert.assertTrue(pceConstraints.getIncludePceNodes().size() == 1);
 
     }
index 66eaa45fd128416f911a1c31fe59611a676a5193..6a40ff16f468d8d4f2389cd2b345b2c36eecaf9f 100644 (file)
@@ -15,8 +15,6 @@ import org.opendaylight.transportpce.pce.networkanalyzer.PceLink;
 import org.opendaylight.transportpce.pce.networkanalyzer.PceOpticalNode;
 import org.opendaylight.transportpce.pce.utils.NodeUtils;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmNodeType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev190531.ServiceFormat;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
 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.topology.rev180226.networks.network.Link;
 
@@ -38,12 +36,8 @@ public class PceGraphEdgeTest {
         //  Link link=genereateLinkBuilder();
         node =  NodeUtils.getNodeBuilder(NodeUtils.geSupportingNodes()).build();
 
-        PceOpticalNode pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("OpenROADM-3-2-DEG1"), ServiceFormat.Ethernet,
-                "DEGREE");
-        PceOpticalNode pceOpticalNode2 = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("OpenROADM-3-1-DEG1"), ServiceFormat.Ethernet,
-                "DEGREE");
+        PceOpticalNode pceOpticalNode = new PceOpticalNode(node, OpenroadmNodeType.SRG);
+        PceOpticalNode pceOpticalNode2 = new PceOpticalNode(node, OpenroadmNodeType.SRG);
 
         pceLink = new PceLink(link, pceOpticalNode, pceOpticalNode2);
         pceLink.setClient("XPONDER-CLIENT");
index ad23a1f8d36fcdfbe4ba614997213fd0a57cb331..e8fbbc1c1ef74503211bb5c7f7b6c536899174fd 100644 (file)
@@ -28,6 +28,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev190531.
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
 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.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link;
 
 public class PceGraphTest {
@@ -50,17 +51,17 @@ public class PceGraphTest {
                 "OpenROADM-3-1-DEG1",
                 "DEG1-TTP-TX", "DEG1-TTP-RX").build();
 
-        node = NodeUtils.getNodeBuilder(NodeUtils.geSupportingNodes()).build();
-
-        pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("OpenROADM-3-2-DEG1"), ServiceFormat.Ethernet,
-                "DEGREE");
+        NodeId nodeId = new NodeId("OpenROADM-3-2-DEG1");
+        node = NodeUtils.getNodeBuilder(NodeUtils.geSupportingNodes())
+                .setNodeId(nodeId).withKey(new NodeKey(nodeId))
+                .build();
+        pceOpticalNode = new PceOpticalNode(node, OpenroadmNodeType.DEGREE);
         pceOpticalNode.checkWL(1);
         pceOpticalNode.checkWL(2);
-
-        pceOpticalNode2 = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("OpenROADM-3-1-DEG1"), ServiceFormat.Ethernet,
-                "DEGREE");
+        NodeId nodeId2 = new NodeId("OpenROADM-3-1-DEG1");
+        Node node2 = NodeUtils.getNodeBuilder(NodeUtils.geSupportingNodes())
+                .setNodeId(nodeId2).withKey(new NodeKey(nodeId2)).build();
+        pceOpticalNode2 = new PceOpticalNode(node2, OpenroadmNodeType.DEGREE);
         pceOpticalNode2.checkWL(1);
         pceOpticalNode2.checkWL(2);
         pceLink = new PceLink(link, pceOpticalNode, pceOpticalNode2);
@@ -72,8 +73,7 @@ public class PceGraphTest {
         // init PceHardContraints
         pceHardConstraints = new PceConstraints();
         // pceHardConstraints.setp
-        allPceNodes = Map.of(new NodeId("OpenROADM-3-2-DEG1"), pceOpticalNode,
-                new NodeId("OpenROADM-3-1-DEG1"), pceOpticalNode2);
+        allPceNodes = Map.of(nodeId, pceOpticalNode, nodeId2, pceOpticalNode2);
         rc = new PceResult();
         pceGraph = new PceGraph(pceOpticalNode, pceOpticalNode2, allPceNodes,
                 pceHardConstraints,
index 20dcacef7648f5a89f0783370320c40f433262e5..2b483a9f5a555b2734faf8e71d4c9d5093a69244 100644 (file)
@@ -27,7 +27,6 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev20052
 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.OpenroadmNodeType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmTpType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev190531.ServiceFormat;
 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.NodeId;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node;
@@ -66,12 +65,9 @@ public class PceLinkTest extends AbstractTest {
         Link link = createRoadmToRoadm("srcNode",
                 "destNode",
                 "srcTp", "destTp").build();
-
         NodeBuilder node1Builder = getNodeBuilder(geSupportingNodes());
-        Node node = node1Builder.build();
-
-        PceOpticalNode pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("optical"), ServiceFormat.OMS, "test");
+        Node node = node1Builder.setNodeId(new NodeId("test")).build();
+        PceOpticalNode pceOpticalNode = new PceOpticalNode(node, OpenroadmNodeType.SRG);
         pceLink = new PceLink(link, pceOpticalNode, pceOpticalNode);
     }
 
@@ -82,10 +78,8 @@ public class PceLinkTest extends AbstractTest {
                 "srcTp", "destTp").build();
 
         NodeBuilder node1Builder = getNodeBuilder(geSupportingNodes());
-        Node node = node1Builder.build();
-
-        PceOpticalNode pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("optical"), ServiceFormat.OMS, "test");
+        Node node = node1Builder.setNodeId(new NodeId("test")).build();
+        PceOpticalNode pceOpticalNode = new PceOpticalNode(node, OpenroadmNodeType.SRG);
         pceLink = new PceLink(link, pceOpticalNode, pceOpticalNode);
     }
 
@@ -96,10 +90,9 @@ public class PceLinkTest extends AbstractTest {
                 "srcTp", "destTp").build();
 
         NodeBuilder node1Builder = getNodeBuilder(geSupportingNodes());
-        Node node = node1Builder.build();
-
+        Node node = node1Builder.setNodeId(new NodeId("test")).build();
         PceOpticalNode pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.SRG);
         pceLink = new PceLink(link, pceOpticalNode, pceOpticalNode);
 
     }
@@ -111,10 +104,9 @@ public class PceLinkTest extends AbstractTest {
                 "srcTp", "destTp").build();
 
         NodeBuilder node1Builder = getNodeBuilder(geSupportingNodes());
-        Node node = node1Builder.build();
-
+        Node node = node1Builder.setNodeId(new NodeId("test")).build();
         PceOpticalNode pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.SRG);
         pceLink = new PceLink(link, pceOpticalNode, pceOpticalNode);
     }
 
@@ -125,10 +117,9 @@ public class PceLinkTest extends AbstractTest {
                 "srcTp", "destTp").build();
 
         NodeBuilder node1Builder = getNodeBuilder(geSupportingNodes());
-        Node node = node1Builder.build();
-
+        Node node = node1Builder.setNodeId(new NodeId("test")).build();
         PceOpticalNode pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.SRG, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.SRG);
         pceLink = new PceLink(link, pceOpticalNode, pceOpticalNode);
         Assert.assertNotNull(MapUtils.getOmsAttributesSpan(link));
         Assert.assertNotNull(pceLink.calcSpanOSNR());
index 7a7dc1732afad3da4a1670e6a7b0c34eb37894ce..c4c10386aa90e9dfc9f727df8e776dd5489ec3f2 100644 (file)
@@ -63,15 +63,13 @@ public class PceOpticalNodeTest extends AbstractTest {
     @Before
     public void setUp() {
         NodeBuilder node1Builder = getNodeBuilder(geSupportingNodes(), OpenroadmTpType.SRGTXRXPP);
-        node = node1Builder.build();
+        node = node1Builder.setNodeId(new NodeId("test")).build();
     }
 
     @Test
     public void isValidTest() {
         OpenroadmNodeType nodeType = OpenroadmNodeType.ROADM;
-        ServiceFormat serviceFormat = ServiceFormat.Ethernet;
-        String pceNodeType = "pceNodeType";
-        pceOpticalNode = new PceOpticalNode(node, nodeType, new NodeId("node_test"), serviceFormat, pceNodeType);
+        pceOpticalNode = new PceOpticalNode(node, nodeType);
         Assert.assertTrue(pceOpticalNode.isValid());
     }
 
@@ -79,9 +77,9 @@ public class PceOpticalNodeTest extends AbstractTest {
     public void testInitSrgTps() {
 
         pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.ROADM, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.ROADM);
         pceOpticalNode.initSrgTps();
-        pceOpticalNode.initXndrTps();
+        pceOpticalNode.initXndrTps(ServiceFormat.OMS);
         pceOpticalNode.initWLlist();
         Assert.assertFalse(pceOpticalNode.isValid());
         Assert.assertFalse(pceOpticalNode.checkWL(12));
@@ -96,7 +94,7 @@ public class PceOpticalNodeTest extends AbstractTest {
         NodeBuilder node1Builder = getNodeBuilder(geSupportingNodes(), OpenroadmTpType.XPONDERNETWORK);
         Node specificNode = node1Builder.build();
         pceOpticalNode = new PceOpticalNode(specificNode,
-                OpenroadmNodeType.SRG, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.SRG);
         pceOpticalNode.initWLlist();
         Assert.assertTrue(pceOpticalNode.isValid());
         Assert.assertTrue(pceOpticalNode.checkWL(12));
@@ -106,7 +104,7 @@ public class PceOpticalNodeTest extends AbstractTest {
     @Test
     public void testInitXndrTpDegTypes() {
         pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.DEGREE, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.DEGREE);
         pceOpticalNode.initWLlist();
         Assert.assertTrue(pceOpticalNode.isValid());
         Assert.assertFalse(pceOpticalNode.checkWL(12));
@@ -116,7 +114,7 @@ public class PceOpticalNodeTest extends AbstractTest {
     @Test
     public void testInitXndrTpXpondrTypes() {
         pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.XPONDER, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.XPONDER);
         pceOpticalNode.initWLlist();
         Assert.assertTrue(pceOpticalNode.isValid());
         Assert.assertTrue(pceOpticalNode.checkWL(12));
@@ -126,8 +124,8 @@ public class PceOpticalNodeTest extends AbstractTest {
     @Test
     public void testInitWLlist() {
         pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.ROADM, new NodeId("optical"), ServiceFormat.OMS, "test");
-        pceOpticalNode.initXndrTps();
+                OpenroadmNodeType.ROADM);
+        pceOpticalNode.initXndrTps(ServiceFormat.OMS);
         pceOpticalNode.initWLlist();
         Assert.assertFalse(pceOpticalNode.isValid());
         Assert.assertFalse(pceOpticalNode.checkWL(12));
@@ -137,7 +135,7 @@ public class PceOpticalNodeTest extends AbstractTest {
     @Test
     public void testGetRdmSrgClient() {
         pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.ROADM, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.ROADM);
         pceOpticalNode.initSrgTps();
         Assert.assertNull(pceOpticalNode.getRdmSrgClient("7"));
         Assert.assertFalse(pceOpticalNode.isValid());
@@ -148,12 +146,12 @@ public class PceOpticalNodeTest extends AbstractTest {
     @Test
     public void testGetRdmSrgClientEmpty() {
         NodeBuilder node1Builder = getNodeBuilderEmpty(geSupportingNodes(), OpenroadmTpType.SRGTXRXPP);
-        Node specificNode = node1Builder.build();
+        Node specificNode = node1Builder.setNodeId(new NodeId("test")).build();
         pceOpticalNode = new PceOpticalNode(specificNode,
-                OpenroadmNodeType.ROADM, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.ROADM);
         pceOpticalNode.initSrgTps();
         pceOpticalNode.initWLlist();
-        pceOpticalNode.initXndrTps();
+        pceOpticalNode.initXndrTps(ServiceFormat.OMS);
         Assert.assertNull(pceOpticalNode.getRdmSrgClient("7"));
         Assert.assertFalse(pceOpticalNode.isValid());
         Assert.assertFalse(pceOpticalNode.checkWL(12));
@@ -163,7 +161,7 @@ public class PceOpticalNodeTest extends AbstractTest {
     @Test
     public void testGetRdmSrgClientDeg() {
         pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.DEGREE, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.DEGREE);
         pceOpticalNode.initSrgTps();
         Assert.assertNull(pceOpticalNode.getRdmSrgClient("7"));
         Assert.assertFalse(pceOpticalNode.isValid());
@@ -176,7 +174,7 @@ public class PceOpticalNodeTest extends AbstractTest {
         NodeBuilder node1Builder = getNodeBuilder(geSupportingNodes(), OpenroadmTpType.SRGTXCP);
         Node specificNode = node1Builder.build();
         pceOpticalNode = new PceOpticalNode(specificNode,
-                OpenroadmNodeType.ROADM, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.ROADM);
         pceOpticalNode.initSrgTps();
         Assert.assertFalse(pceOpticalNode.isValid());
         Assert.assertFalse(pceOpticalNode.checkWL(12));
@@ -189,7 +187,7 @@ public class PceOpticalNodeTest extends AbstractTest {
         NodeBuilder node1Builder = getNodeBuilder(geSupportingNodes(), OpenroadmTpType.DEGREERXTTP);
         node = node1Builder.build();
         pceOpticalNode = new PceOpticalNode(node,
-                OpenroadmNodeType.ROADM, new NodeId("optical"), ServiceFormat.OMS, "test");
+                OpenroadmNodeType.ROADM);
         pceOpticalNode.initSrgTps();
         Assert.assertNull(pceOpticalNode.getRdmSrgClient("2"));
         Assert.assertFalse(pceOpticalNode.isValid());