@Test public void testGetNodeType() throws Exception { String strType = "switch"; Assert.assertTrue(Utils.getNodeType(strType) == PhysicalNodeInstance.NodeType.Switch); strType = "router"; Assert.assertTrue(Utils.getNodeType(strType) == PhysicalNodeInstance.NodeType.Router); strType = "firewall"; Assert.assertTrue(Utils.getNodeType(strType) == PhysicalNodeInstance.NodeType.Firewall); strType = "loadbalancer"; Assert.assertTrue(Utils.getNodeType(strType) == PhysicalNodeInstance.NodeType.Loadbalancer); strType = "test"; Assert.assertTrue(Utils.getNodeType(strType) == null); }
protected static PhysicalNodeInstance.NodeType getNodeType(String strType){ switch (strType){ case "switch": return PhysicalNodeInstance.NodeType.Switch; case "router": return PhysicalNodeInstance.NodeType.Router; case "firewall": return PhysicalNodeInstance.NodeType.Firewall; case "loadbalancer": return PhysicalNodeInstance.NodeType.Loadbalancer; } return null; }
Utils { protected static PhysicalNodeInstance.NodeType getNodeType(String strType){ switch (strType){ case "switch": return PhysicalNodeInstance.NodeType.Switch; case "router": return PhysicalNodeInstance.NodeType.Router; case "firewall": return PhysicalNodeInstance.NodeType.Firewall; case "loadbalancer": return PhysicalNodeInstance.NodeType.Loadbalancer; } return null; } }
Utils { protected static PhysicalNodeInstance.NodeType getNodeType(String strType){ switch (strType){ case "switch": return PhysicalNodeInstance.NodeType.Switch; case "router": return PhysicalNodeInstance.NodeType.Router; case "firewall": return PhysicalNodeInstance.NodeType.Firewall; case "loadbalancer": return PhysicalNodeInstance.NodeType.Loadbalancer; } return null; }  }
Utils { protected static PhysicalNodeInstance.NodeType getNodeType(String strType){ switch (strType){ case "switch": return PhysicalNodeInstance.NodeType.Switch; case "router": return PhysicalNodeInstance.NodeType.Router; case "firewall": return PhysicalNodeInstance.NodeType.Firewall; case "loadbalancer": return PhysicalNodeInstance.NodeType.Loadbalancer; } return null; }   }
Utils { protected static PhysicalNodeInstance.NodeType getNodeType(String strType){ switch (strType){ case "switch": return PhysicalNodeInstance.NodeType.Switch; case "router": return PhysicalNodeInstance.NodeType.Router; case "firewall": return PhysicalNodeInstance.NodeType.Firewall; case "loadbalancer": return PhysicalNodeInstance.NodeType.Loadbalancer; } return null; }    }