View | Details | Raw Unified | Return to bug 56903
Collapse All | Expand All

(-)a/java/org/apache/catalina/core/StandardContext.java (+2 lines)
Lines 920-925 public class StandardContext extends ContainerBase Link Here
920
        for (String servletName : resourceOnlyServlets) {
920
        for (String servletName : resourceOnlyServlets) {
921
            if (!first) {
921
            if (!first) {
922
                result.append(',');
922
                result.append(',');
923
            } else {
924
                first = false;
923
            }
925
            }
924
            result.append(servletName);
926
            result.append(servletName);
925
        }
927
        }
(-)a/test/org/apache/catalina/core/TestStandardContext.java (-1 / +17 lines)
Lines 19-24 package org.apache.catalina.core; Link Here
19
import java.io.File;
19
import java.io.File;
20
import java.io.IOException;
20
import java.io.IOException;
21
import java.io.PrintWriter;
21
import java.io.PrintWriter;
22
import java.util.Arrays;
22
import java.util.HashSet;
23
import java.util.HashSet;
23
import java.util.Set;
24
import java.util.Set;
24
25
Lines 48-53 import static org.junit.Assert.assertNotSame; Link Here
48
import static org.junit.Assert.assertTrue;
49
import static org.junit.Assert.assertTrue;
49
import static org.junit.Assert.fail;
50
import static org.junit.Assert.fail;
50
51
52
import org.hamcrest.CoreMatchers;
51
import org.junit.Assert;
53
import org.junit.Assert;
52
import org.junit.Test;
54
import org.junit.Test;
53
55
Lines 945-948 public class TestStandardContext extends TomcatBaseTest { Link Here
945
947
946
        Assert.assertNull(realPath);
948
        Assert.assertNull(realPath);
947
    }
949
    }
950
951
    @Test
952
    public void testBug56903() {
953
        // Set up a container
954
        Tomcat tomcat = getTomcatInstance();
955
956
        File docBase = new File(System.getProperty("java.io.tmpdir"));
957
        Context context = tomcat.addContext("",
958
                docBase.getAbsolutePath());
959
960
        context.setResourceOnlyServlets("a,b,c");
961
        Assert.assertThat(
962
                Arrays.asList(context.getResourceOnlyServlets().split(",")),
963
                CoreMatchers.hasItems("a", "b", "c"));
964
    }
948
}
965
}
949
- 

Return to bug 56903