Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/org/labkey/test/LabKeySiteWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,6 @@ private void waitForStartup()
throw new RuntimeException("Webapp failed to start up after " + MAX_SERVER_STARTUP_WAIT_SECONDS + " seconds.", lastError);
}
log("Server is running.");
WebTestHelper.setUseContainerRelativeUrl((Boolean)executeScript("return LABKEY.experimental.containerRelativeURL;"));
}

@LogMethod
Expand Down
27 changes: 12 additions & 15 deletions src/org/labkey/test/WebDriverWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -1210,25 +1210,22 @@ public long beginAt(String url, int millis, boolean acceptAlerts)
logMessage = "Navigating to " + relativeURL;
}

if (WebTestHelper.isUseContainerRelativeUrl())
try
{
try
if (new Crawler.ControllerActionId(relativeURL).isControllerFirstUrl() && !_controllerFirstUrls.contains(url))
{
if (new Crawler.ControllerActionId(relativeURL).isControllerFirstUrl() && !_controllerFirstUrls.contains(url))
{
_controllerFirstUrls.add(url);
RuntimeException ex = new RuntimeException("Controller-first url used: " + relativeURL);
if (TestProperties.isControllerFirstUrlFatal())
throw ex;
else
TestLogger.log().warn(ex.getMessage(), ex);
}
}
catch (IllegalArgumentException e)
{
TestLogger.warn("Unable to parse URL: " + relativeURL, e);
_controllerFirstUrls.add(url);
RuntimeException ex = new RuntimeException("Controller-first url used: " + relativeURL);
if (TestProperties.isControllerFirstUrlFatal())
throw ex;
else
TestLogger.log().warn(ex.getMessage(), ex);
}
}
catch (IllegalArgumentException e)
{
TestLogger.warn("Unable to parse URL: " + relativeURL, e);
}

final String fullURL = WebTestHelper.getBaseURL() + relativeURL;
final boolean expectPageLoad = expectPageLoad(fullURL);
Expand Down
13 changes: 0 additions & 13 deletions src/org/labkey/test/WebTestHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.hc.client5.http.impl.auth.BasicAuthCache;
import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.client5.http.impl.io.ManagedHttpClientConnectionFactory;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;
Expand Down Expand Up @@ -99,7 +98,6 @@
*/
public class WebTestHelper
{

private static final Logger LOG = LogManager.getLogger(WebTestHelper.class);

public static final Random RANDOM = new Random();
Expand All @@ -114,19 +112,13 @@ public class WebTestHelper
private static String _contextPath = null;
public static final int MAX_LEAK_LIMIT = 0;
public static final int GC_ATTEMPT_LIMIT = 6;
private static boolean USE_CONTAINER_RELATIVE_URL = true;
private static final Map<String, Map<String, Cookie>> savedCookies = new HashMap<>();
private static final Map<String, String> savedSessionKeys = new HashMap<>();
private static final Map<String, String> savedApiKeys = new HashMap<>();
private static final Set<String> deletedApiKeys = new HashSet<>();

static { TestProperties.load(); }

public static void setUseContainerRelativeUrl(boolean useContainerRelativeUrl)
{
USE_CONTAINER_RELATIVE_URL = useContainerRelativeUrl;
}

/**
* Save cookies to be used by HTTP requests
*/
Expand Down Expand Up @@ -229,11 +221,6 @@ public static void deleteApiKey(Connection connection, String apiKey)
}
}

public static boolean isUseContainerRelativeUrl()
{
return USE_CONTAINER_RELATIVE_URL;
}

private static void acceptLocalhostCert() throws Exception
{
String keystorePassword = System.getProperty("keystore.password", "changeit");
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/test/util/Crawler.java
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ public boolean underCreatedProject()

private void checkControllerRelativeUrl()
{
if (_actionId != null && _actionId.isControllerFirstUrl() && WebTestHelper.isUseContainerRelativeUrl() && !_controllerFirstUrls.contains(_actionId))
if (_actionId != null && _actionId.isControllerFirstUrl() && !_controllerFirstUrls.contains(_actionId))
{
_controllerFirstUrls.add(_actionId);
RuntimeException ex = new RuntimeException("Found a controller-first URL (%s) on %s".formatted(getUrlText(), getOrigin()));
Expand Down
13 changes: 2 additions & 11 deletions src/org/labkey/test/util/URLBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ public String buildRelativeURL()
{
StringBuilder url = new StringBuilder();

if (!WebTestHelper.isUseContainerRelativeUrl())
{
url.append("/");
url.append(_controller);
}

if (_containerPath != null) // null is root container; nothing to append.
{
url.append("/");
Expand All @@ -167,11 +161,8 @@ public String buildRelativeURL()
}

url.append("/");
if (WebTestHelper.isUseContainerRelativeUrl())
{
url.append(_controller);
url.append("-");
}
url.append(_controller);
url.append("-");
url.append(_action);
if (!_action.contains("."))
url.append(".view");
Expand Down