Issue #2135 - Correct testHelloWorld failure by backporting test from 9.4.x

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2018-06-06 14:24:53 -05:00
parent c4ea4a2d96
commit df29e292af
1 changed files with 26 additions and 19 deletions

View File

@ -45,6 +45,7 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.util.thread.Scheduler;
import org.eclipse.jetty.util.thread.TimerScheduler;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
@ -139,6 +140,12 @@ public class SslConnectionTest
__sslCtxFactory.start();
}
@AfterClass
public static void stopSsl() throws Exception
{
__sslCtxFactory.stop();
}
@Before
public void startManager() throws Exception
{
@ -259,10 +266,11 @@ public class SslConnectionTest
@Test
public void testHelloWorld() throws Exception
{
Socket client = newClient();
try (Socket client = newClient())
{
client.setSoTimeout(60000);
SocketChannel server = _connector.accept();
try (SocketChannel server = _connector.accept())
{
server.configureBlocking(false);
_manager.accept(server);
@ -277,9 +285,8 @@ public class SslConnectionTest
len = 5;
while (len > 0)
len -= client.getInputStream().read(buffer);
Assert.assertEquals(1, _dispatches.get());
client.close();
}
}
}