8146209: java/net/NetworkInterface/NetworkInterfaceStreamTest.java still fails after fix JDK-8131155
Reviewed-by: chegar
Contributed-by: felix.yang@oracle.com
--- a/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java Mon Dec 28 00:02:06 2015 +0000
+++ b/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java Mon Dec 28 19:03:18 2015 -0800
@@ -85,13 +85,15 @@
}
private Stream<NetworkInterface> allNetworkInterfaces() throws SocketException {
- return NetworkInterface.networkInterfaces().flatMap(this::allSubNetworkInterfaces);
+ return NetworkInterface.networkInterfaces()
+ .filter(ni -> isIncluded(ni))
+ .flatMap(this::allSubNetworkInterfaces);
}
private Stream<NetworkInterface> allSubNetworkInterfaces(NetworkInterface ni) {
return Stream.concat(
Stream.of(ni),
- ni.subInterfaces().flatMap(this::allSubNetworkInterfaces));
+ ni.subInterfaces().filter(sni -> isIncluded(sni)).flatMap(this::allSubNetworkInterfaces));
}
@Test
@@ -129,7 +131,9 @@
Collection<NetworkInterface> nis = Collections.list(NetworkInterface.getNetworkInterfaces());
Collection<InetAddress> expected = new ArrayList<>();
for (NetworkInterface ni : nis) {
- expected.addAll(Collections.list(ni.getInetAddresses()));
+ if (isIncluded(ni)) {
+ expected.addAll(Collections.list(ni.getInetAddresses()));
+ }
}
withData(TestData.Factory.ofSupplier("All inet addresses", ss))
.stream(s -> s)