public void testGetAcceptorAddress_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, 2}), cb.getAcceptorAddress()); }
public void testGetApplicationData_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); assertTrue(Arrays.equals(new byte[] {0, 10, 20, 40, 50}, cb.getApplicationData())); }
public void testEquals_0_0_0() { ChannelBinding cb = new ChannelBinding(new byte[] {0, 10, 20, 40, 50}); assertTrue(cb.equals(cb)); }
public void testGetAcceptorAddress_1() { ChannelBinding cb = new ChannelBinding(null); assertNull(cb.getAcceptorAddress()); }
public void testGetAcceptorAddress() throws Exception { InetAddress addr = InetAddress.getByAddress(new byte[] {127, 0, 0, 1}); ChannelBinding cb = new ChannelBinding(null, addr, null); assertEquals(InetAddress.getByAddress(new byte[] {127, 0, 0, 1}), cb.getAcceptorAddress()); }
public void testGetApplicationData_1() { ChannelBinding cb = new ChannelBinding(null); assertNull(cb.getApplicationData()); }
public void testGetApplicationData() { byte data[] = {0, 1, 2, 10, 20}; ChannelBinding cb = new ChannelBinding(data); assertTrue(Arrays.equals(new byte[] {0, 1, 2, 10, 20}, cb.getApplicationData())); }
public void testHashCode_2() throws Exception { byte data[] = {10, 2}; ChannelBinding cb = new ChannelBinding(null, null, data); assertEquals(312, cb.hashCode()); }
public void testHashCode_0() throws Exception { byte data[] = {0, 10, 20, 40, 50}; InetAddress addr = InetAddress.getByAddress(new byte[] {127, 0, 0, 1}); ChannelBinding cb = new ChannelBinding(null, addr, data); assertEquals(addr.hashCode(), cb.hashCode()); }
public void testEquals_Negative_0_0() throws Exception { byte data[] = {0, 10, 20}; ChannelBinding cb = new ChannelBinding(data); assertTrue(!cb.equals(new Object())); }