diff --git a/bindings/java/src/org/hyperic/sigar/test/SigarTestCase.java b/bindings/java/src/org/hyperic/sigar/test/SigarTestCase.java index 654adec0..71009c59 100644 --- a/bindings/java/src/org/hyperic/sigar/test/SigarTestCase.java +++ b/bindings/java/src/org/hyperic/sigar/test/SigarTestCase.java @@ -38,6 +38,9 @@ public abstract class SigarTestCase extends TestCase { private static boolean verbose = "true".equals(System.getProperty("sigar.testVerbose")); + protected static final boolean JDK_14_COMPAT = + System.getProperty("java.specification.version").compareTo("1.4") >= 0; + private static PrintStream out = System.out; public SigarTestCase(String name) { diff --git a/bindings/java/src/org/hyperic/sigar/test/TestNetStatPort.java b/bindings/java/src/org/hyperic/sigar/test/TestNetStatPort.java index 9bc0b72e..dfcf1e3d 100644 --- a/bindings/java/src/org/hyperic/sigar/test/TestNetStatPort.java +++ b/bindings/java/src/org/hyperic/sigar/test/TestNetStatPort.java @@ -19,6 +19,7 @@ package org.hyperic.sigar.test; import java.net.InetAddress; +import java.util.ArrayList; import org.hyperic.sigar.NetConnection; import org.hyperic.sigar.NetFlags; @@ -62,13 +63,16 @@ public class TestNetStatPort extends SigarTestCase { NetInterfaceConfig ifconfig = sigar.getNetInterfaceConfig(null); - String[] addrs = { - ifconfig.getAddress(), - "0:0:0:0:0:0:0:1", - }; + ArrayList addrs = new ArrayList(); + addrs.add(ifconfig.getAddress()); + addrs.add(NetFlags.LOOPBACK_ADDRESS); + if (JDK_14_COMPAT) { + addrs.add(NetFlags.LOOPBACK_ADDRESS_V6); + } - for (int i=0; i= 0) { + if (JDK_14_COMPAT) { testReOK(proxy); } - else { - traceln("skipping re tests for " + spec); - } + testMalformed(proxy); testLoadFailure(proxy); }