8024675: java/net/NetworkInterface/UniqueMacAddressesTest.java fails on Windows
authormsheppar
Fri, 13 Sep 2013 12:20:53 +0100
changeset 19854 dda528ceb1de
parent 19853 832b09e2714c
child 19855 bfe130545fe0
child 21397 3680011556c9
8024675: java/net/NetworkInterface/UniqueMacAddressesTest.java fails on Windows Summary: amended test to add active, i.e. isUp(), NetworkInterfaces to test list Reviewed-by: alanb, chegar
jdk/test/java/net/NetworkInterface/UniqueMacAddressesTest.java
--- a/jdk/test/java/net/NetworkInterface/UniqueMacAddressesTest.java	Thu Sep 12 14:22:53 2013 -0700
+++ b/jdk/test/java/net/NetworkInterface/UniqueMacAddressesTest.java	Fri Sep 13 12:20:53 2013 +0100
@@ -118,11 +118,14 @@
         NetworkInterface netIf = null;
         while (nis.hasMoreElements()) {
             netIf = (NetworkInterface) nis.nextElement();
-            macAddr = netIf.getHardwareAddress();
-            if (macAddr != null) {
-                System.out
-                        .println("Adding NetworkInterface " + netIf.getName());
-                networkInterfaceList.add(netIf);
+            if (netIf.isUp()) {
+                macAddr = netIf.getHardwareAddress();
+                if (macAddr != null) {
+                    System.out.println("Adding NetworkInterface "
+                            + netIf.getName() + " with mac address "
+                            + createMacAddressString(netIf));
+                    networkInterfaceList.add(netIf);
+                }
             }
         }
     }