Author: matthieu
Date: Fri Dec 11 10:04:51 2015
New Revision: 1719302

URL: http://svn.apache.org/viewvc?rev=1719302&view=rev
Log:
JAMES-1639 Support filters

Added:
    
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/CoolFilter.java
    
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/SpyFilter.java
    
james/project/trunk/server/container/jetty/src/test/resources/emptyfiltername.xml
    
james/project/trunk/server/container/jetty/src/test/resources/unavailablefiltername.xml
Modified:
    
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/Configuration.java
    
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java
    
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServerFactory.java
    
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/ConfigurationTest.java
    
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerFactoryTest.java
    
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerTest.java
    james/project/trunk/server/container/jetty/src/test/resources/httpserver.xml

Modified: 
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/Configuration.java
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/Configuration.java?rev=1719302&r1=1719301&r2=1719302&view=diff
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/Configuration.java
 (original)
+++ 
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/Configuration.java
 Fri Dec 11 10:04:51 2015
@@ -21,6 +21,7 @@ package org.apache.james.http.jetty;
 import java.util.Objects;
 import java.util.Optional;
 
+import javax.servlet.Filter;
 import javax.servlet.Servlet;
 
 import com.google.common.base.Preconditions;
@@ -42,6 +43,7 @@ public class Configuration {
         private static final Range<Integer> VALID_PORT_RANGE = Range.closed(1, 
65535);
 
         private ImmutableMap.Builder<String, Object> mappings;
+        private ImmutableMap.Builder<String, Object> filters;
         private Optional<Integer> port;
         
         public class ServletBinder {
@@ -64,8 +66,29 @@ public class Configuration {
             }
         }
         
+        public class FilterBinder {
+            private String filterUrl;
+
+            private FilterBinder(String filterUrl) {
+                this.filterUrl = filterUrl;
+            }
+            
+            public Configuration.Builder with(Filter filter) {
+                Preconditions.checkNotNull(filter);
+                filters.put(filterUrl, filter);
+                return Builder.this;
+            }
+
+            public Configuration.Builder with(Class<? extends Filter> 
filterClass) {
+                Preconditions.checkNotNull(filterClass);
+                filters.put(filterUrl, filterClass);
+                return Builder.this;
+            }
+        }
+        
         private Builder() {
             mappings = ImmutableMap.builder();
+            filters = ImmutableMap.builder();
             port = Optional.empty();
         }
         
@@ -74,6 +97,12 @@ public class Configuration {
             Preconditions.checkArgument(!mappingUrl.trim().isEmpty());
             return new ServletBinder(mappingUrl);
         }
+        
+        public FilterBinder filter(String mappingUrl) {
+            Preconditions.checkNotNull(mappingUrl);
+            Preconditions.checkArgument(!mappingUrl.trim().isEmpty());
+            return new FilterBinder(mappingUrl);
+        }
 
         public Builder port(int port) {
             Preconditions.checkArgument(VALID_PORT_RANGE.contains(port));
@@ -87,21 +116,28 @@ public class Configuration {
         }
         
         public Configuration build() {
-            return new Configuration(mappings.build(), port);
+            return new Configuration(mappings.build(), filters.build(), port);
         }
     }
 
     private final ImmutableMap<String, Object> mappings;
+    private final ImmutableMap<String, Object> filters;
     private final Optional<Integer> port;
 
-    private Configuration(ImmutableMap<String, Object> mappings, 
Optional<Integer> port) {
+    private Configuration(ImmutableMap<String, Object> mappings, 
ImmutableMap<String, Object> filters, Optional<Integer> port) {
         this.mappings = mappings;
+        this.filters = filters;
         this.port = port;
     }
     
     public ImmutableMap<String, Object> getMappings() {
         return mappings;
     }
+
+    public ImmutableMap<String, Object> getFilters() {
+        return filters;
+    }
+
     
     public Optional<Integer> getPort() {
         return port;
@@ -117,6 +153,7 @@ public class Configuration {
         if (that instanceof Configuration) {
             Configuration other = (Configuration) that;
             return Objects.equals(mappings, other.mappings)
+                    && Objects.equals(filters, other.filters)
                     && Objects.equals(port, other.port);
         }
         return false;
@@ -126,7 +163,9 @@ public class Configuration {
     public String toString() {
         return com.google.common.base.Objects.toStringHelper(getClass())
                 .add("mappings", mappings)
+                .add("filters", filters)
                 .add("port", port)
                 .toString();
     }
+
 }
\ No newline at end of file

Modified: 
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java?rev=1719302&r1=1719301&r2=1719302&view=diff
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java
 (original)
+++ 
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java
 Fri Dec 11 10:04:51 2015
@@ -20,12 +20,16 @@
 package org.apache.james.http.jetty;
 
 import java.io.Closeable;
+import java.util.EnumSet;
 import java.util.function.BiConsumer;
 
+import javax.servlet.DispatcherType;
+import javax.servlet.Filter;
 import javax.servlet.Servlet;
 
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.servlet.FilterHolder;
 import org.eclipse.jetty.servlet.ServletHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 
@@ -34,7 +38,6 @@ import com.google.common.collect.Maps;
 
 public class JettyHttpServer implements Closeable {
     
-    @SuppressWarnings("resource")
     public static JettyHttpServer create(Configuration configuration) {
         return new JettyHttpServer(configuration);
     }
@@ -59,7 +62,9 @@ public class JettyHttpServer implements
     private ServletHandler buildServletHandler(Configuration configuration) {
         ServletHandler servletHandler = new ServletHandler();
         BiConsumer<String, ServletHolder> addServletMapping = (path, 
servletHolder) -> servletHandler.addServletWithMapping(servletHolder, path);
+        BiConsumer<String, FilterHolder> addFilterMapping = (path, 
filterHolder) -> servletHandler.addFilterWithMapping(filterHolder, path, 
EnumSet.of(DispatcherType.REQUEST));
         Maps.transformEntries(configuration.getMappings(), 
this::toServletHolder).forEach(addServletMapping);
+        Maps.transformEntries(configuration.getFilters(), 
this::toFilterHolder).forEach(addFilterMapping);
         return servletHandler;
     }
 
@@ -72,6 +77,14 @@ public class JettyHttpServer implements
         return new ServletHolder((Class<? extends Servlet>)value);
     }
     
+    @SuppressWarnings("unchecked")
+    private FilterHolder toFilterHolder(String path, Object value) {
+        if (value instanceof Filter) {
+            return new FilterHolder((Filter)value);
+        }
+        return new FilterHolder((Class<? extends Filter>)value);
+    }
+    
     public JettyHttpServer start() throws Exception {
         server.start();
         return this;

Modified: 
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServerFactory.java
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServerFactory.java?rev=1719302&r1=1719301&r2=1719302&view=diff
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServerFactory.java
 (original)
+++ 
james/project/trunk/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServerFactory.java
 Fri Dec 11 10:04:51 2015
@@ -21,6 +21,7 @@ package org.apache.james.http.jetty;
 import java.util.List;
 import java.util.stream.Collectors;
 
+import javax.servlet.Filter;
 import javax.servlet.Servlet;
 
 import org.apache.commons.configuration.HierarchicalConfiguration;
@@ -55,6 +56,11 @@ public class JettyHttpServerFactory {
             Class<? extends Servlet> servletClass = findServlet(classname);
             builder.serve(mapping.getString("path")).with(servletClass);
         }
+        for (HierarchicalConfiguration mapping: 
serverConfig.configurationsAt("filters.mapping")) {
+            String classname = mapping.getString("filter");
+            Class<? extends Filter> filterClass = findFilter(classname);
+            builder.filter(mapping.getString("path")).with(filterClass);
+        }
         return builder.build();
     }
 
@@ -66,4 +72,13 @@ public class JettyHttpServerFactory {
             throw new ConfigurationException(String.format("'%s' servlet 
cannot be found", classname), e);
         }
     }
+    
+    @SuppressWarnings("unchecked")
+    private Class<? extends Filter> findFilter(String classname) {
+        try {
+            return (Class<? extends Filter>) 
ClassLoader.getSystemClassLoader().loadClass(classname);
+        } catch (ClassNotFoundException e) {
+            throw new ConfigurationException(String.format("'%s' filter cannot 
be found", classname), e);
+        }
+    }
 }

Modified: 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/ConfigurationTest.java
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/ConfigurationTest.java?rev=1719302&r1=1719301&r2=1719302&view=diff
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/ConfigurationTest.java
 (original)
+++ 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/ConfigurationTest.java
 Fri Dec 11 10:04:51 2015
@@ -21,6 +21,7 @@ package org.apache.james.http.jetty;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
+import javax.servlet.Filter;
 import javax.servlet.Servlet;
 
 import org.junit.Test;
@@ -37,6 +38,7 @@ public class ConfigurationTest {
     @Test
     public void shouldAllowWorkingDefinition() {
         Bad400 bad400 = new Bad400();
+        SpyFilter spyFilter = new SpyFilter();
         Configuration testee = Configuration
                 .builder()
                 .port(2000)
@@ -44,12 +46,20 @@ public class ConfigurationTest {
                 .with(Ok200.class)
                 .serve("/def")
                 .with(bad400)
+                .filter("/123")
+                .with(CoolFilter.class)
+                .filter("/456")
+                .with(spyFilter)
                 .build();
         assertThat(testee.getPort()).isPresent().contains(2000);
         assertThat(testee.getMappings())
             .hasSize(2)
             .containsEntry("/abc", Ok200.class)
             .containsEntry("/def", bad400);
+        assertThat(testee.getFilters())
+            .hasSize(2)
+            .containsEntry("/123", CoolFilter.class)
+            .containsEntry("/456", spyFilter);
     }
 
     @Test
@@ -81,18 +91,18 @@ public class ConfigurationTest {
     }
     
     @Test
-    public void shouldNotAllowNullMappingUrl() {
+    public void shouldNotAllowNullServletMappingUrl() {
         assertThatThrownBy(() -> 
Configuration.builder().serve(null)).isInstanceOf(NullPointerException.class);
     }
 
     @Test
-    public void shouldNotAllowEmptyMappingUrl() {
+    public void shouldNotAllowEmptyServletMappingUrl() {
         assertThatThrownBy(() -> 
Configuration.builder().serve("")).isInstanceOf(IllegalArgumentException.class);
     }
 
 
     @Test
-    public void shouldNotAllowWhitespaceOnlyMappingUrl() {
+    public void shouldNotAllowWhitespaceOnlyServletMappingUrl() {
         assertThatThrownBy(() -> Configuration.builder().serve("    
")).isInstanceOf(IllegalArgumentException.class);
     }
     
@@ -106,4 +116,32 @@ public class ConfigurationTest {
     public void shouldNotAllowNullServletClassname() {
         assertThatThrownBy(() -> 
Configuration.builder().serve("/").with((Class<? extends 
Servlet>)null)).isInstanceOf(NullPointerException.class);
     }
+    
+
+    @Test
+    public void shouldNotAllowNullFilterMappingUrl() {
+        assertThatThrownBy(() -> 
Configuration.builder().filter(null)).isInstanceOf(NullPointerException.class);
+    }
+
+    @Test
+    public void shouldNotAllowEmptyFilterMappingUrl() {
+        assertThatThrownBy(() -> 
Configuration.builder().filter("")).isInstanceOf(IllegalArgumentException.class);
+    }
+
+
+    @Test
+    public void shouldNotAllowWhitespaceOnlyFilterMappingUrl() {
+        assertThatThrownBy(() -> Configuration.builder().filter("    
")).isInstanceOf(IllegalArgumentException.class);
+    }
+    
+
+    @Test
+    public void shouldNotAllowNullFilter() {
+        assertThatThrownBy(() -> 
Configuration.builder().filter("/").with((Filter)null)).isInstanceOf(NullPointerException.class);
+    }
+    
+    @Test
+    public void shouldNotAllowNullFilterClassname() {
+        assertThatThrownBy(() -> 
Configuration.builder().filter("/").with((Class<? extends 
Filter>)null)).isInstanceOf(NullPointerException.class);
+    }
 }

Added: 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/CoolFilter.java
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/CoolFilter.java?rev=1719302&view=auto
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/CoolFilter.java
 (added)
+++ 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/CoolFilter.java
 Fri Dec 11 10:04:51 2015
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.http.jetty;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class CoolFilter implements Filter {
+
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+    }
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response,
+            FilterChain chain) throws IOException, ServletException {
+        chain.doFilter(request, response);
+    }
+
+    @Override
+    public void destroy() {
+    }
+}

Modified: 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerFactoryTest.java
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerFactoryTest.java?rev=1719302&r1=1719301&r2=1719302&view=diff
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerFactoryTest.java
 (original)
+++ 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerFactoryTest.java
 Fri Dec 11 10:04:51 2015
@@ -56,6 +56,8 @@ public class JettyHttpServerFactoryTest
                         .randomPort()
                         .serve("/foo")
                         .with(Ok200.class)
+                        .filter("/*")
+                        .with(SpyFilter.class)
                     .build());
     }
 
@@ -86,5 +88,16 @@ public class JettyHttpServerFactoryTest
             .containsOnly(ImmutableMap.of());
     }
 
+    @Test
+    public void shouldThrowOnEmptyFilterName() throws Exception {
+        HierarchicalConfiguration configuration = 
loadConfiguration(ClassLoader.getSystemResourceAsStream("emptyfiltername.xml"));
+        assertThatThrownBy(() -> new 
JettyHttpServerFactory().createServers(configuration)).isInstanceOf(ConfigurationException.class);
+    }
+
+    @Test
+    public void shouldThrowOnUnavailableFilterName() throws Exception {
+        HierarchicalConfiguration configuration = 
loadConfiguration(ClassLoader.getSystemResourceAsStream("unavailablefiltername.xml"));
+        assertThatThrownBy(() -> new 
JettyHttpServerFactory().createServers(configuration)).isInstanceOf(ConfigurationException.class);
+    }
     
 }

Modified: 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerTest.java
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerTest.java?rev=1719302&r1=1719301&r2=1719302&view=diff
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerTest.java
 (original)
+++ 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/JettyHttpServerTest.java
 Fri Dec 11 10:04:51 2015
@@ -25,7 +25,12 @@ import static org.assertj.core.api.Asser
 import java.io.IOException;
 import java.util.Random;
 
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
 import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -55,6 +60,25 @@ public class JettyHttpServerTest {
         };
     }
     
+    public static class OverrideFilter implements Filter {
+
+        @Override
+        public void init(FilterConfig filterConfig) throws ServletException {
+        }
+
+        @Override
+        public void doFilter(ServletRequest request, ServletResponse response,
+                FilterChain chain) throws IOException, ServletException {
+            response.getWriter().print("overriden by filter");
+            response.flushBuffer();
+        }
+
+        @Override
+        public void destroy() {
+        }
+        
+    }
+    
     private JettyHttpServer testee;
     private Configuration.Builder configurationBuilder;
     
@@ -162,4 +186,47 @@ public class JettyHttpServerTest {
                 .body(Matchers.equalTo("Ok"));
     }
     
+    @Test
+    public void shouldCallFilterWhenConfiguredByClass() throws Exception {
+        testee = JettyHttpServer.create(configurationBuilder
+                .serve("/foo")
+                .with(Ok200.class)
+                .filter("/foo")
+                .with(OverrideFilter.class)
+                .build())
+        .start();
+        
+        RestAssured.port = testee.getPort();
+        
+        when()
+            .get("/foo")
+        .then()
+            .assertThat()
+                .statusCode(200)
+                .body(Matchers.equalTo("overriden by filter"));
+    }
+    
+    @Test
+    public void 
shouldLetConfiguredServletHandleIncomingRequestAfterFilterHandling() throws 
Exception {
+        
+        SpyFilter spyFilter = new SpyFilter();
+        testee = JettyHttpServer.create(configurationBuilder
+                                        .serve("/foo")
+                                        .with(Ok200.class)
+                                        .filter("/foo")
+                                        .with(spyFilter)
+                                        .build())
+                                .start();
+        
+        RestAssured.port = testee.getPort();
+        
+        when()
+            .get("/foo")
+        .then()
+            .assertThat()
+                .statusCode(200)
+                .body(Matchers.equalTo("Ok"));
+        assertThat(spyFilter.filtered).isTrue();
+    }
+    
 }

Added: 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/SpyFilter.java
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/SpyFilter.java?rev=1719302&view=auto
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/SpyFilter.java
 (added)
+++ 
james/project/trunk/server/container/jetty/src/test/java/org/apache/james/http/jetty/SpyFilter.java
 Fri Dec 11 10:04:51 2015
@@ -0,0 +1,49 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.http.jetty;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class SpyFilter implements Filter {
+
+    boolean filtered = false;
+    
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+    }
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response,
+            FilterChain chain) throws IOException, ServletException {
+        filtered = true;
+        chain.doFilter(request, response);
+    }
+
+    @Override
+    public void destroy() {
+    }
+
+}

Added: 
james/project/trunk/server/container/jetty/src/test/resources/emptyfiltername.xml
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/test/resources/emptyfiltername.xml?rev=1719302&view=auto
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/test/resources/emptyfiltername.xml
 (added)
+++ 
james/project/trunk/server/container/jetty/src/test/resources/emptyfiltername.xml
 Fri Dec 11 10:04:51 2015
@@ -0,0 +1,11 @@
+<httpservers>
+    <httpserver>
+        <port fixed="5000"/>
+        <filters>
+            <mapping>
+                <path>/foo</path>
+                <filter></filter>
+            </mapping>
+        </filters>
+    </httpserver>
+</httpservers>
\ No newline at end of file

Modified: 
james/project/trunk/server/container/jetty/src/test/resources/httpserver.xml
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/test/resources/httpserver.xml?rev=1719302&r1=1719301&r2=1719302&view=diff
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/test/resources/httpserver.xml 
(original)
+++ 
james/project/trunk/server/container/jetty/src/test/resources/httpserver.xml 
Fri Dec 11 10:04:51 2015
@@ -20,5 +20,11 @@
                 <servlet>org.apache.james.http.jetty.Ok200</servlet>
             </mapping>
         </mappings>
+        <filters>
+            <mapping>
+                <path>/*</path>
+                <filter>org.apache.james.http.jetty.SpyFilter</filter>
+            </mapping>
+        </filters>
     </httpserver>
 </httpservers>
\ No newline at end of file

Added: 
james/project/trunk/server/container/jetty/src/test/resources/unavailablefiltername.xml
URL: 
http://svn.apache.org/viewvc/james/project/trunk/server/container/jetty/src/test/resources/unavailablefiltername.xml?rev=1719302&view=auto
==============================================================================
--- 
james/project/trunk/server/container/jetty/src/test/resources/unavailablefiltername.xml
 (added)
+++ 
james/project/trunk/server/container/jetty/src/test/resources/unavailablefiltername.xml
 Fri Dec 11 10:04:51 2015
@@ -0,0 +1,11 @@
+<httpservers>
+    <httpserver>
+        <port fixed="5000"/>
+        <filters>
+            <mapping>
+                <path>/foo</path>
+                <filter>com.google.is.not.Evil</filter>
+            </mapping>
+        </filters>
+    </httpserver>
+</httpservers>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to