You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wink.apache.org by bl...@apache.org on 2009/09/05 18:30:19 UTC

svn commit: r811671 - in /incubator/wink/trunk/wink-itests/wink-itest: ./ wink-itest-filter/ wink-itest-filter/src/ wink-itest-filter/src/main/ wink-itest-filter/src/main/java/ wink-itest-filter/src/main/java/org/ wink-itest-filter/src/main/java/org/ap...

Author: bluk
Date: Sat Sep  5 16:30:17 2009
New Revision: 811671

URL: http://svn.apache.org/viewvc?rev=811671&view=rev
Log:
Add specific RestFilter integration test

See [WINK-155]

Added:
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/pom.xml   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/Person.java   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/RootApplication.java   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/BookResource.java   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/PersonResource.java   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/SpecificURLPatternApplication.java   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/geronimo-web.xml   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.filter.xml   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.servlet.xml   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testing/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testing/index.jsp
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testpage.jsp
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/FilterPassThroughTest.java   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/root/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/root/PersonAppTest.java   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/specificurl/
    incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/specificurl/FilterSpecificURLPatternTest.java   (with props)
Modified:
    incubator/wink/trunk/wink-itests/wink-itest/pom.xml

Modified: incubator/wink/trunk/wink-itests/wink-itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/pom.xml?rev=811671&r1=811670&r2=811671&view=diff
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/pom.xml (original)
+++ incubator/wink/trunk/wink-itests/wink-itest/pom.xml Sat Sep  5 16:30:17 2009
@@ -36,6 +36,7 @@
         <module>wink-itest-targeting</module>
         <module>wink-itest-validation</module>
         <module>wink-itest-extra-providers</module>
+        <module>wink-itest-filter</module>
     </modules>
 
     <properties>

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/pom.xml?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/pom.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/pom.xml Sat Sep  5 16:30:17 2009
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <artifactId>wink-itest</artifactId>
+        <groupId>org.apache.wink</groupId>
+        <version>0.2-incubating-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>wink-itest-filter</artifactId>
+    <packaging>war</packaging>
+    <name>Apache Wink Integration Filter Tests</name>
+</project>
\ No newline at end of file

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/Person.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/Person.java?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/Person.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/Person.java Sat Sep  5 16:30:17 2009
@@ -0,0 +1,73 @@
+/*
+ * 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.wink.test.filter.root;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.Encoded;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+@Path("/person/{personID}")
+@Consumes(MediaType.TEXT_PLAIN)
+@Produces(MediaType.TEXT_PLAIN)
+@Encoded
+public class Person {
+
+    @QueryParam("p")
+    @DefaultValue("defaultQuery")
+    private String queryParam;
+
+    @POST
+    @DefaultValue("defaultMatrix")
+    public String postPerson(String entity,
+                             @PathParam("personID") String personID,
+                             @MatrixParam("m") String matrixParam) {
+        return "Person: " + personID
+            + " query parameter: "
+            + queryParam
+            + " matrix parameter: "
+            + matrixParam
+            + " entity: "
+            + entity;
+    }
+
+    @POST
+    @Consumes(MediaType.TEXT_XML)
+    @Produces(MediaType.TEXT_XML)
+    @DefaultValue("defaultMatrix")
+    public String postPersonInXML(String entity,
+                                  @PathParam("personID") String personID,
+                                  @MatrixParam("m") String matrixParam) {
+        return "Person: " + personID
+            + " query parameter: "
+            + queryParam
+            + " matrix parameter: "
+            + matrixParam
+            + " entity: "
+            + entity;
+    }
+
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/Person.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/RootApplication.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/RootApplication.java?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/RootApplication.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/RootApplication.java Sat Sep  5 16:30:17 2009
@@ -0,0 +1,36 @@
+/*
+ * 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.wink.test.filter.root;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ws.rs.core.Application;
+
+public class RootApplication extends Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        Set<Class<?>> classes = new HashSet<Class<?>>();
+        classes.add(Person.class);
+        return classes;
+    }
+
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/root/RootApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/BookResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/BookResource.java?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/BookResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/BookResource.java Sat Sep  5 16:30:17 2009
@@ -0,0 +1,32 @@
+/*
+ * 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.wink.test.filter.specificurl;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/book/{bookID}")
+public class BookResource {
+
+    @GET
+    public String getBook() {
+        return "book resource hit";
+    }
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/BookResource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/PersonResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/PersonResource.java?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/PersonResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/PersonResource.java Sat Sep  5 16:30:17 2009
@@ -0,0 +1,61 @@
+/*
+ * 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.wink.test.filter.specificurl;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.Encoded;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+@Path("/person/{personID}")
+@Consumes(MediaType.TEXT_PLAIN)
+@Produces(MediaType.TEXT_PLAIN)
+@Encoded
+public class PersonResource {
+
+    @QueryParam("p")
+    @DefaultValue("defaultQuery")
+    private String queryParam;
+
+    @POST
+    @DefaultValue("defaultMatrix")
+    public String postPerson(String entity,
+                             @PathParam("personID") String personID,
+                             @MatrixParam("m") String matrixParam) {
+        return "Should not see me";
+    }
+
+    @POST
+    @Consumes(MediaType.TEXT_XML)
+    @Produces(MediaType.TEXT_XML)
+    @DefaultValue("defaultMatrix")
+    public String postPersonInXML(String entity,
+                                  @PathParam("personID") String personID,
+                                  @MatrixParam("m") String matrixParam) {
+        return "Should not see me";
+    }
+
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/PersonResource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/SpecificURLPatternApplication.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/SpecificURLPatternApplication.java?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/SpecificURLPatternApplication.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/SpecificURLPatternApplication.java Sat Sep  5 16:30:17 2009
@@ -0,0 +1,37 @@
+/*
+ * 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.wink.test.filter.specificurl;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ws.rs.core.Application;
+
+public class SpecificURLPatternApplication extends Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        Set<Class<?>> classes = new HashSet<Class<?>>();
+        classes.add(BookResource.class);
+        classes.add(PersonResource.class);
+        return classes;
+    }
+
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/java/org/apache/wink/test/filter/specificurl/SpecificURLPatternApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/geronimo-web.xml?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/geronimo-web.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/geronimo-web.xml Sat Sep  5 16:30:17 2009
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1" 
+         xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2" 
+         xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> 
+ 
+    <sys:environment> 
+        <sys:moduleId> 
+            <sys:groupId>${groupId}</sys:groupId> 
+            <sys:artifactId>${artifactId}</sys:artifactId> 
+            <sys:version>${version}</sys:version> 
+            <sys:type>war</sys:type> 
+        </sys:moduleId> 
+    </sys:environment>  
+ 
+    <context-root>${artifactId}</context-root> 
+</web-app> 

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.filter.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.filter.xml?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.filter.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.filter.xml Sat Sep  5 16:30:17 2009
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+    <display-name>Archetype Created Web Application</display-name>
+    <filter>
+        <filter-name>PersonApp</filter-name>
+        <filter-class>${wink.rest.filter}</filter-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.test.filter.root.RootApplication</param-value>
+        </init-param>
+    </filter>
+    <filter>
+        <filter-name>BookApp</filter-name>
+        <filter-class>${wink.rest.filter}</filter-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.test.filter.specificurl.SpecificURLPatternApplication</param-value>
+        </init-param>
+        <init-param>
+            <param-name>requestProcessorAttribute</param-name>
+            <param-value>requestProcessorAttribute_bookApp</param-value>
+        </init-param>
+    </filter>
+    <filter-mapping>
+        <filter-name>BookApp</filter-name>
+        <url-pattern>/book/*</url-pattern>
+    </filter-mapping>
+    <filter-mapping>
+        <filter-name>PersonApp</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+</web-app>

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.filter.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.servlet.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.servlet.xml?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.servlet.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.servlet.xml Sat Sep  5 16:30:17 2009
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+    <display-name>Archetype Created Web Application</display-name>
+    <filter>
+        <filter-name>PersonApp</filter-name>
+        <filter-class>${wink.rest.filter}</filter-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.test.filter.root.RootApplication</param-value>
+        </init-param>
+    </filter>
+    <filter>
+        <filter-name>BookApp</filter-name>
+        <filter-class>${wink.rest.filter}</filter-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.test.filter.specificurl.SpecificURLPatternApplication</param-value>
+        </init-param>
+        <init-param>
+            <param-name>requestProcessorAttribute</param-name>
+            <param-value>requestProcessorAttribute_bookApp</param-value>
+        </init-param>
+    </filter>
+    <filter-mapping>
+        <filter-name>BookApp</filter-name>
+        <url-pattern>/book/*</url-pattern>
+    </filter-mapping>
+    <filter-mapping>
+        <filter-name>PersonApp</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+</web-app>

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/WEB-INF/web.servlet.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testing/index.jsp
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testing/index.jsp?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testing/index.jsp (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testing/index.jsp Sat Sep  5 16:30:17 2009
@@ -0,0 +1,19 @@
+<%--
+    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.
+--%>
+<html><body><h2>Hit the testing test page!</h2></body></html>

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testpage.jsp
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testpage.jsp?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testpage.jsp (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/main/webapp/testpage.jsp Sat Sep  5 16:30:17 2009
@@ -0,0 +1,19 @@
+<%--
+    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.
+--%>
+<html><body><h2>Hit the test page!</h2></body></html>

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/FilterPassThroughTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/FilterPassThroughTest.java?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/FilterPassThroughTest.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/FilterPassThroughTest.java Sat Sep  5 16:30:17 2009
@@ -0,0 +1,71 @@
+/*
+ * 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.wink.test.filter;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+/**
+ * Tests that requests not filtered through the RestFilter pass through so that
+ * JSPs can be used.
+ */
+public class FilterPassThroughTest extends TestCase {
+
+    public String getBaseURI() {
+        return ServerEnvironmentInfo.getBaseURI();
+    }
+
+    private HttpClient client;
+
+    public void setUp() {
+        client = new HttpClient();
+    }
+
+    public void testGetJSPPage() throws HttpException, IOException {
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/testpage.jsp");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertTrue(getMethod.getResponseBodyAsString(), getMethod.getResponseBodyAsString()
+                .contains("<html><body><h2>Hit the test page!</h2></body></html>"));
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    public void testGetSubdirectoryJSPPage() throws HttpException, IOException {
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/testing/index.jsp");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertTrue(getMethod.getResponseBodyAsString(), getMethod.getResponseBodyAsString()
+                .contains("<html><body><h2>Hit the testing test page!</h2></body></html>"));
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/FilterPassThroughTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/root/PersonAppTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/root/PersonAppTest.java?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/root/PersonAppTest.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/root/PersonAppTest.java Sat Sep  5 16:30:17 2009
@@ -0,0 +1,81 @@
+/*
+ * 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.wink.test.filter.root;
+
+import java.io.IOException;
+
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+/**
+ * Tests that the RestFilter will pick up on requests.
+ */
+public class PersonAppTest extends TestCase {
+
+    public String getBaseURI() {
+        return ServerEnvironmentInfo.getBaseURI();
+    }
+
+    private HttpClient client;
+
+    public void setUp() {
+        client = new HttpClient();
+    }
+
+    public void testPostPerson() throws HttpException, IOException {
+        PostMethod postMethod = new PostMethod(getBaseURI() + "/person/abcd");
+        postMethod
+            .setRequestEntity(new StringRequestEntity("Hello", MediaType.TEXT_PLAIN, "UTF-8"));
+        try {
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals(MediaType.TEXT_PLAIN, postMethod
+                .getResponseHeader(HttpHeaders.CONTENT_TYPE).getValue());
+            assertEquals("Person: abcd query parameter: defaultQuery matrix parameter: defaultMatrix entity: Hello",
+                         postMethod.getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+    }
+
+    public void testPostPersonInXML() throws HttpException, IOException {
+        PostMethod postMethod = new PostMethod(getBaseURI() + "/person/abcd");
+        postMethod.setRequestEntity(new StringRequestEntity("Hello", MediaType.TEXT_XML, "UTF-8"));
+        try {
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals(MediaType.TEXT_XML, postMethod.getResponseHeader(HttpHeaders.CONTENT_TYPE)
+                .getValue());
+            assertEquals("Person: abcd query parameter: defaultQuery matrix parameter: defaultMatrix entity: Hello",
+                         postMethod.getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+    }
+
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/root/PersonAppTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/specificurl/FilterSpecificURLPatternTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/specificurl/FilterSpecificURLPatternTest.java?rev=811671&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/specificurl/FilterSpecificURLPatternTest.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/specificurl/FilterSpecificURLPatternTest.java Sat Sep  5 16:30:17 2009
@@ -0,0 +1,58 @@
+/*
+ * 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.wink.test.filter.specificurl;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+/**
+ * Tests that a specific URL pattern given will match only those requests.
+ */
+public class FilterSpecificURLPatternTest extends TestCase {
+
+    public String getBaseURI() {
+        return ServerEnvironmentInfo.getBaseURI();
+    }
+
+    private HttpClient client;
+
+    public void setUp() {
+        client = new HttpClient();
+    }
+
+    public void testGetBook() throws HttpException, IOException {
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/book/book1");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertTrue(getMethod.getResponseBodyAsString(), getMethod.getResponseBodyAsString()
+                .contains("book resource hit"));
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-filter/src/test/java/org/apache/wink/test/filter/specificurl/FilterSpecificURLPatternTest.java
------------------------------------------------------------------------------
    svn:eol-style = native