< prev index next >
test/jdk/jdk/net/Sockets/Test.java
Print this page
rev 51542 : 8210039: move OSInfo to top level testlibrary
Reviewed-by: duke
*** 23,43 ****
/*
* @test
* @bug 8032808 8044773
* @modules jdk.net
! * @library /lib/testlibrary
! * @build jdk.testlibrary.*
* @run main/othervm -Xcheck:jni Test success
* @run main/othervm/policy=policy.fail -Xcheck:jni Test fail
* @run main/othervm/policy=policy.success -Xcheck:jni Test success
*/
- import jdk.net.ExtendedSocketOptions;
import jdk.net.SocketFlow;
import jdk.net.Sockets;
! import jdk.testlibrary.OSInfo;
import java.io.IOException;
import java.net.*;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.DatagramChannel;
--- 23,43 ----
/*
* @test
* @bug 8032808 8044773
* @modules jdk.net
! * @library /test/lib
! * @build jdk.test.lib.OSVersion jdk.test.lib.Platform
* @run main/othervm -Xcheck:jni Test success
* @run main/othervm/policy=policy.fail -Xcheck:jni Test fail
* @run main/othervm/policy=policy.success -Xcheck:jni Test success
*/
import jdk.net.SocketFlow;
import jdk.net.Sockets;
! import jdk.test.lib.Platform;
! import jdk.test.lib.OSVersion;
import java.io.IOException;
import java.net.*;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.DatagramChannel;
*** 51,61 ****
interface Runner { void run() throws Exception; }
static boolean expectSuccess;
private static final boolean expectSupport = checkExpectedOptionSupport();
- private static final double solarisVersionToCheck = 11.2;
public static void main(String[] args) throws Exception {
// quick check to see if supportedOptions() working before
// creating any sockets and libnet loaded
--- 51,60 ----
*** 188,200 ****
"UnsupportedOperationException was not thrown");
}
}
private static boolean checkExpectedOptionSupport() {
! if (OSInfo.getOSType().equals(OSInfo.OSType.SOLARIS)) {
! double solarisVersion = OSInfo.getSolarisVersion();
! if (solarisVersion >= solarisVersionToCheck) {
System.out.println("This Solaris version (" + solarisVersion
+ ") should support SO_FLOW_SLA option");
return true;
} else {
System.out.println("This Solaris version (" + solarisVersion
--- 187,200 ----
"UnsupportedOperationException was not thrown");
}
}
private static boolean checkExpectedOptionSupport() {
! if (Platform.isSolaris()) {
! OSVersion solarisVersion = OSVersion.current();
! OSVersion solarisVersionToCheck = new OSVersion(11, 2);
! if (solarisVersion.compareTo(solarisVersionToCheck) >= 0) {
System.out.println("This Solaris version (" + solarisVersion
+ ") should support SO_FLOW_SLA option");
return true;
} else {
System.out.println("This Solaris version (" + solarisVersion
< prev index next >