Skip to content

Commit

Permalink
experiment: use Jetty 11.0.15 with unchanged HeaderRule
Browse files Browse the repository at this point in the history
  • Loading branch information
tmetzke committed Jun 8, 2023
1 parent e7acb28 commit fb29d80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion webapps/assembly-jakarta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<version.xml.jaxb-impl>4.0.2</version.xml.jaxb-impl>
<version.resteasy>6.2.3.Final</version.resteasy>
<version.jetty>11.0.14</version.jetty>
<version.jetty>11.0.15</version.jetty>
<version.jersey2>3.1.1</version.jersey2>

<web.resources.override>${jakarta.runtime}/default/webapp</web.resources.override>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
*/
package org.camunda.bpm.webapp.impl.util;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.rules.ExternalResource;

import java.io.IOException;
import java.net.BindException;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.rules.ExternalResource;

/**
* @author Tassilo Weidner
Expand All @@ -35,9 +35,7 @@ public class HeaderRule extends ExternalResource {
protected Server server = new Server(SERVER_PORT);
protected WebAppContext webAppContext = new WebAppContext();
protected HttpURLConnection connection = null;
protected int startupRetries = 3;

@Override
protected void before() {
try {
server.stop();
Expand All @@ -46,7 +44,6 @@ protected void before() {
}
}

@Override
protected void after() {
try {
server.stop();
Expand All @@ -69,19 +66,8 @@ public void startServer(String webDescriptor, String scope, String contextPath)
try {
server.start();
} catch (Exception e) {
if (e.getCause() instanceof BindException && startupRetries > 0) {
startupRetries--;
try {
Thread.sleep(500L);
} catch (Exception ex) {
}
startServer(webDescriptor, scope, contextPath);
} else {
startupRetries = 3;
throw new RuntimeException(e);
}
throw new RuntimeException(e);
}
startupRetries = 3;
}

public void performRequest() {
Expand Down Expand Up @@ -161,11 +147,11 @@ public int getResponseCode() {
throw new RuntimeException(e);
}
}

public String getSessionCookieRegex(String path, String sameSite, boolean secure) {
return getSessionCookieRegex(path, "JSESSIONID", sameSite, secure);
}

public String getSessionCookieRegex(String path, String cookieName, String sameSite, boolean secure) {
StringBuilder regex = new StringBuilder(cookieName + "=.*;\\W*Path=/");
if (path != null) {
Expand Down

0 comments on commit fb29d80

Please sign in to comment.