incubator-wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ngalla...@apache.org
Subject svn commit: r787553 [4/34] - in /incubator/wink/contrib/ibm-jaxrs/tests: ./ fvt/ fvt/demo/ fvt/demo/jaxrs/ fvt/demo/jaxrs/cache/ fvt/demo/jaxrs/cache/server/ fvt/demo/jaxrs/cache/test/ fvt/demo/jaxrs/datasource/ fvt/demo/jaxrs/datasource/server/ fvt/de...
Date Tue, 23 Jun 2009 05:38:19 GMT
Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/Application.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/Application.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/Application.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package demo.jaxrs.multiservletsameapp.server;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class Application extends javax.ws.rs.core.Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        return null;
+    }
+
+    @Override
+    public Set<Object> getSingletons() {
+        Set<Object> objs = new HashSet<Object>();
+        SomeURLResource someURL = new SomeURLResource();
+        SomeOtherURLResource someOtherURL = new SomeOtherURLResource();
+
+        someOtherURL.setSomeURL(someURL);
+        someURL.setSomeOtherURLResource(someOtherURL);
+        objs.add(someURL);
+        objs.add(someOtherURL);
+        return objs;
+    }
+
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/SomeOtherURLResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/SomeOtherURLResource.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/SomeOtherURLResource.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/SomeOtherURLResource.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,59 @@
+/*
+ * 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 demo.jaxrs.multiservletsameapp.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/someOtherURL")
+public class SomeOtherURLResource {
+
+    private SomeURLResource someURL;
+
+    private int counter = 0;
+
+    public SomeURLResource getSomeURL() {
+        return someURL;
+    }
+
+    public void setSomeURL(SomeURLResource someURL) {
+        this.someURL = someURL;
+    }
+
+    public int getCounter() {
+        return counter;
+    }
+
+    public void setCounter(int counter) {
+        this.counter = counter;
+    }
+
+    @GET
+    public String getSomething() {
+        ++counter;
+        return "hit some other url";
+    }
+
+    @GET
+    @Path("counter")
+    public String getCount() {
+        return "" + counter + ":" + someURL.getCounter();
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/SomeURLResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/SomeURLResource.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/SomeURLResource.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/SomeURLResource.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,59 @@
+/*
+ * 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 demo.jaxrs.multiservletsameapp.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/someURL")
+public class SomeURLResource {
+
+    private int counter = 0;
+
+    private SomeOtherURLResource someOtherURLResource;
+
+    public int getCounter() {
+        return counter;
+    }
+
+    public void setCounter(int counter) {
+        this.counter = counter;
+    }
+
+    public SomeOtherURLResource getSomeOtherURLResource() {
+        return someOtherURLResource;
+    }
+
+    public void setSomeOtherURLResource(SomeOtherURLResource someOtherURLResource) {
+        this.someOtherURLResource = someOtherURLResource;
+    }
+
+    @GET
+    public String getSomething() {
+        ++counter;
+        return "hit some url";
+    }
+
+    @GET
+    @Path("counter")
+    public String getCount() {
+        return "" + counter + ":" + someOtherURLResource.getCounter();
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/WEB-INF/web.xml?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/WEB-INF/web.xml (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/server/WEB-INF/web.xml Tue Jun 23 05:37:57 2009
@@ -0,0 +1,45 @@
+<?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 id="WebApp_ID" version="2.5"
+	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+	<servlet>
+		<servlet-name>Application1</servlet-name>
+		<servlet-class>com.ibm.ws.jaxrs.web.RESTServlet</servlet-class>
+		<init-param>
+			<param-name>javax.ws.rs.Application</param-name>
+			<param-value>demo.jaxrs.multiservletsameapp.server.Application</param-value>
+		</init-param>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+	<servlet>
+		<servlet-name>Application2</servlet-name>
+		<servlet-class>com.ibm.ws.jaxrs.web.RESTServlet</servlet-class>
+		<init-param>
+			<param-name>javax.ws.rs.Application</param-name>
+			<param-value>demo.jaxrs.multiservletsameapp.server.Application</param-value>
+		</init-param>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>Application1</servlet-name>
+		<url-pattern>/someURL/*</url-pattern>
+	</servlet-mapping>
+	<servlet-mapping>
+		<servlet-name>Application2</servlet-name>
+		<url-pattern>/someOtherURL/*</url-pattern>
+	</servlet-mapping>
+</web-app>
\ No newline at end of file

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/test/UseSameResourcesTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/test/UseSameResourcesTest.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/test/UseSameResourcesTest.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameapp/test/UseSameResourcesTest.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,113 @@
+/*
+ * 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 demo.jaxrs.multiservletsameapp.test;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.GetMethod;
+
+import framework.defaults.test.FVTTestCase;
+
+public class UseSameResourcesTest extends FVTTestCase {
+
+    public static junit.framework.Test suite() {
+        Map<String, Set<String>> appsToURLPatternMap = new HashMap<String, Set<String>>();
+        Set<String> urlPatterns = new HashSet<String>();
+        urlPatterns.add("/someURL/*");
+        urlPatterns.add("/someOtherURL/*");
+        appsToURLPatternMap.put(
+                "demo.jaxrs.multiservletsameapp.server.Application",
+                urlPatterns);
+        return FVTTestCase.getTestSuite(UseSameResourcesTest.class,
+                appsToURLPatternMap);
+    }
+
+    /**
+     * Tests an unlikely occurance where two applications give instances of two different singletons.  They should not collide.
+     * In order for this to work as expected, the resources/providers would actually have to be real singletons.
+     * @throws HttpException
+     * @throws IOException
+     */
+    public void testSingletonsRemainInTheirApplications() throws HttpException,
+            IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/someURL/counter");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("0:0", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+        getMethod = new GetMethod(getBaseURI() + "/someURL");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("hit some url", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+        getMethod = new GetMethod(getBaseURI() + "/someURL/counter");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("1:0", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+        getMethod = new GetMethod(getBaseURI() + "/someOtherURL");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("hit some other url", getMethod
+                    .getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+        getMethod = new GetMethod(getBaseURI() + "/someURL/counter");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("1:0", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+        getMethod = new GetMethod(getBaseURI() + "/someOtherURL/counter");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("1:0", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/buildTest.xml
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/buildTest.xml?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/buildTest.xml (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/buildTest.xml Tue Jun 23 05:37:57 2009
@@ -0,0 +1,24 @@
+<?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 name="demo.jaxrs.multiservletsameappsingletons" default="all">
+	<import file="../../../buildCommon.xml" />
+</project>

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/Application.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/Application.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/Application.java Tue Jun 23 05:37:57 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 demo.jaxrs.multiservletsameappsingletons.server;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class Application extends javax.ws.rs.core.Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        return null;
+    }
+
+    @Override
+    public Set<Object> getSingletons() {
+        Set<Object> objs = new HashSet<Object>();
+        SomeURLResource someURL = SomeURLResource.getInstance();
+        SomeOtherURLResource someOtherURL = SomeOtherURLResource.getInstance();
+        someOtherURL.setSomeURL(someURL);
+        someURL.setSomeOtherURLResource(someOtherURL);
+        objs.add(someURL);
+        objs.add(someOtherURL);
+        return objs;
+    }
+
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/SomeOtherURLResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/SomeOtherURLResource.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/SomeOtherURLResource.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/SomeOtherURLResource.java Tue Jun 23 05:37:57 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 demo.jaxrs.multiservletsameappsingletons.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/someOtherURL")
+public class SomeOtherURLResource {
+
+    private SomeOtherURLResource() {
+
+    }
+
+    final static private SomeOtherURLResource singleton = new SomeOtherURLResource();
+
+    public static SomeOtherURLResource getInstance() {
+        return singleton;
+    }
+
+    private SomeURLResource someURL;
+
+    private int counter = 0;
+
+    public SomeURLResource getSomeURL() {
+        return someURL;
+    }
+
+    public void setSomeURL(SomeURLResource someURL) {
+        this.someURL = someURL;
+    }
+
+    public int getCounter() {
+        return counter;
+    }
+
+    public void setCounter(int counter) {
+        this.counter = counter;
+    }
+
+    @GET
+    public String getSomething() {
+        ++counter;
+        return "hit some other url";
+    }
+
+    @GET
+    @Path("counter")
+    public String getCount() {
+        return "" + counter + ":" + someURL.getCounter();
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/SomeURLResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/SomeURLResource.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/SomeURLResource.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/SomeURLResource.java Tue Jun 23 05:37:57 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 demo.jaxrs.multiservletsameappsingletons.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/someURL")
+public class SomeURLResource {
+
+    private SomeURLResource() {
+        /* do nothing */
+    }
+
+    private int counter = 0;
+
+    private SomeOtherURLResource someOtherURLResource;
+
+    final private static SomeURLResource singleton = new SomeURLResource();
+
+    public static SomeURLResource getInstance() {
+        return singleton;
+    }
+
+    public int getCounter() {
+        return counter;
+    }
+
+    public void setCounter(int counter) {
+        this.counter = counter;
+    }
+
+    public SomeOtherURLResource getSomeOtherURLResource() {
+        return someOtherURLResource;
+    }
+
+    public void setSomeOtherURLResource(SomeOtherURLResource someOtherURLResource) {
+        this.someOtherURLResource = someOtherURLResource;
+    }
+
+    @GET
+    public String getSomething() {
+        ++counter;
+        return "hit some url";
+    }
+
+    @GET
+    @Path("counter")
+    public String getCount() {
+        return "" + counter + ":" + someOtherURLResource.getCounter();
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/WEB-INF/web.xml?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/WEB-INF/web.xml (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/server/WEB-INF/web.xml Tue Jun 23 05:37:57 2009
@@ -0,0 +1,45 @@
+<?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 id="WebApp_ID" version="2.5"
+	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+	<servlet>
+		<servlet-name>Application1</servlet-name>
+		<servlet-class>com.ibm.ws.jaxrs.web.RESTServlet</servlet-class>
+		<init-param>
+			<param-name>javax.ws.rs.Application</param-name>
+			<param-value>demo.jaxrs.multiservletsameappsingletons.server.Application</param-value>
+		</init-param>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+	<servlet>
+		<servlet-name>Application2</servlet-name>
+		<servlet-class>com.ibm.ws.jaxrs.web.RESTServlet</servlet-class>
+		<init-param>
+			<param-name>javax.ws.rs.Application</param-name>
+			<param-value>demo.jaxrs.multiservletsameappsingletons.server.Application</param-value>
+		</init-param>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>Application1</servlet-name>
+		<url-pattern>/someURL/*</url-pattern>
+	</servlet-mapping>
+	<servlet-mapping>
+		<servlet-name>Application2</servlet-name>
+		<url-pattern>/someOtherURL/*</url-pattern>
+	</servlet-mapping>
+</web-app>
\ No newline at end of file

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/test/UseSameTrueSingletonResources.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/test/UseSameTrueSingletonResources.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/test/UseSameTrueSingletonResources.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/multiservletsameappsingletons/test/UseSameTrueSingletonResources.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,96 @@
+/*
+ * 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 demo.jaxrs.multiservletsameappsingletons.test;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.GetMethod;
+
+import framework.defaults.test.FVTTestCase;
+
+public class UseSameTrueSingletonResources extends FVTTestCase {
+
+    public static junit.framework.Test suite() {
+        Map<String, Set<String>> appsToURLPatternMap = new HashMap<String, Set<String>>();
+        Set<String> urlPatterns = new HashSet<String>();
+        urlPatterns.add("/someURL/*");
+        urlPatterns.add("/someOtherURL/*");
+        appsToURLPatternMap.put(
+                "demo.jaxrs.multiservletsameappsingletons.server.Application",
+                urlPatterns);
+        return FVTTestCase.getTestSuite(UseSameTrueSingletonResources.class,
+                appsToURLPatternMap);
+    }
+
+    /**
+     * Tests an unlikely occurance where two applications give instances of two different singletons.  They should not collide.
+     * In order for this to work as expected, the resources/providers would actually have to be real singletons.
+     * @throws HttpException
+     * @throws IOException
+     */
+    public void testSingletonsRemainInTheirApplications() throws HttpException,
+            IOException {
+        HttpClient client = new HttpClient();
+
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/someURL");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("hit some url", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+        getMethod = new GetMethod(getBaseURI() + "/someOtherURL");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("hit some other url", getMethod
+                    .getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+        getMethod = new GetMethod(getBaseURI() + "/someURL/counter");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("1:1", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+        getMethod = new GetMethod(getBaseURI() + "/someOtherURL/counter");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertEquals("1:1", getMethod.getResponseBodyAsString());
+        } finally {
+            getMethod.releaseConnection();
+        }
+
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/buildTest.xml
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/buildTest.xml?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/buildTest.xml (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/buildTest.xml Tue Jun 23 05:37:57 2009
@@ -0,0 +1,24 @@
+<?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 name="demo.jaxrs.nohttpmethodoverride" default="all">
+	<import file="../../../buildCommon.xml" />
+</project>

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/Application.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/Application.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/Application.java Tue Jun 23 05:37:57 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 demo.jaxrs.nohttpmethodoverride.server;
+
+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(MethodOverrideResource.class);
+        return clazzes;
+    }
+
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/MethodOverrideResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/MethodOverrideResource.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/MethodOverrideResource.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/MethodOverrideResource.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package demo.jaxrs.nohttpmethodoverride.server;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+
+@Path("httpnomethodoverride")
+public class MethodOverrideResource {
+
+    @POST
+    public String postSomething(byte[] echo) {
+        return "invoked post:" + new String(echo);
+    }
+
+    @PUT
+    public String putSomething(byte[] echo) {
+        return "invoked put:" + new String(echo);
+    }
+
+    @DELETE
+    public String deleteSomething(byte[] echo) {
+        return "invoked delete:" + new String(echo);
+    }
+
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/WEB-INF/web-no-runtime.xml
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/WEB-INF/web-no-runtime.xml?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/WEB-INF/web-no-runtime.xml (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/WEB-INF/web-no-runtime.xml Tue Jun 23 05:37:57 2009
@@ -0,0 +1,34 @@
+<?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 id="WebApp_ID" version="2.5"
+	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+	<servlet>
+		<servlet-name>HTTPNoMethodOverride</servlet-name>
+		<servlet-class>demo.jaxrs.nohttpmethodoverride.server.Application</servlet-class>		
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>HTTPNoMethodOverride</servlet-name>
+		<url-pattern>/*</url-pattern>
+	</servlet-mapping>
+</web-app>
\ No newline at end of file

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/WEB-INF/web.xml?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/WEB-INF/web.xml (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/server/WEB-INF/web.xml Tue Jun 23 05:37:57 2009
@@ -0,0 +1,38 @@
+<?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 id="WebApp_ID" version="2.5"
+	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+	<servlet>
+		<servlet-name>HTTPNoMethodOverride</servlet-name>
+		<servlet-class>com.ibm.ws.jaxrs.web.RESTServlet</servlet-class>
+		<init-param>
+			<param-name>javax.ws.rs.Application</param-name>
+			<param-value>demo.jaxrs.nohttpmethodoverride.server.Application</param-value>
+		</init-param>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>HTTPNoMethodOverride</servlet-name>
+		<url-pattern>/*</url-pattern>
+	</servlet-mapping>
+</web-app>
\ No newline at end of file

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/test/HTTPNoMethodOverrideTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/test/HTTPNoMethodOverrideTest.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/test/HTTPNoMethodOverrideTest.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nohttpmethodoverride/test/HTTPNoMethodOverrideTest.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,269 @@
+/*
+ * 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 demo.jaxrs.nohttpmethodoverride.test;
+
+import java.io.IOException;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.DeleteMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.PutMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+
+import framework.defaults.test.FVTTestCase;
+
+/**
+ * When the configuration property is not set to enable the
+ * X-HTTP-Method-Override and X-Method-Override support, verify that the correct
+ * methods are called.
+ */
+public class HTTPNoMethodOverrideTest extends FVTTestCase {
+
+    public static junit.framework.Test suite() {
+        return FVTTestCase.getTestSuite(HTTPNoMethodOverrideTest.class,
+                "demo.jaxrs.nohttpmethodoverride.server.Application");
+    }
+
+    /**
+     * Tests that a request with a X-HTTP-Method-Override in it will invoke the
+     * correct method when the configuration property is not set.
+     *
+     * @throws IOException
+     * @throws HttpException
+     */
+    public void testXHTTPMethodOverride() throws HttpException, IOException {
+        HttpClient client = new HttpClient();
+
+        PostMethod postMethod = new PostMethod(getBaseURI()
+                + "/httpnomethodoverride");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+
+        PutMethod putMethod = new PutMethod(getBaseURI()
+                + "/httpnomethodoverride");
+        try {
+            putMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(putMethod);
+            assertEquals(200, putMethod.getStatusCode());
+            assertEquals("invoked put:hello world", putMethod
+                    .getResponseBodyAsString());
+        } finally {
+            putMethod.releaseConnection();
+        }
+
+        postMethod = new PostMethod(getBaseURI() + "/httpnomethodoverride");
+        postMethod.setRequestHeader("X-HTTP-Method-Override", "pUt");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+
+        DeleteMethod deleteMethod = new DeleteMethod(getBaseURI()
+                + "/httpnomethodoverride");
+        try {
+            client.executeMethod(deleteMethod);
+            assertEquals(200, deleteMethod.getStatusCode());
+            assertEquals("invoked delete:", deleteMethod
+                    .getResponseBodyAsString());
+        } finally {
+            deleteMethod.releaseConnection();
+        }
+
+        postMethod = new PostMethod(getBaseURI() + "/httpnomethodoverride");
+        postMethod.setRequestHeader("X-HTTP-Method-Override", "dELETE");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+
+        postMethod = new PostMethod(getBaseURI() + "/httpnomethodoverride");
+        postMethod.setRequestHeader("X-HTTP-Method-Override", "GeT");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that a request with a X-Method-Override in it will invoke the
+     * correct method.
+     *
+     * @throws IOException
+     * @throws HttpException
+     */
+    public void testXMethodOverride() throws HttpException, IOException {
+        HttpClient client = new HttpClient();
+
+        PostMethod postMethod = new PostMethod(getBaseURI()
+                + "/httpnomethodoverride");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+
+        PutMethod putMethod = new PutMethod(getBaseURI()
+                + "/httpnomethodoverride");
+        try {
+            putMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(putMethod);
+            assertEquals(200, putMethod.getStatusCode());
+            assertEquals("invoked put:hello world", putMethod
+                    .getResponseBodyAsString());
+        } finally {
+            putMethod.releaseConnection();
+        }
+
+        postMethod = new PostMethod(getBaseURI() + "/httpnomethodoverride");
+        postMethod.setRequestHeader("X-Method-Override", "pUt");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+
+        DeleteMethod deleteMethod = new DeleteMethod(getBaseURI()
+                + "/httpnomethodoverride");
+        try {
+            client.executeMethod(deleteMethod);
+            assertEquals(200, deleteMethod.getStatusCode());
+            assertEquals("invoked delete:", deleteMethod
+                    .getResponseBodyAsString());
+        } finally {
+            deleteMethod.releaseConnection();
+        }
+
+        postMethod = new PostMethod(getBaseURI() + "/httpnomethodoverride");
+        postMethod.setRequestHeader("X-Method-Override", "dELETE");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+
+        postMethod = new PostMethod(getBaseURI() + "/httpnomethodoverride");
+        postMethod.setRequestHeader("X-Method-Override", "GET");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+    }
+
+    /**
+     * Tests that a request with a X-HTTP-Method-Override or X-Method-Override
+     * will be ignored even if the value is not a recognized HTTP Method.
+     *
+     * @throws IOException
+     * @throws HttpException
+     */
+    public void testMethodOverrideChangeToUnknownMethod() throws HttpException,
+            IOException {
+        HttpClient client = new HttpClient();
+
+        PostMethod postMethod = new PostMethod(getBaseURI()
+                + "/httpnomethodoverride");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+
+        postMethod = new PostMethod(getBaseURI() + "/httpnomethodoverride");
+        postMethod.setRequestHeader("X-HTTP-Method-Override", "MYMETHOD");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+
+        postMethod = new PostMethod(getBaseURI() + "/httpnomethodoverride");
+        postMethod.setRequestHeader("X-Method-Override", "DELETE2");
+        try {
+            postMethod.setRequestEntity(new StringRequestEntity("hello world",
+                    "text/plain", null));
+            client.executeMethod(postMethod);
+            assertEquals(200, postMethod.getStatusCode());
+            assertEquals("invoked post:hello world", postMethod
+                    .getResponseBodyAsString());
+        } finally {
+            postMethod.releaseConnection();
+        }
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/buildTest.xml
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/buildTest.xml?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/buildTest.xml (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/buildTest.xml Tue Jun 23 05:37:57 2009
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="demo.jaxrs.nousemethodnamesforhttpverbs" default="all">
+	<import file="../../../buildCommon.xml" />
+</project>

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/Application.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/Application.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/Application.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,17 @@
+package demo.jaxrs.nousemethodnamesforhttpverbs.server;
+
+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(ResourceWithHTTPVerbMethodNames.class);
+        clazzes.add(ResourceWithSublocatorHTTPVerbMethodNames.class);
+        clazzes.add(CounterResource.class);
+        return clazzes;
+    }
+
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/CounterResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/CounterResource.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/CounterResource.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/CounterResource.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,22 @@
+package demo.jaxrs.nousemethodnamesforhttpverbs.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("nousemethodnamesforhttpverbs/counter")
+public class CounterResource {
+
+    @Path("root")
+    @GET
+    public String rootCounter() {
+        return Integer.valueOf(ResourceWithHTTPVerbMethodNames.counter)
+                .toString();
+    }
+
+    @Path("sublocator")
+    @GET
+    public String sublocatorCounter() {
+        return Integer.valueOf(SomeClassWithHTTPMethodVerbNames.counter)
+                .toString();
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/ResourceWithHTTPVerbMethodNames.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/ResourceWithHTTPVerbMethodNames.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/ResourceWithHTTPVerbMethodNames.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/ResourceWithHTTPVerbMethodNames.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,29 @@
+package demo.jaxrs.nousemethodnamesforhttpverbs.server;
+
+import javax.ws.rs.Path;
+
+@Path("nousemethodnamesforhttpverbs/someresource")
+public class ResourceWithHTTPVerbMethodNames {
+
+    static int counter = 0;
+
+    public String getSomething() {
+        ++counter;
+        return "hello world";
+    }
+
+    public String postSomething() {
+        ++counter;
+        return "hello world";
+    }
+
+    public String deleteSomething() {
+        ++counter;
+        return "hello world";
+    }
+
+    public String putSomething() {
+        ++counter;
+        return "hello world";
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/ResourceWithSublocatorHTTPVerbMethodNames.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/ResourceWithSublocatorHTTPVerbMethodNames.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/ResourceWithSublocatorHTTPVerbMethodNames.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/ResourceWithSublocatorHTTPVerbMethodNames.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,12 @@
+package demo.jaxrs.nousemethodnamesforhttpverbs.server;
+
+import javax.ws.rs.Path;
+
+@Path("nousemethodnamesforhttpverbs/sublocatorresource")
+public class ResourceWithSublocatorHTTPVerbMethodNames {
+
+    @Path("sub")
+    public SomeClassWithHTTPMethodVerbNames getSublocator() {
+        return new SomeClassWithHTTPMethodVerbNames();
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/SomeClassWithHTTPMethodVerbNames.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/SomeClassWithHTTPMethodVerbNames.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/SomeClassWithHTTPMethodVerbNames.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/server/SomeClassWithHTTPMethodVerbNames.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,26 @@
+package demo.jaxrs.nousemethodnamesforhttpverbs.server;
+
+public class SomeClassWithHTTPMethodVerbNames {
+
+    static int counter = 0;
+
+    public String getSomething() {
+        ++counter;
+        return "hello world";
+    }
+
+    public String putSomething() {
+        ++counter;
+        return "hello world";
+    }
+
+    public String deleteSomething() {
+        ++counter;
+        return "hello world";
+    }
+
+    public String postSomething() {
+        ++counter;
+        return "hello world";
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/test/DoNotUseMethodNamesForHTTPVerbsTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/test/DoNotUseMethodNamesForHTTPVerbsTest.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/test/DoNotUseMethodNamesForHTTPVerbsTest.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/nousemethodnamesforhttpverbs/test/DoNotUseMethodNamesForHTTPVerbsTest.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,134 @@
+package demo.jaxrs.nousemethodnamesforhttpverbs.test;
+
+import java.io.IOException;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.methods.DeleteMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.PutMethod;
+
+import framework.defaults.test.FVTTestCase;
+
+/**
+ * These tests are designed to make sure the runtime does not invoke methods that should not be invoked.
+ */
+public class DoNotUseMethodNamesForHTTPVerbsTest extends FVTTestCase {
+
+    public static junit.framework.Test suite() {
+        return FVTTestCase.getTestSuite(
+                DoNotUseMethodNamesForHTTPVerbsTest.class,
+                "demo.jaxrs.nousemethodnamesforhttpverbs.server.Application");
+    }
+
+    /**
+     * Negative tests that method names that begin with HTTP verbs are not invoked on a root resource.
+     * @throws HttpException
+     * @throws IOException
+     */
+    public void testMethodsNotValid() throws HttpException, IOException {
+        HttpClient client = new HttpClient();
+        HttpMethod method = new PostMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/someresource");
+        try {
+            client.executeMethod(method);
+            assertEquals(405, method.getStatusCode());
+        } finally {
+            method.releaseConnection();
+        }
+
+        method = new GetMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/someresource");
+        try {
+            client.executeMethod(method);
+            assertEquals(405, method.getStatusCode());
+        } finally {
+            method.releaseConnection();
+        }
+
+        method = new PutMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/someresource");
+        try {
+            client.executeMethod(method);
+            assertEquals(405, method.getStatusCode());
+        } finally {
+            method.releaseConnection();
+        }
+
+        method = new DeleteMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/someresource");
+        try {
+            client.executeMethod(method);
+            assertEquals(405, method.getStatusCode());
+        } finally {
+            method.releaseConnection();
+        }
+
+        method = new GetMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/counter/root");
+        try {
+            client.executeMethod(method);
+            assertEquals(200, method.getStatusCode());
+            assertEquals("0", method.getResponseBodyAsString());
+        } finally {
+            method.releaseConnection();
+        }
+    }
+
+    /**
+     * Negative tests that method names that begin with HTTP verbs are not invoked on a sublocator method.
+     * @throws HttpException
+     * @throws IOException
+     */
+    public void testSublocatorMethodsNotValid() throws HttpException,
+            IOException {
+        HttpClient client = new HttpClient();
+        HttpMethod method = new PostMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/sublocatorresource/sub");
+        try {
+            client.executeMethod(method);
+            assertEquals(405, method.getStatusCode());
+        } finally {
+            method.releaseConnection();
+        }
+
+        method = new GetMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/sublocatorresource/sub");
+        try {
+            client.executeMethod(method);
+            assertEquals(405, method.getStatusCode());
+        } finally {
+            method.releaseConnection();
+        }
+
+        method = new PutMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/sublocatorresource/sub");
+        try {
+            client.executeMethod(method);
+            assertEquals(405, method.getStatusCode());
+        } finally {
+            method.releaseConnection();
+        }
+
+        method = new DeleteMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/sublocatorresource/sub");
+        try {
+            client.executeMethod(method);
+            assertEquals(405, method.getStatusCode());
+        } finally {
+            method.releaseConnection();
+        }
+
+        method = new GetMethod(getBaseURI()
+                + "/nousemethodnamesforhttpverbs/counter/sublocator");
+        try {
+            client.executeMethod(method);
+            assertEquals(200, method.getStatusCode());
+            assertEquals("0", method.getResponseBodyAsString());
+        } finally {
+            method.releaseConnection();
+        }
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/buildTest.xml
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/buildTest.xml?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/buildTest.xml (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/buildTest.xml Tue Jun 23 05:37:57 2009
@@ -0,0 +1,24 @@
+<?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 name="demo.jaxrs.options" default="all">
+	<import file="../../../buildCommon.xml" />
+</project>

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/package-info.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/package-info.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/package-info.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/package-info.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+
+/**
+ * Tests OPTIONS behavior.
+ */
+package demo.jaxrs.options;
+
+/*
+ * defect: consumes/produces on root resource is not set correctly?
+ */
+
+/*
+ * defect: only have sublocators (no normal methods). returns 404
+ */
+
+/*
+ * defect: call sublocator directly and returns JSON instead (need to have
+ * Accept)
+ */
+
+/*
+ * defect: call sublocator with interface inheritence directly returns 500
+ */
+
+/*
+ * defect: if subresource locator with "get" method is done and then @GET
+ * method is used, this becomes a problem. sub resource locator method
+ * should not return a resource (even though it has a @Path); not OPTIONS
+ * problem
+ */
+
+/* ======== todo ============ */
+
+/*
+ * question: should calling a sublocator directly return no root resources?
+ */
+
+/*
+ * question: should call directly on subresource return what's on the root
+ * resource or just sub resource?
+ */
+
+/*
+ * question: with a sub resource locator, the value of the path is used
+ * exactly (like with a preceding / or not). should this be normalized?
+ */
+
+/*
+ * test: deep sub locator nesting (i.e. root resource has produces/consumes
+ * and sub locator has media type or not
+ */
+
+/*
+ * test: call on regular expression
+ */
+
+/*
+ * test: JSON format
+ */
+
+/*
+ * test: HTML format
+ */

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/Application.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/Application.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/Application.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,42 @@
+/*
+ * 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 demo.jaxrs.options.server;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class Application extends javax.ws.rs.core.Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        Set<Class<?>> classes = new HashSet<Class<?>>();
+        classes.add(OptionsRootSimple.class);
+        classes.add(OptionsRootMetadataResource.class);
+        classes.add(OptionsCustomOptionsAnnotationResource.class);
+        classes.add(OptionsSubResourceSimple.class);
+        classes.add(OptionsSubLocatorSimple.class);
+        classes.add(OptionsSubLocatorWithNoRootResourceMethods.class);
+        classes.add(OptionsSubLocatorWithInheritance.class);
+        classes.add(OptionsSubLocatorMethodWithNameInFront.class);
+        classes.add(OptionsRootWithDifferentConsumesProduces.class);
+        return classes;
+    }
+
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsCustomOptionsAnnotationResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsCustomOptionsAnnotationResource.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsCustomOptionsAnnotationResource.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsCustomOptionsAnnotationResource.java Tue Jun 23 05:37:57 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 demo.jaxrs.options.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+import demo.jaxrs.options.server.annotations.CustomOptions;
+
+/**
+ * Resource for a custom OPTIONS annotation to verify that custom behavior is
+ * still possible.
+ */
+@Path("/options/custom")
+public class OptionsCustomOptionsAnnotationResource {
+
+    @GET
+    public void getSomething() {
+
+    }
+
+    @CustomOptions
+    @Produces("text/plain")
+    public Response customOptions() {
+        return Response.status(299).entity("Custom options response").build();
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootMetadataResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootMetadataResource.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootMetadataResource.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootMetadataResource.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,39 @@
+/*
+ * 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 demo.jaxrs.options.server;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+/**
+ * Root resource with {@link Produces} and {@link Consumes} annotations.
+ */
+@Path("/options/root")
+@Consumes("application/json")
+@Produces( { "text/xml", "text/plain" })
+public class OptionsRootMetadataResource {
+
+    @POST
+    public void postSomething() {
+        /* do nothing */
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootSimple.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootSimple.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootSimple.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootSimple.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,39 @@
+/*
+ * 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 demo.jaxrs.options.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * Simple root resource.
+ */
+@Path("/options/simple")
+public class OptionsRootSimple {
+
+    public OptionsRootSimple() {
+
+    }
+
+    @GET
+    public String getSomething() {
+        return "Hello World";
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootWithDifferentConsumesProduces.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootWithDifferentConsumesProduces.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootWithDifferentConsumesProduces.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsRootWithDifferentConsumesProduces.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,62 @@
+/*
+ * 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 demo.jaxrs.options.server;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+/**
+ * Root resource with different methods with different {@link Consumes} and
+ * {@link Produces} annotations.
+ */
+@Path("/options/diffconsumesproduces")
+public class OptionsRootWithDifferentConsumesProduces {
+
+    @GET
+    @Consumes("application/json")
+    @Produces("application/json")
+    public String findJSON() {
+        return "JSON";
+    }
+
+    @GET
+    @Consumes( { "text/xml", "text/plain" })
+    @Produces("text/xml")
+    public String findXML() {
+        return "XML";
+    }
+
+    @POST
+    @Consumes( { "text/xml" })
+    @Produces( { "text/xml", "text/plain" })
+    public String postXML() {
+        return "JSON";
+    }
+
+    @POST
+    @Consumes( { "text/plain", "application/json" })
+    @Produces("text/xml")
+    public String postXMLAgain() {
+        return "XML";
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorMethodWithNameInFront.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorMethodWithNameInFront.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorMethodWithNameInFront.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorMethodWithNameInFront.java Tue Jun 23 05:37:57 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 demo.jaxrs.options.server;
+
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import demo.jaxrs.options.server.customer.UnknownCustomer;
+
+/**
+ * Root resource with a sub-locator method name that starts with "GET".
+ */
+@Path("/options/sublocatormethodwithname")
+public class OptionsSubLocatorMethodWithNameInFront {
+
+    @Path("/customer")
+    public UnknownCustomer getCustomer() {
+        return new UnknownCustomer();
+    }
+
+    @POST
+    public void something() {
+        /*
+         * do nothing
+         */
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorSimple.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorSimple.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorSimple.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorSimple.java Tue Jun 23 05:37:57 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 demo.jaxrs.options.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+
+import demo.jaxrs.options.server.customer.UnknownCustomer;
+
+/**
+ * Root resource with a sublocator resource.
+ */
+@Path("/options/sublocators")
+@Produces(value = "application/xml")
+public class OptionsSubLocatorSimple {
+
+    @Path("customer")
+    public UnknownCustomer findCustomer(@QueryParam("type") String type) {
+        return new UnknownCustomer();
+    }
+
+    @GET
+    public void something() {
+
+    }
+
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorWithInheritance.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorWithInheritance.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorWithInheritance.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorWithInheritance.java Tue Jun 23 05:37:57 2009
@@ -0,0 +1,55 @@
+/*
+ * 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 demo.jaxrs.options.server;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+
+import demo.jaxrs.options.server.customer.Customer;
+import demo.jaxrs.options.server.customer.ExternalCustomer;
+import demo.jaxrs.options.server.customer.InternalCustomer;
+import demo.jaxrs.options.server.customer.UnknownCustomer;
+
+/**
+ * Root resource with a sub-locator that has a interface return type.
+ */
+@Path("/options/sublocatorinheritence")
+public class OptionsSubLocatorWithInheritance {
+
+    @Path("customer")
+    public Customer findCustomer(@QueryParam("type") String type) {
+        if (type != null) {
+            if (type.equals("internal")) {
+                return new InternalCustomer();
+            } else if (type.equals("external")) {
+                return new ExternalCustomer();
+            }
+        }
+        return new UnknownCustomer();
+    }
+
+    @GET
+    public void something() {
+        /*
+         * do nothing
+         */
+    }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorWithNoRootResourceMethods.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorWithNoRootResourceMethods.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorWithNoRootResourceMethods.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubLocatorWithNoRootResourceMethods.java Tue Jun 23 05:37:57 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 demo.jaxrs.options.server;
+
+import javax.ws.rs.Path;
+
+import demo.jaxrs.options.server.customer.UnknownCustomer;
+
+/**
+ * Root resource with a sub-locator with no root root resource methods.
+ */
+@Path("/options/sublocatorsnoresmethods")
+public class OptionsSubLocatorWithNoRootResourceMethods {
+
+    @Path("/customer")
+    public UnknownCustomer findCustomer() {
+        return new UnknownCustomer();
+    }
+
+    // @GET
+    // public void something() {
+    //
+    // }
+}

Added: incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubResourceSimple.java
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubResourceSimple.java?rev=787553&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubResourceSimple.java (added)
+++ incubator/wink/contrib/ibm-jaxrs/tests/fvt/demo/jaxrs/options/server/OptionsSubResourceSimple.java Tue Jun 23 05:37:57 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 demo.jaxrs.options.server;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+/**
+ * Root resource with sub-resource methods.
+ */
+@Path("/options/subresource")
+@Consumes("text/plain")
+@Produces("application/c1")
+public class OptionsSubResourceSimple {
+
+    @DELETE
+    @Produces("text/xml")
+    @Consumes("text/xml")
+    @Path("/delete")
+    public void deleteSubSomething() {
+        /*
+         * do nothing
+         */
+    }
+
+    @GET
+    @Path("/get")
+    public void getSubSomething() {
+        /*
+         * do nothing
+         */
+    }
+
+    @DELETE
+    @Produces("application/json")
+    public void deleteSomething() {
+        /*
+         * do nothing
+         */
+    }
+}



Mime
View raw message