wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r801869 [20/21] - in /incubator/wink/trunk: wink-integration-test/ wink-integration-test/wink-server-integration-test-support/ wink-integration-test/wink-server-integration-test-support/src/main/java/org/apache/wink/test/integration/ wink-i...
Date Fri, 07 Aug 2009 03:10:46 GMT
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-targeting/src/test/java/org/apache/wink/itest/version/VersioningTests.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-targeting/src/test/java/org/apache/wink/itest/version/VersioningTests.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-targeting/src/test/java/org/apache/wink/itest/version/VersioningTests.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-targeting/src/test/java/org/apache/wink/itest/version/VersioningTests.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,164 @@
+/*
+ * 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.itest.version;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.URI;
+import org.apache.commons.httpclient.URIException;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+/**
+ * Demonstrates different versioning techniques
+ */
+public class VersioningTests extends TestCase {
+
+    protected HttpClient httpclient = new HttpClient();
+
+    public static String getBaseURI() {
+        return ServerEnvironmentInfo.getBaseURI() + "/version";
+    }
+
+    final private static String BASE_URI = getBaseURI() + "/taxform";
+
+    public void testVersionByAccept() {
+        try {
+            GetMethod httpMethod = new GetMethod();
+            httpMethod.setURI(new URI(BASE_URI, false));
+            httpMethod.setQueryString("form=1040");
+            System.out.println(Arrays.asList(httpMethod.getRequestHeaders()));
+            httpclient = new HttpClient();
+
+            try {
+                httpMethod.setRequestHeader("Accept", "application/taxform+2007");
+                int result = httpclient.executeMethod(httpMethod);
+                System.out.println("Response status code: " + result);
+                System.out.println("Response body: ");
+                String responseBody = httpMethod.getResponseBodyAsString();
+                System.out.println(responseBody);
+                assertTrue("Response does not contain expected 'deductions' element", responseBody
+                    .contains("<deductions>"));
+                assertEquals(200, result);
+
+                httpMethod.setRequestHeader("Accept", "application/taxform+2008");
+                result = httpclient.executeMethod(httpMethod);
+                System.out.println("Response status code: " + result);
+                System.out.println("Response body: ");
+                responseBody = httpMethod.getResponseBodyAsString();
+                System.out.println(responseBody);
+                assertFalse("Response contains unexpected 'deductions' element", responseBody
+                    .contains("<deductions>"));
+                assertEquals(200, result);
+            } catch (IOException ioe) {
+                ioe.printStackTrace();
+                fail(ioe.getMessage());
+            } finally {
+                httpMethod.releaseConnection();
+            }
+        } catch (URIException e) {
+            e.printStackTrace();
+            fail(e.getMessage());
+        }
+    }
+
+    public void testVersionByQueryString() {
+        try {
+            GetMethod httpMethod = new GetMethod();
+            httpMethod.setURI(new URI(BASE_URI + "/1040", false));
+            httpMethod.setQueryString("version=2007");
+            System.out.println(Arrays.asList(httpMethod.getRequestHeaders()));
+            httpclient = new HttpClient();
+
+            try {
+                int result = httpclient.executeMethod(httpMethod);
+                System.out.println("Response status code: " + result);
+                System.out.println("Response body: ");
+                String responseBody = httpMethod.getResponseBodyAsString();
+                System.out.println(responseBody);
+                assertTrue("Response does not contain expected 'deductions' element", responseBody
+                    .contains("<deductions>"));
+                assertEquals(200, result);
+
+                httpMethod.setURI(new URI(BASE_URI + "/1040", false));
+                httpMethod.setQueryString("version=2008");
+                result = httpclient.executeMethod(httpMethod);
+                System.out.println("Response status code: " + result);
+                System.out.println("Response body: ");
+                responseBody = httpMethod.getResponseBodyAsString();
+                System.out.println(responseBody);
+                assertFalse("Response contains unexpected 'deductions' element", responseBody
+                    .contains("<deductions>"));
+                assertEquals(200, result);
+            } catch (IOException ioe) {
+                ioe.printStackTrace();
+                fail(ioe.getMessage());
+            } finally {
+                httpMethod.releaseConnection();
+            }
+        } catch (URIException e) {
+            e.printStackTrace();
+            fail(e.getMessage());
+        }
+    }
+
+    public void testVersionByPath() {
+        try {
+            GetMethod httpMethod = new GetMethod();
+            httpMethod.setURI(new URI(BASE_URI + "/1040/2007", false));
+            System.out.println(Arrays.asList(httpMethod.getRequestHeaders()));
+            httpclient = new HttpClient();
+
+            try {
+                int result = httpclient.executeMethod(httpMethod);
+                System.out.println("Response status code: " + result);
+                System.out.println("Response body: ");
+                String responseBody = httpMethod.getResponseBodyAsString();
+                System.out.println(responseBody);
+                assertTrue("Response does not contain expected 'deductions' element", responseBody
+                    .contains("<deductions>"));
+                assertEquals(200, result);
+
+                httpMethod.setURI(new URI(BASE_URI + "/1040/2008", false));
+                result = httpclient.executeMethod(httpMethod);
+                System.out.println("Response status code: " + result);
+                System.out.println("Response body: ");
+                responseBody = httpMethod.getResponseBodyAsString();
+                System.out.println(responseBody);
+                assertFalse("Response contains unexpected 'deductions' element", responseBody
+                    .contains("<deductions>"));
+                assertEquals(200, result);
+            } catch (IOException ioe) {
+                ioe.printStackTrace();
+                fail(ioe.getMessage());
+            } finally {
+                httpMethod.releaseConnection();
+            }
+        } catch (URIException e) {
+            e.printStackTrace();
+            fail(e.getMessage());
+        }
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/pom.xml?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/pom.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/pom.xml Fri Aug  7 03:10:22 2009
@@ -0,0 +1,30 @@
+<?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>
+    <parent>
+        <artifactId>wink-itest</artifactId>
+        <groupId>org.apache.wink</groupId>
+        <version>0.1-incubating-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>wink-itest-validation</artifactId>
+    <packaging>war</packaging>
+    <name>wink-itest-validation Maven Webapp</name>
+</project>

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/Application.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/Application.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/Application.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,38 @@
+/*
+ * 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.itest.constructors;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class Application extends javax.ws.rs.core.Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        Set<Class<?>> clazzes = new HashSet<Class<?>>();
+        clazzes.add(MultiConstructorResource.class);
+        clazzes.add(MultiConstructorResource2.class);
+        clazzes.add(SameNumParamConstructorResource.class);
+        clazzes.add(SameNumParamConstructorResource2.class);
+        clazzes.add(SubResourcesConstructorResource.class);
+        return clazzes;
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/MultiConstructorResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/MultiConstructorResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/MultiConstructorResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/MultiConstructorResource.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,69 @@
+/*
+ * 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.itest.constructors;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+
+@Path("/constructors/multi")
+public class MultiConstructorResource {
+
+    /*
+     * determines the number of times the constructors have been called in total
+     */
+    private static int   constructorCallCount = 0;
+
+    final private String whichConstructor;
+
+    public MultiConstructorResource() {
+        ++constructorCallCount;
+        whichConstructor = "Default" + constructorCallCount;
+    }
+
+    public MultiConstructorResource(@QueryParam("q") String query) {
+        ++constructorCallCount;
+        whichConstructor = "query" + constructorCallCount;
+    }
+
+    public MultiConstructorResource(@MatrixParam("m") String matrix, @QueryParam("q") String query) {
+        ++constructorCallCount;
+        whichConstructor = "matrixAndQuery" + constructorCallCount;
+    }
+
+    public MultiConstructorResource(@MatrixParam("m") String matrix,
+                                    @QueryParam("q") String query,
+                                    @Context UriInfo uriinfo) {
+        ++constructorCallCount;
+        /*
+         * this should be the called constructor
+         */
+        whichConstructor = "matrixAndQueryAndContext" + constructorCallCount;
+    }
+
+    @GET
+    public String getInfo() {
+        return whichConstructor;
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/MultiConstructorResource2.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/MultiConstructorResource2.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/MultiConstructorResource2.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/MultiConstructorResource2.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,68 @@
+/*
+ * 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.itest.constructors;
+
+import javax.ws.rs.CookieParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+
+@Path("/constructors/multi2/{path}")
+public class MultiConstructorResource2 {
+
+    /**
+     * counts the number of times the constructor has been called
+     */
+    private static int   constructorCallCount = 0;
+
+    final private String whichConstructor;
+
+    public MultiConstructorResource2(@HeaderParam("header1") String header1,
+                                     @CookieParam("cookie1") String cookie1) {
+        ++constructorCallCount;
+        whichConstructor = "headerAndCookieAndPath" + constructorCallCount;
+    }
+
+    public MultiConstructorResource2(@HeaderParam("header1") int header1,
+                                     @PathParam("cookie1") String cookie1) {
+        ++constructorCallCount;
+        whichConstructor = "headerAndCookieAndPath" + constructorCallCount;
+    }
+
+    public MultiConstructorResource2(@Context UriInfo uriInfo,
+                                     @HeaderParam("header1") String header1,
+                                     @CookieParam("cookie1") String cookie1,
+                                     @PathParam("path") String path1) {
+        /*
+         * this should be the called constructor
+         */
+        ++constructorCallCount;
+        whichConstructor = "contextAndHeaderAndCookieAndPath" + constructorCallCount;
+    }
+
+    @GET
+    public String getInfo() {
+        return whichConstructor;
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SameNumParamConstructorResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SameNumParamConstructorResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SameNumParamConstructorResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SameNumParamConstructorResource.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,63 @@
+/*
+ * 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.itest.constructors;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+
+@Path("constructors/samenumparam")
+public class SameNumParamConstructorResource {
+
+    /*
+     * determines the number of times the constructors have been called in total
+     */
+    private static int   constructorCallCount = 0;
+
+    final private String whichConstructor;
+
+    public SameNumParamConstructorResource() {
+        ++constructorCallCount;
+        whichConstructor = "default" + constructorCallCount;
+    }
+
+    public SameNumParamConstructorResource(@Context UriInfo uriInfo) {
+        /*
+         * this constructor may be called
+         */
+        ++constructorCallCount;
+        whichConstructor = "context" + constructorCallCount;
+    }
+
+    public SameNumParamConstructorResource(@QueryParam("q") String q) {
+        /*
+         * this constructor may be called
+         */
+        ++constructorCallCount;
+        whichConstructor = "query" + constructorCallCount;
+    }
+
+    @GET
+    public String getInfo() {
+        return whichConstructor;
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SameNumParamConstructorResource2.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SameNumParamConstructorResource2.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SameNumParamConstructorResource2.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SameNumParamConstructorResource2.java Fri Aug  7 03:10:22 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.itest.constructors;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+
+@Path("constructors/samenumparam2")
+public class SameNumParamConstructorResource2 {
+
+    /*
+     * determines the number of times the constructors have been called in total
+     */
+    private static int   constructorCallCount = 0;
+
+    final private String whichConstructor;
+
+    public SameNumParamConstructorResource2() {
+        ++constructorCallCount;
+        whichConstructor = "default" + constructorCallCount;
+    }
+
+    public SameNumParamConstructorResource2(@QueryParam("q") int q) {
+        /*
+         * this constructor may be called
+         */
+        ++constructorCallCount;
+        whichConstructor = "queryInt" + constructorCallCount;
+    }
+
+    public SameNumParamConstructorResource2(@QueryParam("q") String q) {
+        /*
+         * this constructor may be called
+         */
+        ++constructorCallCount;
+        whichConstructor = "queryString" + constructorCallCount;
+    }
+
+    @GET
+    public String getInfo() {
+        return whichConstructor;
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePackageConstructor.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePackageConstructor.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePackageConstructor.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePackageConstructor.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,46 @@
+/*
+ * 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.itest.constructors;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+public class SubResourcePackageConstructor {
+
+    final private String whichConstructor;
+
+    SubResourcePackageConstructor() {
+        whichConstructor = "package";
+    }
+
+    SubResourcePackageConstructor(String s) {
+        whichConstructor = s;
+    }
+
+    @GET
+    public String getInfo() {
+        return whichConstructor;
+    }
+
+    @Path("/other")
+    public SubResourcePublicConstructor other() {
+        return new SubResourcePublicConstructor();
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePrivateConstructor.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePrivateConstructor.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePrivateConstructor.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePrivateConstructor.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,53 @@
+/*
+ * 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.itest.constructors;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+public class SubResourcePrivateConstructor {
+
+    final private String whichConstructor;
+
+    private SubResourcePrivateConstructor() {
+        whichConstructor = "private";
+    }
+
+    private SubResourcePrivateConstructor(String s) {
+        whichConstructor = s;
+    }
+
+    public static Object getPrivateInstance(String query) {
+        if (query == null) {
+            return new SubResourcePrivateConstructor();
+        }
+        return new SubResourcePrivateConstructor(query);
+    }
+
+    @GET
+    public String info() {
+        return whichConstructor;
+    }
+
+    @Path("other")
+    public SubResourcePackageConstructor other() {
+        return new SubResourcePackageConstructor("subpackage");
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePublicConstructor.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePublicConstructor.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePublicConstructor.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcePublicConstructor.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,47 @@
+/*
+ * 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.itest.constructors;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+public class SubResourcePublicConstructor {
+
+    final private String whichConstructor;
+
+    public SubResourcePublicConstructor() {
+        whichConstructor = "public";
+    }
+
+    public SubResourcePublicConstructor(String s) {
+        whichConstructor = s;
+    }
+
+    @GET
+    public String info() {
+        return whichConstructor;
+    }
+
+    @Path("other")
+    public SubResourcePackageConstructor other() {
+        return new SubResourcePackageConstructor("subpackage");
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcesConstructorResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcesConstructorResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcesConstructorResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/constructors/SubResourcesConstructorResource.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,68 @@
+/*
+ * 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.itest.constructors;
+
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+
+@Path("constructors/subresource")
+public class SubResourcesConstructorResource {
+
+    @Path("emptypackage")
+    public SubResourcePackageConstructor packageEmptyConstructor() {
+        return new SubResourcePackageConstructor();
+    }
+
+    @Path("stringpackage")
+    public SubResourcePackageConstructor packageStringConstructor() {
+        return new SubResourcePackageConstructor("packageString");
+    }
+
+    @Path("emptypublic")
+    public SubResourcePublicConstructor publicEmptyConstructor() {
+        return new SubResourcePublicConstructor();
+    }
+
+    @Path("stringpublic")
+    public SubResourcePublicConstructor publicStringConstructor(@QueryParam("q") String s) {
+        return new SubResourcePublicConstructor(s);
+    }
+
+    @Path("emptyprivate")
+    public Object privateEmptyConstructor() {
+        return SubResourcePrivateConstructor.getPrivateInstance(null);
+    }
+
+    @Path("stringprivate")
+    public Object privateStringConstructor(@QueryParam("q") String s) {
+        return SubResourcePrivateConstructor.getPrivateInstance(s);
+    }
+
+    @Path("sub")
+    public Object subconstructor(@QueryParam("which") String which) {
+        if ("package".equals(which)) {
+            return new SubResourcePackageConstructor();
+        } else if ("public".equals(which)) {
+            return new SubResourcePublicConstructor();
+        }
+        return null;
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/entity/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/entity/Application.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/entity/Application.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/entity/Application.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,41 @@
+/*
+ * 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.itest.param.entity;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class Application extends javax.ws.rs.core.Application {
+
+    Set<Class<?>> classes = new HashSet<Class<?>>();
+
+    public Application() {
+        classes = new HashSet<Class<?>>();
+        classes.add(MultipleEntityParamsResource.class);
+        classes = Collections.unmodifiableSet(classes);
+    }
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        return classes;
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/entity/MultipleEntityParamsResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/entity/MultipleEntityParamsResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/entity/MultipleEntityParamsResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/entity/MultipleEntityParamsResource.java Fri Aug  7 03:10:22 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.itest.param.entity;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/params/multientity")
+public class MultipleEntityParamsResource {
+
+    @GET
+    public void getMultipleEntity(String s1, String s2) {
+        return;
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formfield/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formfield/Application.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formfield/Application.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formfield/Application.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.itest.param.formfield;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class Application extends javax.ws.rs.core.Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        Set<Class<?>> clazzes = new HashSet<Class<?>>();
+        clazzes.add(FormFieldValidationResource.class);
+        return clazzes;
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formfield/FormFieldValidationResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formfield/FormFieldValidationResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formfield/FormFieldValidationResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formfield/FormFieldValidationResource.java Fri Aug  7 03:10:22 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.itest.param.formfield;
+
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+@Path("params/form/validate/fieldnotmultivaluedmapparam")
+public class FormFieldValidationResource {
+
+    @FormParam("p1")
+    private String p1 = null;
+
+    @POST
+    public String getSomething(String something) {
+        return p1 + ":" + something;
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formparam/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formparam/Application.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formparam/Application.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formparam/Application.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.itest.param.formparam;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class Application extends javax.ws.rs.core.Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        Set<Class<?>> clazzes = new HashSet<Class<?>>();
+        clazzes.add(FormParameterValidationResource.class);
+        return clazzes;
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formparam/FormParameterValidationResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formparam/FormParameterValidationResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formparam/FormParameterValidationResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formparam/FormParameterValidationResource.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,33 @@
+/*
+ * 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.itest.param.formparam;
+
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+@Path("params/form/validate/paramnotmultivaluedmaparam")
+public class FormParameterValidationResource {
+
+    @POST
+    public String getSomething(@FormParam("firstkey") String p1, String p2) {
+        return p1 + ":" + p2;
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formproperty/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formproperty/Application.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formproperty/Application.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formproperty/Application.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.itest.param.formproperty;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class Application extends javax.ws.rs.core.Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        Set<Class<?>> clazzes = new HashSet<Class<?>>();
+        clazzes.add(FormPropertyValidationResource.class);
+        return clazzes;
+    }
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formproperty/FormPropertyValidationResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formproperty/FormPropertyValidationResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formproperty/FormPropertyValidationResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/param/formproperty/FormPropertyValidationResource.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,40 @@
+/*
+ * 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.itest.param.formproperty;
+
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+@Path("params/form/validate/propertynotmultivaluedmaparam")
+public class FormPropertyValidationResource {
+
+    private String p1;
+
+    @POST
+    public String doSomething(String something) {
+        return p1 + ":" + something;
+    }
+
+    @FormParam(value = "P1")
+    public void setP1(String p1) {
+        this.p1 = p1;
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/Application.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/Application.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/Application.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,44 @@
+/*
+ * 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.itest.pathmethods;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Path annotation test application.
+ */
+public class Application extends javax.ws.rs.core.Application {
+
+    Set<Class<?>> classes = new HashSet<Class<?>>();
+
+    public Application() {
+        classes = new HashSet<Class<?>>();
+        classes.add(PathResource.class);
+        classes.add(PathWarningResource.class);
+        classes = Collections.unmodifiableSet(classes);
+    }
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        return classes;
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/PathResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/PathResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/PathResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/PathResource.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,27 @@
+/*
+ * 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.itest.pathmethods;
+
+import javax.ws.rs.Path;
+
+@Path("/path")
+public class PathResource {
+
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/PathWarningResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/PathWarningResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/PathWarningResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/java/org/apache/wink/itest/pathmethods/PathWarningResource.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,46 @@
+/*
+ * 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.itest.pathmethods;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/pathwarnings")
+public class PathWarningResource {
+
+    @SuppressWarnings("unused")
+    @GET
+    @Path("/private")
+    private String getPrivateMethod() {
+        return "You shouldn't find me.";
+    }
+
+    @GET
+    @Path("/protected")
+    protected String getProtectedMethod() {
+        return "You shouldn't find me.";
+    }
+
+    @GET
+    @Path("/package")
+    String getPackageMethod() {
+        return "You shouldn't find me.";
+    }
+}

Copied: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/WEB-INF/geronimo-web.xml (from r801788, incubator/wink/trunk/wink-integration-test/wink-server-integration-test/wink-jaxrs-test-validation/src/main/webapp/WEB-INF/geronimo-web.xml)
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/WEB-INF/geronimo-web.xml?p2=incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/WEB-INF/geronimo-web.xml&p1=incubator/wink/trunk/wink-integration-test/wink-server-integration-test/wink-jaxrs-test-validation/src/main/webapp/WEB-INF/geronimo-web.xml&r1=801788&r2=801869&rev=801869&view=diff
==============================================================================
    (empty)

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/WEB-INF/web.xml?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/WEB-INF/web.xml Fri Aug  7 03:10:22 2009
@@ -0,0 +1,128 @@
+<?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>
+    <servlet>
+        <servlet-name>ConstructorValidation</servlet-name>
+        <servlet-class>${wink.rest.servlet}</servlet-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.itest.constructors.Application</param-value>
+        </init-param>
+        <init-param>
+            <param-name>requestProcessorAttribute</param-name>
+            <param-value>requestProcessorAttribute_constructors</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+        <servlet-name>ParamEntity</servlet-name>
+        <servlet-class>${wink.rest.servlet}</servlet-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.itest.param.entity.Application</param-value>
+        </init-param>
+        <init-param>
+            <param-name>requestProcessorAttribute</param-name>
+            <param-value>requestProcessorAttribute_paramentity</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+        <servlet-name>FormFieldValidation</servlet-name>
+        <servlet-class>${wink.rest.servlet}</servlet-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.itest.param.formfield.Application</param-value>
+        </init-param>
+        <init-param>
+            <param-name>requestProcessorAttribute</param-name>
+            <param-value>requestProcessorAttribute_paramformfield</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+        <servlet-name>FormParamValidation</servlet-name>
+        <servlet-class>${wink.rest.servlet}</servlet-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.itest.param.formparam.Application</param-value>
+        </init-param>
+        <init-param>
+            <param-name>requestProcessorAttribute</param-name>
+            <param-value>requestProcessorAttribute_paramformparam</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+        <servlet-name>FormPropertyValidation</servlet-name>
+        <servlet-class>${wink.rest.servlet}</servlet-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.itest.param.formproperty.Application</param-value>
+        </init-param>
+        <init-param>
+            <param-name>requestProcessorAttribute</param-name>
+            <param-value>requestProcessorAttribute_paramformproperty</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+        <servlet-name>PathMethodValidation</servlet-name>
+        <servlet-class>${wink.rest.servlet}</servlet-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.itest.pathmethods.Application</param-value>
+        </init-param>
+        <init-param>
+            <param-name>requestProcessorAttribute</param-name>
+            <param-value>requestProcessorAttribute_pathmethods</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>ConstructorValidation</servlet-name>
+        <url-pattern>/constructors/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>ParamEntity</servlet-name>
+        <url-pattern>/param/entity/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>FormFieldValidation</servlet-name>
+        <url-pattern>/param/formfield/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>FormParamValidation</servlet-name>
+        <url-pattern>/param/formparam/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>FormPropertyValidation</servlet-name>
+        <url-pattern>/param/formproperty/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PathMethodValidation</servlet-name>
+        <url-pattern>/pathmethod/*</url-pattern>
+    </servlet-mapping>
+</web-app>

Copied: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/index.jsp (from r801788, incubator/wink/trunk/wink-integration-test/wink-server-integration-test/wink-jaxrs-test-validation/src/main/webapp/index.jsp)
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/index.jsp?p2=incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/main/webapp/index.jsp&p1=incubator/wink/trunk/wink-integration-test/wink-server-integration-test/wink-jaxrs-test-validation/src/main/webapp/index.jsp&r1=801788&r2=801869&rev=801869&view=diff
==============================================================================
    (empty)

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/constructors/ConstructorTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/constructors/ConstructorTest.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/constructors/ConstructorTest.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/constructors/ConstructorTest.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,327 @@
+/*
+ * 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.itest.constructors;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+/**
+ * Tests the runtime for the specification regarding Constructors.
+ */
+public class ConstructorTest extends TestCase {
+
+    private static String getBaseURI() {
+        return ServerEnvironmentInfo.getBaseURI() + "/constructors/";
+    }
+
+    /**
+     * Tests that the runtime will use the correct constructor with a resource
+     * that has multiple constructors. The resource has multiple constructors
+     * with different number of parameters in each constructor.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testConstructorWithMostParams() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/constructors/multi");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("matrixAndQueryAndContext1", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the runtime will use the correct constructor with a resource
+     * that has multiple constructors. The resource has multiple constructors
+     * with different number of parameters in each constructor.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testConstructorWithMostParams2() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/constructors/multi2/somepath");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("contextAndHeaderAndCookieAndPath1", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the runtime will randomly choose a constructor between two
+     * constructors with the same number of parameters. A warning should be
+     * issued.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testConstructorWithSameParamWarning() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/constructors/samenumparam");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            String c = getMethod.getResponseBodyAsString();
+            boolean foundConstructor = false;
+            if ("context1".equals(c)) {
+                foundConstructor = true;
+            } else if ("query1".equals(c)) {
+                foundConstructor = true;
+            }
+            assertTrue("Returned message body was: " + c, foundConstructor);
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the runtime will randomly choose a constructor between two
+     * constructors with the same parameters except different types. A warning
+     * should be issued.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testConstructorWithSameParamWarning2() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/constructors/samenumparam2?q=15");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            String c = getMethod.getResponseBodyAsString();
+            boolean foundConstructor = false;
+            if ("queryInt1".equals(c)) {
+                foundConstructor = true;
+            } else if ("queryString1".equals(c)) {
+                foundConstructor = true;
+            }
+            assertTrue("Returned message body was: " + c, foundConstructor);
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the sub-resources can use a package default constructor.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testSubResourceLocatorPackageEmptyConstructor() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod =
+            new GetMethod(getBaseURI() + "/constructors/subresource/emptypackage");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("package", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the sub-resources can use a package constructor with a String
+     * parameter.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testSubResourceLocatorPackageStringConstructor() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod =
+            new GetMethod(getBaseURI() + "/constructors/subresource/stringpackage");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("packageString", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the sub-resources can use a public constructor.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testSubResourceLocatorPublicDefaultConstructor() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/constructors/subresource/emptypublic");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("public", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the sub-resources can use a public constructor with a String
+     * parameter.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testSubResourceLocatorPublicStringConstructor() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod =
+            new GetMethod(getBaseURI() + "/constructors/subresource/stringpublic?q=Hello");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("Hello", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the sub-resources can use a private constructor.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testSubResourceLocatorPrivateDefaultConstructor() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod =
+            new GetMethod(getBaseURI() + "/constructors/subresource/emptyprivate");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("private", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the sub-resources can use a private constructor with a String
+     * parameter.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testSubResourceLocatorPrivateStringConstructor() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod =
+            new GetMethod(getBaseURI() + "/constructors/subresource/stringprivate?q=Hello");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("Hello", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the sub-resources will eventually find the right resource.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testSubResourceOtherSubPublicToPackage() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod =
+            new GetMethod(getBaseURI() + "/constructors/subresource/stringpublic/other");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("subpackage", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the sub-resources will eventually find the right resource.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testSubResourceOtherSubPackageToPublic() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod =
+            new GetMethod(getBaseURI() + "/constructors/subresource/stringpackage/other");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("public", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that the sub-resources will eventually return the right resource.
+     * 
+     * @throws IOException
+     * @throws HTTPException
+     */
+    public void testSubResourceDecideSubDynamic() throws IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod =
+            new GetMethod(getBaseURI() + "/constructors/subresource/sub?which=public");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("public", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+        getMethod = new GetMethod(getBaseURI() + "/constructors/subresource/sub?which=package");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("package", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/entity/EntityValidationTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/entity/EntityValidationTest.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/entity/EntityValidationTest.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/entity/EntityValidationTest.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,56 @@
+/*
+ * 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.itest.param.entity;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+public class EntityValidationTest extends TestCase {
+
+    private static String getBaseURI() {
+        return ServerEnvironmentInfo.getBaseURI() + "/param/entity/";
+    }
+
+    public void testValidationMultipleEntities() throws Exception {
+        HttpClient httpclient = new HttpClient();
+
+        GetMethod httpMethod = new GetMethod(getBaseURI() + "/params/multientity");
+        try {
+            httpclient.executeMethod(httpMethod);
+            assertEquals(404, httpMethod.getStatusCode());
+            // framework.defaults.test.FVTAssert
+            // .assertInstallLogContainsException("ResourceValidationException");
+            // if (Environment.getCurrentEnvironment() ==
+            // Environment.GENERIC_WAS) {
+            // framework.defaults.test.FVTAssert
+            // .assertInstallLogContainsException("Uncaught exception created in one of the service methods "
+            // + "of the servlet jaxrs.tests.validation.param.entity in "
+            // + "application jaxrs.tests.validation.param.entity. "
+            // + "Exception created : javax.servlet.ServletException: An error "
+            // + "occurred validating JAX-RS artifacts in the application.");
+            // }
+        } finally {
+            httpMethod.releaseConnection();
+        }
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formfield/FormFieldValidationTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formfield/FormFieldValidationTest.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formfield/FormFieldValidationTest.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formfield/FormFieldValidationTest.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,60 @@
+/*
+ * 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.itest.param.formfield;
+
+import javax.ws.rs.FormParam;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+public class FormFieldValidationTest extends TestCase {
+
+    private static String getBaseURI() {
+        return ServerEnvironmentInfo.getBaseURI() + "/param/formfield";
+    }
+
+    /**
+     * {@link FormParam} annotated fields are not supported.
+     * 
+     * @throws Exception
+     */
+    public void testFormFieldNoMultivaluedMapEntityValidation() throws Exception {
+        HttpClient httpclient = new HttpClient();
+
+        PostMethod httpMethod =
+            new PostMethod(getBaseURI() + "/params/form/validate/fieldnotmultivaluedmapparam");
+        try {
+            StringRequestEntity s =
+                new StringRequestEntity("firstkey=somevalue&someothervalue=somethingelse",
+                                        "application/x-www-form-urlencoded", null);
+            httpMethod.setRequestEntity(s);
+            httpclient.executeMethod(httpMethod);
+            assertEquals(200, httpMethod.getStatusCode());
+            assertEquals("null:firstkey=somevalue&someothervalue=somethingelse", httpMethod
+                .getResponseBodyAsString());
+        } finally {
+            httpMethod.releaseConnection();
+        }
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formparam/FormParamValidationTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formparam/FormParamValidationTest.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formparam/FormParamValidationTest.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formparam/FormParamValidationTest.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,60 @@
+/*
+ * 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.itest.param.formparam;
+
+import javax.ws.rs.FormParam;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+public class FormParamValidationTest extends TestCase {
+
+    private static String getBaseURI() {
+        return ServerEnvironmentInfo.getBaseURI() + "/param/formparam/";
+    }
+
+    /**
+     * {@link FormParam} annotated parameters with entity parameters are not
+     * supported.
+     * 
+     * @throws Exception
+     */
+    public void testFormPropertyNoMultivaluedMapEntityValidation() throws Exception {
+        HttpClient httpclient = new HttpClient();
+
+        PostMethod httpMethod =
+            new PostMethod(getBaseURI() + "/params/form/validate/paramnotmultivaluedmaparam");
+        try {
+            StringRequestEntity s =
+                new StringRequestEntity("firstkey=somevalue&someothervalue=somethingelse",
+                                        "application/x-www-form-urlencoded", null);
+            httpMethod.setRequestEntity(s);
+            httpclient.executeMethod(httpMethod);
+            assertEquals(200, httpMethod.getStatusCode());
+            assertEquals("somevalue:", httpMethod.getResponseBodyAsString());
+        } finally {
+            httpMethod.releaseConnection();
+        }
+    }
+}

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formproperty/FormPropertyValidationTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formproperty/FormPropertyValidationTest.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formproperty/FormPropertyValidationTest.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-validation/src/test/java/org/apache/wink/itest/param/formproperty/FormPropertyValidationTest.java Fri Aug  7 03:10:22 2009
@@ -0,0 +1,60 @@
+/*
+ * 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.itest.param.formproperty;
+
+import javax.ws.rs.FormParam;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+public class FormPropertyValidationTest extends TestCase {
+
+    private static String getBaseURI() {
+        return ServerEnvironmentInfo.getBaseURI() + "/param/formproperty";
+    }
+
+    /**
+     * {@link FormParam} annotated JavaBean property methods are not supported.
+     * 
+     * @throws Exception
+     */
+    public void testFormPropertyNoMultivaluedMapEntityValidation() throws Exception {
+        HttpClient httpclient = new HttpClient();
+
+        PostMethod httpMethod =
+            new PostMethod(getBaseURI() + "/params/form/validate/propertynotmultivaluedmaparam");
+        try {
+            StringRequestEntity s =
+                new StringRequestEntity("firstkey=somevalue&someothervalue=somethingelse",
+                                        "application/x-www-form-urlencoded", null);
+            httpMethod.setRequestEntity(s);
+            httpclient.executeMethod(httpMethod);
+            assertEquals(200, httpMethod.getStatusCode());
+            assertEquals("null:firstkey=somevalue&someothervalue=somethingelse", httpMethod
+                .getResponseBodyAsString());
+        } finally {
+            httpMethod.releaseConnection();
+        }
+    }
+}



Mime
View raw message