Code example for InetSocketAddress

Methods: getAddressgetPort

0
    Assert.assertEquals(req, req.get());
    Assert.assertEquals(req, req.get(89L, TimeUnit.HOURS));
    Assert.assertFalse(req.isCancelled());
 
    InetSocketAddress remoteAddress = (InetSocketAddress)req.getRemoteAddress();
    Assert.assertEquals(port, remoteAddress.getPort());
    Assert.assertEquals(InetAddress.getByAddress(ipAddr), remoteAddress.getAddress());
  } 
 
  @Test 
  public void testParamsNegative() throws Exception 
  { 
    DatabusRequest req = makeRequest();
    // Non-existent parameter 
    boolean caughtException = false;
    int x = -1;
    try 
    { 
      x = req.getRequiredIntParam("NonExistentParam");
    } 
Experience pair programming with AI  Get Codota for Java