Commit f78adaae authored by Mikael Ståldal's avatar Mikael Ståldal
Browse files

Ignore socket option tests which does not work on Java 8+

parent 68e43b84
Showing with 20 additions and 2 deletions
+20 -2
......@@ -36,6 +36,7 @@ import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.AvailablePortFinder;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.ClassRule;
import org.junit.Test;
......@@ -109,11 +110,19 @@ public class SecureSocketAppenderSocketOptionsTest {
Assert.assertEquals(false, socket.getKeepAlive());
Assert.assertEquals(false, socket.getReuseAddress());
Assert.assertEquals(false, socket.getTcpNoDelay());
Assert.assertEquals(Rfc1349TrafficClass.IPTOS_LOWCOST.value(), socket.getTrafficClass());
// Assert.assertEquals(10000, socket.getReceiveBufferSize());
// This settings changes while we are running, so we cannot assert it.
// Assert.assertEquals(8000, socket.getSendBufferSize());
Assert.assertEquals(12345, socket.getSoLinger());
Assert.assertEquals(54321, socket.getSoTimeout());
}
@Test
public void testSocketTrafficClass() throws IOException {
Assume.assumeTrue("Run only on Java 7", System.getProperty("java.specification.version").equals("1.7"));
final SocketAppender appender = loggerContextRule.getAppender("socket", SocketAppender.class);
final TcpSocketManager manager = (TcpSocketManager) appender.getManager();
final Socket socket = manager.getSocket();
Assert.assertEquals(Rfc1349TrafficClass.IPTOS_LOWCOST.value(), socket.getTrafficClass());
}
}
......@@ -29,6 +29,7 @@ import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.AvailablePortFinder;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.ClassRule;
import org.junit.Test;
......@@ -89,11 +90,19 @@ public class SocketAppenderSocketOptionsTest {
Assert.assertEquals(false, socket.getOOBInline());
Assert.assertEquals(false, socket.getReuseAddress());
Assert.assertEquals(false, socket.getTcpNoDelay());
Assert.assertEquals(Rfc1349TrafficClass.IPTOS_LOWCOST.value(), socket.getTrafficClass());
// Assert.assertEquals(10000, socket.getReceiveBufferSize());
// This settings changes while we are running, so we cannot assert it.
// Assert.assertEquals(8000, socket.getSendBufferSize());
Assert.assertEquals(12345, socket.getSoLinger());
Assert.assertEquals(54321, socket.getSoTimeout());
}
@Test
public void testSocketTrafficClass() throws IOException {
Assume.assumeTrue("Run only on Java 7", System.getProperty("java.specification.version").equals("1.7"));
final SocketAppender appender = loggerContextRule.getAppender("socket", SocketAppender.class);
final TcpSocketManager manager = (TcpSocketManager) appender.getManager();
final Socket socket = manager.getSocket();
Assert.assertEquals(Rfc1349TrafficClass.IPTOS_LOWCOST.value(), socket.getTrafficClass());
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment