Clean up
This commit is contained in:
parent
a22725d9fa
commit
6f8a69b956
@ -18,25 +18,17 @@ package io.netty.test.udt.nio;
|
||||
|
||||
import io.netty.buffer.BufType;
|
||||
import io.netty.channel.udt.nio.NioUdtByteAcceptorChannel;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class NioUdtByteAcceptorChannelTest extends AbstractUdtTest {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(NioUdtByteAcceptorChannelTest.class);
|
||||
|
||||
/**
|
||||
* verify channel meta data
|
||||
*/
|
||||
@Test
|
||||
public void metadata() throws Exception {
|
||||
|
||||
assertEquals(BufType.BYTE, new NioUdtByteAcceptorChannel().metadata()
|
||||
.bufferType());
|
||||
|
||||
assertEquals(BufType.BYTE, new NioUdtByteAcceptorChannel().metadata().bufferType());
|
||||
}
|
||||
}
|
||||
|
@ -18,26 +18,17 @@ package io.netty.test.udt.nio;
|
||||
|
||||
import io.netty.buffer.BufType;
|
||||
import io.netty.channel.udt.nio.NioUdtByteConnectorChannel;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class NioUdtByteConnectorChannelTest extends AbstractUdtTest {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(NioUdtByteAcceptorChannelTest.class);
|
||||
|
||||
/**
|
||||
* verify channel meta data
|
||||
*/
|
||||
@Test
|
||||
public void metadata() throws Exception {
|
||||
|
||||
assertEquals(BufType.BYTE, new NioUdtByteConnectorChannel().metadata()
|
||||
.bufferType());
|
||||
|
||||
assertEquals(BufType.BYTE, new NioUdtByteConnectorChannel().metadata().bufferType());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,13 +22,12 @@ import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.buffer.BufType;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.udt.nio.NioUdtByteRendezvousChannel;
|
||||
import io.netty.logging.InternalLogger;
|
||||
import io.netty.logging.InternalLoggerFactory;
|
||||
import io.netty.test.udt.util.BootHelp;
|
||||
import io.netty.test.udt.util.EchoByteHandler;
|
||||
import io.netty.test.udt.util.UnitHelp;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -37,17 +36,14 @@ import static org.junit.Assert.*;
|
||||
|
||||
public class NioUdtByteRendezvousChannelTest extends AbstractUdtTest {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(NioUdtByteAcceptorChannelTest.class);
|
||||
private static final InternalLogger log = InternalLoggerFactory.getInstance(NioUdtByteAcceptorChannelTest.class);
|
||||
|
||||
/**
|
||||
* verify channel meta data
|
||||
*/
|
||||
@Test
|
||||
public void metadata() throws Exception {
|
||||
|
||||
assertEquals(BufType.BYTE, new NioUdtByteRendezvousChannel().metadata()
|
||||
.bufferType());
|
||||
|
||||
assertEquals(BufType.BYTE, new NioUdtByteRendezvousChannel().metadata().bufferType());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,7 +78,7 @@ public class NioUdtByteRendezvousChannelTest extends AbstractUdtTest {
|
||||
while (handler1.meter().count() < transferLimit
|
||||
&& handler2.meter().count() < transferLimit) {
|
||||
|
||||
NioUdtByteAcceptorChannelTest.log.info("progress : {} {}", handler1.meter().count(), handler2
|
||||
log.info("progress : {} {}", handler1.meter().count(), handler2
|
||||
.meter().count());
|
||||
|
||||
Thread.sleep(1000);
|
||||
@ -92,8 +88,8 @@ public class NioUdtByteRendezvousChannelTest extends AbstractUdtTest {
|
||||
connectFuture1.channel().close().sync();
|
||||
connectFuture2.channel().close().sync();
|
||||
|
||||
NioUdtByteAcceptorChannelTest.log.info("handler1 : {}", handler1.meter().count());
|
||||
NioUdtByteAcceptorChannelTest.log.info("handler2 : {}", handler2.meter().count());
|
||||
log.info("handler1 : {}", handler1.meter().count());
|
||||
log.info("handler2 : {}", handler2.meter().count());
|
||||
|
||||
assertTrue(handler1.meter().count() >= transferLimit);
|
||||
assertTrue(handler2.meter().count() >= transferLimit);
|
||||
|
@ -18,26 +18,17 @@ package io.netty.test.udt.nio;
|
||||
|
||||
import io.netty.buffer.BufType;
|
||||
import io.netty.channel.udt.nio.NioUdtMessageAcceptorChannel;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class NioUdtMessageAcceptorChannelTest extends AbstractUdtTest {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(NioUdtByteAcceptorChannelTest.class);
|
||||
|
||||
/**
|
||||
* verify channel meta data
|
||||
*/
|
||||
@Test
|
||||
public void metadata() throws Exception {
|
||||
|
||||
assertEquals(BufType.MESSAGE, new NioUdtMessageAcceptorChannel()
|
||||
.metadata().bufferType());
|
||||
|
||||
assertEquals(BufType.MESSAGE, new NioUdtMessageAcceptorChannel().metadata().bufferType());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -18,26 +18,17 @@ package io.netty.test.udt.nio;
|
||||
|
||||
import io.netty.buffer.BufType;
|
||||
import io.netty.channel.udt.nio.NioUdtMessageConnectorChannel;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class NioUdtMessageConnectorChannelTest extends AbstractUdtTest {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(NioUdtByteAcceptorChannelTest.class);
|
||||
|
||||
/**
|
||||
* verify channel meta data
|
||||
*/
|
||||
@Test
|
||||
public void metadata() throws Exception {
|
||||
|
||||
assertEquals(BufType.MESSAGE, new NioUdtMessageConnectorChannel()
|
||||
.metadata().bufferType());
|
||||
|
||||
assertEquals(BufType.MESSAGE, new NioUdtMessageConnectorChannel().metadata().bufferType());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,13 +22,12 @@ import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.buffer.BufType;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.udt.nio.NioUdtMessageRendezvousChannel;
|
||||
import io.netty.logging.InternalLogger;
|
||||
import io.netty.logging.InternalLoggerFactory;
|
||||
import io.netty.test.udt.util.BootHelp;
|
||||
import io.netty.test.udt.util.EchoMessageHandler;
|
||||
import io.netty.test.udt.util.UnitHelp;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -37,16 +36,14 @@ import static org.junit.Assert.*;
|
||||
|
||||
public class NioUdtMessageRendezvousChannelTest extends AbstractUdtTest {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(NioUdtByteAcceptorChannelTest.class);
|
||||
private static final InternalLogger log = InternalLoggerFactory.getInstance(NioUdtByteAcceptorChannelTest.class);
|
||||
|
||||
/**
|
||||
* verify channel meta data
|
||||
*/
|
||||
@Test
|
||||
public void metadata() throws Exception {
|
||||
|
||||
assertEquals(BufType.MESSAGE, new NioUdtMessageRendezvousChannel()
|
||||
.metadata().bufferType());
|
||||
assertEquals(BufType.MESSAGE, new NioUdtMessageRendezvousChannel().metadata().bufferType());
|
||||
|
||||
}
|
||||
|
||||
@ -86,7 +83,7 @@ public class NioUdtMessageRendezvousChannelTest extends AbstractUdtTest {
|
||||
while (handler1.meter().count() < transferLimit
|
||||
&& handler2.meter().count() < transferLimit) {
|
||||
|
||||
NioUdtByteAcceptorChannelTest.log.info("progress : {} {}", handler1.meter().count(), handler2
|
||||
log.info("progress : {} {}", handler1.meter().count(), handler2
|
||||
.meter().count());
|
||||
|
||||
Thread.sleep(1000);
|
||||
@ -96,8 +93,8 @@ public class NioUdtMessageRendezvousChannelTest extends AbstractUdtTest {
|
||||
connectFuture1.channel().close().sync();
|
||||
connectFuture2.channel().close().sync();
|
||||
|
||||
NioUdtByteAcceptorChannelTest.log.info("handler1 : {}", handler1.meter().count());
|
||||
NioUdtByteAcceptorChannelTest.log.info("handler2 : {}", handler2.meter().count());
|
||||
log.info("handler1 : {}", handler1.meter().count());
|
||||
log.info("handler2 : {}", handler2.meter().count());
|
||||
|
||||
assertTrue(handler1.meter().count() >= transferLimit);
|
||||
assertTrue(handler2.meter().count() >= transferLimit);
|
||||
|
@ -18,23 +18,17 @@ package io.netty.test.udt.nio;
|
||||
|
||||
import io.netty.channel.udt.UdtServerChannel;
|
||||
import io.netty.channel.udt.nio.NioUdtProvider;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class NioUdtProviderTest extends AbstractUdtTest {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(NioUdtProviderTest.class);
|
||||
|
||||
/**
|
||||
* verify factory
|
||||
*/
|
||||
@Test
|
||||
public void provideFactory() {
|
||||
|
||||
// bytes
|
||||
assertNotNull(NioUdtProvider.BYTE_ACCEPTOR.newChannel());
|
||||
assertNotNull(NioUdtProvider.BYTE_CONNECTOR.newChannel());
|
||||
@ -48,7 +42,5 @@ public class NioUdtProviderTest extends AbstractUdtTest {
|
||||
// acceptor types
|
||||
assertTrue(NioUdtProvider.BYTE_ACCEPTOR.newChannel() instanceof UdtServerChannel);
|
||||
assertTrue(NioUdtProvider.MESSAGE_ACCEPTOR.newChannel() instanceof UdtServerChannel);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user