Fix compilation errors
This commit is contained in:
parent
b46e07089d
commit
5eea4d7ea2
@ -34,7 +34,12 @@ import org.junit.rules.ExpectedException;
|
|||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNotSame;
|
||||||
|
import static org.junit.Assert.assertSame;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
public class SimpleChannelPoolTest {
|
public class SimpleChannelPoolTest {
|
||||||
private static final String LOCAL_ADDR_ID = "test.id";
|
private static final String LOCAL_ADDR_ID = "test.id";
|
||||||
@ -157,7 +162,7 @@ public class SimpleChannelPoolTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testUnhealthyChannelIsNotOffered() throws Exception {
|
public void testUnhealthyChannelIsNotOffered() throws Exception {
|
||||||
EventLoopGroup group = new DefaultEventLoopGroup();
|
EventLoopGroup group = new LocalEventLoopGroup();
|
||||||
LocalAddress addr = new LocalAddress(LOCAL_ADDR_ID);
|
LocalAddress addr = new LocalAddress(LOCAL_ADDR_ID);
|
||||||
Bootstrap cb = new Bootstrap();
|
Bootstrap cb = new Bootstrap();
|
||||||
cb.remoteAddress(addr);
|
cb.remoteAddress(addr);
|
||||||
@ -170,7 +175,7 @@ public class SimpleChannelPoolTest {
|
|||||||
.childHandler(new ChannelInitializer<LocalChannel>() {
|
.childHandler(new ChannelInitializer<LocalChannel>() {
|
||||||
@Override
|
@Override
|
||||||
public void initChannel(LocalChannel ch) throws Exception {
|
public void initChannel(LocalChannel ch) throws Exception {
|
||||||
ch.pipeline().addLast(new ChannelHandlerAdapter());
|
ch.pipeline().addLast(new ChannelInboundHandlerAdapter());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -188,8 +193,6 @@ public class SimpleChannelPoolTest {
|
|||||||
channel1.close().syncUninterruptibly();
|
channel1.close().syncUninterruptibly();
|
||||||
try {
|
try {
|
||||||
pool.release(channel1).syncUninterruptibly();
|
pool.release(channel1).syncUninterruptibly();
|
||||||
} catch (Exception e) {
|
|
||||||
throw e;
|
|
||||||
} finally {
|
} finally {
|
||||||
sc.close().syncUninterruptibly();
|
sc.close().syncUninterruptibly();
|
||||||
channel2.close().syncUninterruptibly();
|
channel2.close().syncUninterruptibly();
|
||||||
@ -205,7 +208,7 @@ public class SimpleChannelPoolTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testUnhealthyChannelIsOfferedWhenNoHealthCheckRequested() throws Exception {
|
public void testUnhealthyChannelIsOfferedWhenNoHealthCheckRequested() throws Exception {
|
||||||
EventLoopGroup group = new DefaultEventLoopGroup();
|
EventLoopGroup group = new LocalEventLoopGroup();
|
||||||
LocalAddress addr = new LocalAddress(LOCAL_ADDR_ID);
|
LocalAddress addr = new LocalAddress(LOCAL_ADDR_ID);
|
||||||
Bootstrap cb = new Bootstrap();
|
Bootstrap cb = new Bootstrap();
|
||||||
cb.remoteAddress(addr);
|
cb.remoteAddress(addr);
|
||||||
@ -218,7 +221,7 @@ public class SimpleChannelPoolTest {
|
|||||||
.childHandler(new ChannelInitializer<LocalChannel>() {
|
.childHandler(new ChannelInitializer<LocalChannel>() {
|
||||||
@Override
|
@Override
|
||||||
public void initChannel(LocalChannel ch) throws Exception {
|
public void initChannel(LocalChannel ch) throws Exception {
|
||||||
ch.pipeline().addLast(new ChannelHandlerAdapter());
|
ch.pipeline().addLast(new ChannelInboundHandlerAdapter());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user