SocketTest assumeTrue(EPOLL)

Motivation:
SocketTest should verify that EPOLL is available before running the test.

Modifications:
- Add a @BeforeClass method which assumeTrue if EPOLL is available

Result:
More robust tests than get skipped if EPOLL isn't available
This commit is contained in:
Scott Mitchell 2017-05-18 11:18:31 -07:00
parent eeb8c221e0
commit 02be19a5d4

View File

@ -16,23 +16,28 @@
package io.netty.channel.unix;
import io.netty.channel.epoll.Epoll;
import java.io.File;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
public class SocketTest {
static {
Epoll.ensureAvailability();
}
private Socket socket;
@BeforeClass
public static void beforeClass() {
assumeTrue(Epoll.isAvailable());
}
@Before
public void setup() {
socket = Socket.newSocketStream();