public void testGetInitiatorAddress_0() throws Exception { byte data[] = {0, 10, 20, 40, 50}; InetAddress addr1 = InetAddress.getByAddress(new byte[] {127, 0, 0, 1}); InetAddress addr2 = InetAddress.getByAddress(new byte[] {127, 0, 0, 2}); ChannelBinding cb = new ChannelBinding(addr1, addr2, data); assertEquals(InetAddress.getByAddress(new byte[] {127, 0, 0, 1}), cb.getInitiatorAddress()); }
public void testGetInitiatorAddress_1() { ChannelBinding cb = new ChannelBinding(null); assertNull(cb.getInitiatorAddress()); }
public void testGetInitiatorAddress() throws Exception { InetAddress addr = InetAddress.getByAddress(new byte[] {127, 0, 0, 1}); ChannelBinding cb = new ChannelBinding(addr, null, null); assertEquals(InetAddress.getByAddress(new byte[] {127, 0, 0, 1}), cb.getInitiatorAddress()); }