System.out.println -> InternalLogger
- Remove unnecessary output, too
This commit is contained in:
parent
f428853b35
commit
6288e02a9a
@ -16,6 +16,17 @@
|
|||||||
package io.netty.testsuite.transport.socket;
|
package io.netty.testsuite.transport.socket;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
|
import io.netty.channel.Channel;
|
||||||
|
import io.netty.channel.ChannelException;
|
||||||
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
import io.netty.channel.ChannelPipelineException;
|
||||||
|
import io.netty.channel.socket.SocketChannelConfig;
|
||||||
|
import io.netty.logging.InternalLogger;
|
||||||
|
import io.netty.logging.InternalLoggerFactory;
|
||||||
|
import io.netty.testsuite.util.DummyHandler;
|
||||||
|
import io.netty.util.SocketAddresses;
|
||||||
|
import io.netty.util.internal.ExecutorUtil;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
@ -25,22 +36,6 @@ import java.util.concurrent.Executor;
|
|||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
import io.netty.bootstrap.ClientBootstrap;
|
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
|
||||||
import io.netty.channel.Channel;
|
|
||||||
import io.netty.channel.ChannelException;
|
|
||||||
import io.netty.channel.ChannelFactory;
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
|
||||||
import io.netty.channel.ChannelPipelineException;
|
|
||||||
import io.netty.channel.ChannelPipelineFactory;
|
|
||||||
import io.netty.channel.ChildChannelStateEvent;
|
|
||||||
import io.netty.channel.ServerChannelFactory;
|
|
||||||
import io.netty.channel.SimpleChannelUpstreamHandler;
|
|
||||||
import io.netty.channel.socket.SocketChannelConfig;
|
|
||||||
import io.netty.testsuite.util.DummyHandler;
|
|
||||||
import io.netty.util.SocketAddresses;
|
|
||||||
import io.netty.util.internal.ExecutorUtil;
|
|
||||||
|
|
||||||
import org.easymock.EasyMock;
|
import org.easymock.EasyMock;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
@ -52,6 +47,9 @@ import org.junit.Test;
|
|||||||
*/
|
*/
|
||||||
public abstract class AbstractSocketServerBootstrapTest {
|
public abstract class AbstractSocketServerBootstrapTest {
|
||||||
|
|
||||||
|
private static final InternalLogger logger =
|
||||||
|
InternalLoggerFactory.getInstance(AbstractSocketServerBootstrapTest.class);
|
||||||
|
|
||||||
private static final boolean BUFSIZE_MODIFIABLE;
|
private static final boolean BUFSIZE_MODIFIABLE;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@ -66,12 +64,12 @@ public abstract class AbstractSocketServerBootstrapTest {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
bufSizeModifiable = false;
|
bufSizeModifiable = false;
|
||||||
System.err.println(
|
logger.warn(
|
||||||
"Socket.getReceiveBufferSize() does not work: " + e);
|
"Socket.getReceiveBufferSize() does not work: " + e);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
bufSizeModifiable = false;
|
bufSizeModifiable = false;
|
||||||
System.err.println(
|
logger.warn(
|
||||||
"Socket.setReceiveBufferSize() does not work: " + e);
|
"Socket.setReceiveBufferSize() does not work: " + e);
|
||||||
} finally {
|
} finally {
|
||||||
BUFSIZE_MODIFIABLE = bufSizeModifiable;
|
BUFSIZE_MODIFIABLE = bufSizeModifiable;
|
||||||
|
@ -16,6 +16,17 @@
|
|||||||
package io.netty.testsuite.transport.socket;
|
package io.netty.testsuite.transport.socket;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
|
import io.netty.buffer.ChannelBuffer;
|
||||||
|
import io.netty.buffer.ChannelBuffers;
|
||||||
|
import io.netty.channel.Channel;
|
||||||
|
import io.netty.channel.ChannelFuture;
|
||||||
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
import io.netty.handler.ssl.SslHandler;
|
||||||
|
import io.netty.logging.InternalLogger;
|
||||||
|
import io.netty.logging.InternalLoggerFactory;
|
||||||
|
import io.netty.util.SocketAddresses;
|
||||||
|
import io.netty.util.internal.ExecutorUtil;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -41,25 +52,6 @@ import javax.net.ssl.TrustManager;
|
|||||||
import javax.net.ssl.TrustManagerFactorySpi;
|
import javax.net.ssl.TrustManagerFactorySpi;
|
||||||
import javax.net.ssl.X509TrustManager;
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
|
||||||
import io.netty.bootstrap.ClientBootstrap;
|
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
|
||||||
import io.netty.buffer.ChannelBuffer;
|
|
||||||
import io.netty.buffer.ChannelBuffers;
|
|
||||||
import io.netty.channel.Channel;
|
|
||||||
import io.netty.channel.ChannelFactory;
|
|
||||||
import io.netty.channel.ChannelFuture;
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
|
||||||
import io.netty.channel.ChannelStateEvent;
|
|
||||||
import io.netty.channel.ExceptionEvent;
|
|
||||||
import io.netty.channel.MessageEvent;
|
|
||||||
import io.netty.channel.SimpleChannelUpstreamHandler;
|
|
||||||
import io.netty.handler.execution.ExecutionHandler;
|
|
||||||
import io.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
|
|
||||||
import io.netty.handler.ssl.SslHandler;
|
|
||||||
import io.netty.logging.InternalLogger;
|
|
||||||
import io.netty.logging.InternalLoggerFactory;
|
|
||||||
import io.netty.util.SocketAddresses;
|
|
||||||
import io.netty.util.internal.ExecutorUtil;
|
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -318,21 +310,13 @@ public abstract class AbstractSocketSslEchoTest {
|
|||||||
@Override
|
@Override
|
||||||
public void checkClientTrusted(
|
public void checkClientTrusted(
|
||||||
X509Certificate[] chain, String authType) throws CertificateException {
|
X509Certificate[] chain, String authType) throws CertificateException {
|
||||||
// Always trust - it is an example.
|
// NOOP
|
||||||
// You should do something in the real world.
|
|
||||||
// You will reach here only if you enabled client certificate auth,
|
|
||||||
// as described in SecureChatSslContextFactory.
|
|
||||||
System.err.println(
|
|
||||||
"UNKNOWN CLIENT CERTIFICATE: " + chain[0].getSubjectDN());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkServerTrusted(
|
public void checkServerTrusted(
|
||||||
X509Certificate[] chain, String authType) throws CertificateException {
|
X509Certificate[] chain, String authType) throws CertificateException {
|
||||||
// Always trust - it is an example.
|
// NOOP
|
||||||
// You should do something in the real world.
|
|
||||||
System.err.println(
|
|
||||||
"UNKNOWN SERVER CERTIFICATE: " + chain[0].getSubjectDN());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user