Skip to content

Commit

Permalink
Issue #5684 - more disabled test cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Jun 16, 2021
1 parent f19b6fa commit 5d7cbff
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 496 deletions.
Expand Up @@ -20,6 +20,7 @@

import java.io.IOException;
import java.net.URLDecoder;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.nio.channels.UnresolvedAddressException;
import java.nio.charset.StandardCharsets;
Expand All @@ -43,7 +44,6 @@
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.toolchain.test.IO;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;

Expand Down Expand Up @@ -292,24 +292,21 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r

@ParameterizedTest
@ArgumentsSource(ScenarioProvider.class)
@Disabled
public void testRedirectFailed(Scenario scenario) throws Exception
{
// TODO this test is failing with timout after an ISP upgrade?? DNS dependent?
start(scenario, new RedirectHandler());

try
{
client.newRequest("localhost", connector.getLocalPort())
ExecutionException e = assertThrows(ExecutionException.class,
() -> client.newRequest("localhost", connector.getLocalPort())
.scheme(scenario.getScheme())
.path("/303/doesNotExist/done")
.timeout(5, TimeUnit.SECONDS)
.send();
}
catch (ExecutionException x)
{
assertThat(x.getCause(), Matchers.instanceOf(UnresolvedAddressException.class));
}
.send());

assertThat("Cause", e.getCause(), Matchers.anyOf(
Matchers.instanceOf(UnresolvedAddressException.class),
Matchers.instanceOf(UnknownHostException.class))
);
}

@ParameterizedTest
Expand Down
Expand Up @@ -69,7 +69,6 @@
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnJre;
import org.junit.jupiter.api.condition.JRE;
Expand Down Expand Up @@ -265,51 +264,6 @@ public void handshakeFailed(Event event, Throwable failure)
assertTrue(clientLatch.await(1, TimeUnit.SECONDS));
}

// In JDK 11+, a mismatch on the client does not generate any bytes towards
// the server, while in previous JDKs the client sends to the server the close_notify.
// @EnabledOnJre({JRE.JAVA_8, JRE.JAVA_9, JRE.JAVA_10})
@Disabled("No longer viable, TLS protocol behavior changed in 8u272")
public void testMismatchBetweenTLSProtocolAndTLSCiphersOnClient() throws Exception
{
SslContextFactory serverTLSFactory = createServerSslContextFactory();
startServer(serverTLSFactory, new EmptyServerHandler());

CountDownLatch serverLatch = new CountDownLatch(1);
connector.addBean(new SslHandshakeListener()
{
@Override
public void handshakeFailed(Event event, Throwable failure)
{
serverLatch.countDown();
}
});

SslContextFactory clientTLSFactory = createClientSslContextFactory();
// TLS 1.1 protocol, but only TLS 1.2 ciphers.
clientTLSFactory.setIncludeProtocols("TLSv1.1");
clientTLSFactory.setIncludeCipherSuites("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256");
startClient(clientTLSFactory);

CountDownLatch clientLatch = new CountDownLatch(1);
client.addBean(new SslHandshakeListener()
{
@Override
public void handshakeFailed(Event event, Throwable failure)
{
clientLatch.countDown();
}
});

assertThrows(ExecutionException.class, () ->
client.newRequest("localhost", connector.getLocalPort())
.scheme(HttpScheme.HTTPS.asString())
.timeout(5, TimeUnit.SECONDS)
.send());

assertTrue(serverLatch.await(1, TimeUnit.SECONDS));
assertTrue(clientLatch.await(1, TimeUnit.SECONDS));
}

@Test
public void testHandshakeSucceeded() throws Exception
{
Expand Down

0 comments on commit 5d7cbff

Please sign in to comment.