Enabled log debugging in SslBytesServerTest to see why it fails on CI.

This commit is contained in:
Simone Bordet 2011-11-22 10:00:54 +01:00
parent 644ea655d5
commit a1eabe2b32
1 changed files with 13 additions and 2 deletions

View File

@ -66,6 +66,8 @@ public class SslBytesServerTest
@Before @Before
public void startServer() throws Exception public void startServer() throws Exception
{ {
logger.setDebugEnabled(true);
threadPool = Executors.newCachedThreadPool(); threadPool = Executors.newCachedThreadPool();
server = new Server(); server = new Server();
@ -107,7 +109,8 @@ public class SslBytesServerTest
} }
}; };
connector.setPort(5870); // TODO: make this random // connector.setPort(5870);
connector.setPort(0);
File keyStore = MavenTestingUtils.getTestResourceFile("keystore"); File keyStore = MavenTestingUtils.getTestResourceFile("keystore");
SslContextFactory cf = connector.getSslContextFactory(); SslContextFactory cf = connector.getSslContextFactory();
@ -934,10 +937,12 @@ public class SslBytesServerTest
// Renegotiation Handshake // Renegotiation Handshake
TLSRecord record = proxy.readFromClient(); TLSRecord record = proxy.readFromClient();
Assert.assertEquals(TLSRecord.Type.HANDSHAKE, record.getType());
proxy.flushToServer(record); proxy.flushToServer(record);
// Renegotiation Handshake // Renegotiation Handshake
record = proxy.readFromServer(); record = proxy.readFromServer();
Assert.assertEquals(TLSRecord.Type.HANDSHAKE, record.getType());
proxy.flushToClient(record); proxy.flushToClient(record);
// Renegotiation Change Cipher // Renegotiation Change Cipher
@ -947,6 +952,7 @@ public class SslBytesServerTest
// Renegotiation Handshake // Renegotiation Handshake
record = proxy.readFromServer(); record = proxy.readFromServer();
Assert.assertEquals(TLSRecord.Type.HANDSHAKE, record.getType());
proxy.flushToClient(record); proxy.flushToClient(record);
// Trigger a read to have the client write the final renegotiation steps // Trigger a read to have the client write the final renegotiation steps
@ -968,6 +974,7 @@ public class SslBytesServerTest
// Renegotiation Handshake // Renegotiation Handshake
record = proxy.readFromClient(); record = proxy.readFromClient();
Assert.assertEquals(TLSRecord.Type.HANDSHAKE, record.getType());
proxy.flushToServer(record); proxy.flushToServer(record);
Assert.assertNull(renegotiation.get(5, TimeUnit.SECONDS)); Assert.assertNull(renegotiation.get(5, TimeUnit.SECONDS));
@ -1058,6 +1065,7 @@ public class SslBytesServerTest
// Renegotiation Handshake // Renegotiation Handshake
TLSRecord record = proxy.readFromClient(); TLSRecord record = proxy.readFromClient();
Assert.assertEquals(TLSRecord.Type.HANDSHAKE, record.getType());
byte[] bytes = record.getBytes(); byte[] bytes = record.getBytes();
byte[] chunk1 = new byte[2 * bytes.length / 3]; byte[] chunk1 = new byte[2 * bytes.length / 3];
System.arraycopy(bytes, 0, chunk1, 0, chunk1.length); System.arraycopy(bytes, 0, chunk1, 0, chunk1.length);
@ -1070,6 +1078,7 @@ public class SslBytesServerTest
// Renegotiation Handshake // Renegotiation Handshake
record = proxy.readFromServer(); record = proxy.readFromServer();
Assert.assertEquals(TLSRecord.Type.HANDSHAKE, record.getType());
proxy.flushToClient(record); proxy.flushToClient(record);
// Renegotiation Change Cipher // Renegotiation Change Cipher
@ -1079,6 +1088,7 @@ public class SslBytesServerTest
// Renegotiation Handshake // Renegotiation Handshake
record = proxy.readFromServer(); record = proxy.readFromServer();
Assert.assertEquals(TLSRecord.Type.HANDSHAKE, record.getType());
proxy.flushToClient(record); proxy.flushToClient(record);
// Trigger a read to have the client write the final renegotiation steps // Trigger a read to have the client write the final renegotiation steps
@ -1222,7 +1232,8 @@ public class SslBytesServerTest
public void start() throws Exception public void start() throws Exception
{ {
serverSocket = new ServerSocket(5871); // TODO: make this random // serverSocket = new ServerSocket(5871);
serverSocket = new ServerSocket(0);
Thread acceptor = new Thread(this); Thread acceptor = new Thread(this);
acceptor.start(); acceptor.start();
server = new Socket(serverHost, serverPort); server = new Socket(serverHost, serverPort);