LeonGao91 commented on a change in pull request #3346:
URL: https://github.com/apache/hadoop/pull/3346#discussion_r700643861



##########
File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
##########
@@ -765,6 +765,25 @@ public void testTrimCreateSocketAddress() {
     assertEquals(defaultAddr.trim(), NetUtils.getHostPortString(addr));
   }
 
+  @Test
+  public void testGetPortFromHostPortString() {
+
+    assertEquals(1002, NetUtils.getPortFromHostPortString("testHost:1002"));
+    try {
+      NetUtils.getPortFromHostPortString("testHost");
+      fail("Should throw exception for wrong format");

Review comment:
       thx for the pointer, its pretty handy!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to