Skip to content

Commit

Permalink
WFLY-5756 Unable to exclude root context (/) via excluded-contexts in…
Browse files Browse the repository at this point in the history
… mod_cluster subsystem
  • Loading branch information
rhusar committed Dec 2, 2015
1 parent 1ed22f0 commit 576e71f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Expand Up @@ -59,7 +59,8 @@ public Host getHost() {

@Override
public String getPath() {
return this.deployment.getDeploymentInfo().getContextPath();
String path = this.deployment.getDeploymentInfo().getContextPath();
return "/".equals(path) ? "" : path;
}

@Override
Expand Down
Expand Up @@ -93,8 +93,10 @@ public Set<String> getAliases() {

@Override
public Context findContext(String path) {
String findPath = "".equals(path) ? "/" : path;

for (Deployment deployment : this.host.getDeployments()) {
if (deployment.getDeploymentInfo().getContextPath().equals(path)) {
if (deployment.getDeploymentInfo().getContextPath().equals(findPath)) {
return new UndertowContext(deployment, this);
}
}
Expand Down
Expand Up @@ -58,7 +58,7 @@ public void getHost() {
@Test
public void getPath() {
DeploymentInfo info = new DeploymentInfo();
String expected = "/";
String expected = "";
info.setContextPath(expected);

when(this.deployment.getDeploymentInfo()).thenReturn(info);
Expand Down
Expand Up @@ -68,7 +68,7 @@ public void getEngine() {
public void getContexts() {
Deployment deployment = mock(Deployment.class);
DeploymentInfo info = new DeploymentInfo();
String expectedPath = "/";
String expectedPath = "";
info.setContextPath(expectedPath);
HttpHandler handler = mock(HttpHandler.class);

Expand All @@ -89,7 +89,7 @@ public void getContexts() {
public void findContext() {
Deployment deployment = mock(Deployment.class);
DeploymentInfo info = new DeploymentInfo();
String expectedPath = "/";
String expectedPath = "";
info.setContextPath(expectedPath);
HttpHandler handler = mock(HttpHandler.class);

Expand Down

0 comments on commit 576e71f

Please sign in to comment.