changeset 6954:0ad0b65578da

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
author msheppar
date Fri, 13 Sep 2013 12:20:53 +0100
parents b387fbb83529
children 0da092934c9d
files test/java/net/NetworkInterface/UniqueMacAddressesTest.java
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/net/NetworkInterface/UniqueMacAddressesTest.java	Mon Feb 17 16:15:50 2014 +0000
+++ b/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);
+                }
             }
         }
     }