NIHVIVO-222 Selenium requires that the Base URL end in /, so the webapp name cannot be the last thing in the URL. Fix the logic.

This commit is contained in:
jeb228 2010-08-26 14:55:21 +00:00
parent 3b879c09ef
commit 8abffc78ee
2 changed files with 4 additions and 2 deletions

View file

@ -92,7 +92,8 @@ public class ModelCleanerProperties {
String websiteUrl = getRequiredProperty(props, String websiteUrl = getRequiredProperty(props,
SeleniumRunnerParameters.PROP_WEBSITE_URL); SeleniumRunnerParameters.PROP_WEBSITE_URL);
String webappName = getRequiredProperty(props, PROP_VIVO_WEBAPP_NAME); String webappName = getRequiredProperty(props, PROP_VIVO_WEBAPP_NAME);
if (!websiteUrl.endsWith(webappName)) { if ((!websiteUrl.endsWith(webappName))
&& (!websiteUrl.endsWith(webappName + "/"))) {
throw new IllegalArgumentException("The " + PROP_VIVO_WEBAPP_NAME throw new IllegalArgumentException("The " + PROP_VIVO_WEBAPP_NAME
+ " must be the last item in the " + " must be the last item in the "
+ SeleniumRunnerParameters.PROP_WEBSITE_URL); + SeleniumRunnerParameters.PROP_WEBSITE_URL);

View file

@ -44,7 +44,8 @@ public class TomcatController {
private String figureBaseUrl() { private String figureBaseUrl() {
String url = parms.getWebsiteUrl(); String url = parms.getWebsiteUrl();
return url.substring(0, url.length() - webappName.length()); int end = url.lastIndexOf(webappName);
return url.substring(0, end);
} }
/** /**