< prev index next >
jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java
Print this page
rev 17203 : 8180644: move jdk.testlibrary.NetworkConfiguration to the top level test library
Reviewed-by: duke
*** 23,33 ****
/* @test
* @bug 8014377
* @summary Test for interference when two sockets are bound to the same
* port but joined to different multicast groups
! * @build Promiscuous NetworkConfiguration
* @run main Promiscuous
* @run main/othervm -Djava.net.preferIPv4Stack=true Promiscuous
* @key randomness
*/
--- 23,34 ----
/* @test
* @bug 8014377
* @summary Test for interference when two sockets are bound to the same
* port but joined to different multicast groups
! * @library /test/lib
! * @build Promiscuous
* @run main Promiscuous
* @run main/othervm -Djava.net.preferIPv4Stack=true Promiscuous
* @key randomness
*/
*** 35,44 ****
--- 36,48 ----
import java.nio.channels.*;
import java.net.*;
import static java.net.StandardProtocolFamily.*;
import java.util.*;
import java.io.IOException;
+ import java.util.stream.Collectors;
+
+ import jdk.test.lib.NetworkConfiguration;
public class Promiscuous {
static final Random rand = new Random();
*** 206,216 ****
// multicast groups used for the test
InetAddress ip4Group1 = InetAddress.getByName("225.4.5.6");
InetAddress ip4Group2 = InetAddress.getByName("225.4.6.6");
! for (NetworkInterface nif: config.ip4Interfaces()) {
InetAddress source = config.ip4Addresses(nif).iterator().next();
test(INET, nif, ip4Group1, ip4Group2);
// Solaris and Linux allow IPv6 sockets join IPv4 multicast groups
if (os.equals("SunOS") || os.equals("Linux"))
--- 210,221 ----
// multicast groups used for the test
InetAddress ip4Group1 = InetAddress.getByName("225.4.5.6");
InetAddress ip4Group2 = InetAddress.getByName("225.4.6.6");
! for (NetworkInterface nif: config.ip4MulticastInterfaces()
! .collect(Collectors.toList())) {
InetAddress source = config.ip4Addresses(nif).iterator().next();
test(INET, nif, ip4Group1, ip4Group2);
// Solaris and Linux allow IPv6 sockets join IPv4 multicast groups
if (os.equals("SunOS") || os.equals("Linux"))
< prev index next >