await();
}
@Test
public void testOptions() {
DatagramSocketOptions options = new DatagramSocketOptions();
assertEquals(NetworkOptions.DEFAULT_SEND_BUFFER_SIZE, options.getSendBufferSize());
int rand = TestUtils.randomPositiveInt();
assertEquals(options, options.setSendBufferSize(rand));
assertEquals(rand, options.getSendBufferSize());
assertIllegalArgumentException(() -> options.setSendBufferSize(0));
assertIllegalArgumentException(() -> options.setSendBufferSize(-123));
assertEquals(NetworkOptions.DEFAULT_RECEIVE_BUFFER_SIZE, options.getReceiveBufferSize());
rand = TestUtils.randomPositiveInt();
assertEquals(options, options.setReceiveBufferSize(rand));
assertEquals(rand, options.getReceiveBufferSize());
assertIllegalArgumentException(() -> options.setReceiveBufferSize(0));
assertIllegalArgumentException(() -> options.setReceiveBufferSize(-123));
assertFalse(options.isReuseAddress());
assertEquals(options, options.setReuseAddress(true));
assertTrue(options.isReuseAddress());
assertEquals(NetworkOptions.DEFAULT_TRAFFIC_CLASS, options.getTrafficClass());
rand = 23;
assertEquals(options, options.setTrafficClass(rand));
assertEquals(rand, options.getTrafficClass());
assertIllegalArgumentException(() -> options.setTrafficClass(-1));
assertIllegalArgumentException(() -> options.setTrafficClass(256));
assertFalse(options.isBroadcast());
assertEquals(options, options.setBroadcast(true));
assertTrue(options.isBroadcast());
assertTrue(options.isLoopbackModeDisabled());
assertEquals(options, options.setLoopbackModeDisabled(false));
assertFalse(options.isLoopbackModeDisabled());
assertEquals(-1, options.getMulticastTimeToLive());
rand = TestUtils.randomPositiveInt();
assertEquals(options, options.setMulticastTimeToLive(rand));
assertEquals(rand, options.getMulticastTimeToLive());
assertIllegalArgumentException(() -> options.setMulticastTimeToLive(-1));
assertNull(options.getMulticastNetworkInterface());
String randString = TestUtils.randomUnicodeString(100);
assertEquals(options, options.setMulticastNetworkInterface(randString));
assertEquals(randString, options.getMulticastNetworkInterface());
assertFalse(options.isIpV6());
assertEquals(options, options.setIpV6(true));
assertTrue(options.isIpV6());
testComplete();
}