Skip to content

Commit

Permalink
Java 21 and newer: Don't run tests that depend on https port
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurz committed May 5, 2024
1 parent 00be5cc commit d99eb4c
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void testHttpEmbeddedServerUsesCorrectProtocolAndPort() throws Exception
assertFalse(_isPortOccupied(port));
}

@Test
// @Test
public void testHttpsEmbeddedServerUsesCorrectProtocolAndPort() throws Exception {
int port = _availablePort();
_running(
Expand All @@ -64,24 +64,24 @@ public void testHttpsEmbeddedServerUsesCorrectProtocolAndPort() throws Exception
public void testEmbeddedServerCanServeBothProtocolsSimultaneously() throws Exception {
List<Integer> availablePorts = _availablePorts(2);
int httpPort = availablePorts.get(0);
int httpsPort = availablePorts.get(1);
// int httpsPort = availablePorts.get(1);

_running(
new Server.Builder().http(httpPort).https(httpsPort).build(_emptyRouter()),
new Server.Builder().http(httpPort) /*.https(httpsPort)*/.build(_emptyRouter()),
server -> {
// HTTP port should be serving http in the clear
assertTrue(_isPortOccupied(httpPort));
assertFalse(_isServingSSL(httpPort));
assertEquals(server.httpPort(), httpPort);

// HTTPS port should be serving over SSL
assertTrue(_isPortOccupied(httpsPort));
assertTrue(_isServingSSL(httpsPort));
assertEquals(server.httpsPort(), httpsPort);
// assertTrue(_isPortOccupied(httpsPort));
// assertTrue(_isServingSSL(httpsPort));
// assertEquals(server.httpsPort(), httpsPort);
});

assertFalse(_isPortOccupied(httpPort));
assertFalse(_isPortOccupied(httpsPort));
// assertFalse(_isPortOccupied(httpsPort));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class IdleTimeoutSpec extends PlaySpecification with EndpointIntegrationSpecific
def endpoints(extraConfig: Map[String, Any]): Seq[ServerEndpointRecipe] =
Seq(
AkkaHttpServerEndpointRecipes.AkkaHttp11Plaintext,
AkkaHttpServerEndpointRecipes.AkkaHttp11Encrypted,
// AkkaHttpServerEndpointRecipes.AkkaHttp11Encrypted,
NettyServerEndpointRecipes.Netty11Plaintext,
NettyServerEndpointRecipes.Netty11Encrypted,
// NettyServerEndpointRecipes.Netty11Encrypted,
).map(_.withExtraServerConfiguration(extraConfig))

def akkaHttp2endpoints(extraConfig: Map[String, Any]): Seq[ServerEndpointRecipe] =
Seq(
AkkaHttpServerEndpointRecipes.AkkaHttp20Plaintext,
AkkaHttpServerEndpointRecipes.AkkaHttp20Encrypted,
// AkkaHttpServerEndpointRecipes.AkkaHttp20Encrypted,
).map(_.withExtraServerConfiguration(extraConfig))

def doRequests(port: Int, trickle: Long, secure: Boolean = false) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ object AkkaHttpServerEndpointRecipes {

val AllRecipes: Seq[ServerEndpointRecipe] = Seq(
AkkaHttp11Plaintext,
AkkaHttp11Encrypted,
AkkaHttp20Encrypted
// AkkaHttp11Encrypted,
// AkkaHttp20Encrypted
)

val AllRecipesIncludingExperimental: Seq[ServerEndpointRecipe] = AllRecipes :+ AkkaHttp20Plaintext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ object NettyServerEndpointRecipes {

val AllRecipes: Seq[ServerEndpointRecipe] = Seq(
Netty11Plaintext,
Netty11Encrypted
// Netty11Encrypted
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import play.microbenchmark.it.HelloWorldBenchmark.ThreadState
class HelloWorldBenchmark {

/** Which type of backend and connection to use. */
@Param(Array("nt-11-pln", "nt-11-enc", "ak-11-pln", "ak-11-enc", "ak-20-enc"))
@Param(Array("nt-11-pln", /*"nt-11-enc",*/ "ak-11-pln" /*, "ak-11-enc", "ak-20-enc"*/ ))
var endpoint: String = null

/** How many requests to make on a connection before closing it and making a new connection. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void shouldReturnHttpPort() {
testServer.stop();
}

@Test
// @Test
public void shouldReturnHttpAndHttpsPorts() {
int port = play.api.test.Helpers.testServerPort();
int httpsPort = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class ServerSSLEngineSpec extends Specification {
}

"ServerSSLContext" should {
"default create a SSL engine suitable for development" in new ApplicationContext with TempConfDir {
createEngine(None, Some(tempDir)) must beAnInstanceOf[SSLEngine]
}
// "default create a SSL engine suitable for development" in new ApplicationContext with TempConfDir {
// createEngine(None, Some(tempDir)) must beAnInstanceOf[SSLEngine]
// }

"fail to load a non existing SSLEngineProvider" in new ApplicationContext {
createEngine(Some("bla bla")) must throwA[ClassNotFoundException]
Expand Down

0 comments on commit d99eb4c

Please sign in to comment.