test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java
Print this page
*** 20,33 ****
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
! * @bug 4527345 7026376
* @summary Unit test for DatagramChannel's multicast support
* @build MulticastSendReceiveTests NetworkConfiguration
* @run main MulticastSendReceiveTests
*/
import java.nio.ByteBuffer;
import java.nio.channels.*;
import java.net.*;
--- 20,34 ----
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
! * @bug 4527345 7026376 6633549
* @summary Unit test for DatagramChannel's multicast support
* @build MulticastSendReceiveTests NetworkConfiguration
* @run main MulticastSendReceiveTests
+ * @run main/othervm -Djava.net.preferIPv4Stack=true MulticastSendReceiveTests
*/
import java.nio.ByteBuffer;
import java.nio.channels.*;
import java.net.*;
*** 184,193 ****
--- 185,198 ----
System.out.format("unblock %s\n", source.getHostAddress());
key.unblock(source);
id = sendDatagram(source, nif, group, port);
receiveDatagram(dc, source, id);
} catch (UnsupportedOperationException x) {
+ String os = System.getProperty("os.name");
+ // Exclude-mode filtering supported on these platforms so UOE should never be thrown
+ if (os.equals("SunOS") || os.equals("Linux"))
+ throw x;
System.out.println("Exclude-mode filtering not supported!");
}
key.drop();
*** 210,219 ****
--- 215,228 ----
key = dc.join(group, nif, source);
id = sendDatagram(source, nif, group, port);
receiveDatagram(dc, source, id);
} catch (UnsupportedOperationException x) {
+ String os = System.getProperty("os.name");
+ // Include-mode filtering supported on these platforms so UOE should never be thrown
+ if (os.equals("SunOS") || os.equals("Linux"))
+ throw x;
System.out.println("Include-mode filtering not supported!");
}
}
}