Run testExtendedSocketOptions only on JDK11+ (#44055)

This functionality only works on JDK 11 or higher
This commit is contained in:
Yannick Welsch 2019-08-06 12:25:38 +02:00
parent 5b1b146099
commit a453cd489e
1 changed files with 2 additions and 0 deletions

View File

@ -17,6 +17,7 @@
package org.elasticsearch.core.internal.net;
import org.apache.lucene.util.Constants;
import org.elasticsearch.bootstrap.JavaVersion;
import org.elasticsearch.core.internal.io.IOUtils;
import org.elasticsearch.test.ESTestCase;
@ -24,6 +25,7 @@ public class NetUtilsTests extends ESTestCase {
public void testExtendedSocketOptions() {
assumeTrue("JDK possibly not supported", Constants.JVM_NAME.contains("HotSpot") || Constants.JVM_NAME.contains("OpenJDK"));
assumeTrue("JDK version not supported", JavaVersion.current().compareTo(JavaVersion.parse("11")) >= 0);
assumeTrue("Platform possibly not supported", IOUtils.LINUX || IOUtils.MAC_OS_X);
assertNotNull(NetUtils.getTcpKeepIdleSocketOptionOrNull());
assertNotNull(NetUtils.getTcpKeepIntervalSocketOptionOrNull());