You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wink.apache.org by bl...@apache.org on 2009/08/07 05:10:46 UTC
svn commit: r801869 [2/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-in...
Added: incubator/wink/trunk/wink-itests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/pom.xml?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/pom.xml (added)
+++ incubator/wink/trunk/wink-itests/pom.xml Fri Aug 7 03:10:22 2009
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>wink</artifactId>
+ <groupId>org.apache.wink</groupId>
+ <version>0.1-incubating-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wink-itests</artifactId>
+ <packaging>pom</packaging>
+ <name>Wink Integration Tests</name>
+ <modules>
+ <module>wink-itest-support</module>
+ <module>wink-itest</module>
+ </modules>
+</project>
Added: incubator/wink/trunk/wink-itests/wink-itest-support/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest-support/pom.xml?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest-support/pom.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest-support/pom.xml Fri Aug 7 03:10:22 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>wink-itests</artifactId>
+ <groupId>org.apache.wink</groupId>
+ <version>0.1-incubating-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wink-itest-support</artifactId>
+ <name>Wink Integration Test Support</name>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+</project>
Copied: incubator/wink/trunk/wink-itests/wink-itest-support/src/main/java/org/apache/wink/test/integration/ServerContainerAssertions.java (from r801788, incubator/wink/trunk/wink-integration-test/wink-server-integration-test-support/src/main/java/org/apache/wink/test/integration/ServerContainerAssertions.java)
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest-support/src/main/java/org/apache/wink/test/integration/ServerContainerAssertions.java?p2=incubator/wink/trunk/wink-itests/wink-itest-support/src/main/java/org/apache/wink/test/integration/ServerContainerAssertions.java&p1=incubator/wink/trunk/wink-integration-test/wink-server-integration-test-support/src/main/java/org/apache/wink/test/integration/ServerContainerAssertions.java&r1=801788&r2=801869&rev=801869&view=diff
==============================================================================
(empty)
Copied: incubator/wink/trunk/wink-itests/wink-itest-support/src/main/java/org/apache/wink/test/integration/ServerEnvironmentInfo.java (from r801788, incubator/wink/trunk/wink-integration-test/wink-server-integration-test-support/src/main/java/org/apache/wink/test/integration/ServerEnvironmentInfo.java)
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest-support/src/main/java/org/apache/wink/test/integration/ServerEnvironmentInfo.java?p2=incubator/wink/trunk/wink-itests/wink-itest-support/src/main/java/org/apache/wink/test/integration/ServerEnvironmentInfo.java&p1=incubator/wink/trunk/wink-integration-test/wink-server-integration-test-support/src/main/java/org/apache/wink/test/integration/ServerEnvironmentInfo.java&r1=801788&r2=801869&rev=801869&view=diff
==============================================================================
(empty)
Added: incubator/wink/trunk/wink-itests/wink-itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/pom.xml?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/pom.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/pom.xml Fri Aug 7 03:10:22 2009
@@ -0,0 +1,527 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>wink-itests</artifactId>
+ <groupId>org.apache.wink</groupId>
+ <version>0.1-incubating-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wink-itest</artifactId>
+ <packaging>pom</packaging>
+ <name>Wink Integration Test</name>
+ <description>This is the base module for wink integration tests.</description>
+ <modules>
+ <module>wink-itest-context</module>
+ <module>wink-itest-providers</module>
+ <module>wink-itest-params</module>
+ <module>wink-itest-inheritance</module>
+ <module>wink-itest-targeting</module>
+ <module>wink-itest-validation</module>
+ </modules>
+
+ <properties>
+ <wink.server.hostname>localhost</wink.server.hostname>
+ <wink.server.port>8080</wink.server.port>
+ <wink.rest.servlet>org.apache.wink.server.internal.servlet.RestServlet</wink.rest.servlet>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee_1.4_spec</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.wink</groupId>
+ <artifactId>wink-server</artifactId>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.wink</groupId>
+ <artifactId>wink-itest-support</artifactId>
+ <version>0.1-incubating-SNAPSHOT</version>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.wink</groupId>
+ <artifactId>wink-client</artifactId>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/src/main/resources
+ </directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <resourcesDir>${project.build.outputDirectory}
+ </resourcesDir>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webXml>${project.basedir}/src/main/webapp/WEB-INF/web.xml
+ </webXml>
+ <webResources>
+ <resource>
+ <directory>${project.basedir}/src/main/webapp
+ </directory>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>${project.build.outputDirectory}
+ </directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+
+ <!--
+ NOTE: This horrible looking configuration sets up
+ the surefire plugin to not run tests during the
+ 'test' phase, but instead during the
+ 'integration-test' phase.
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ <execution>
+ <id>integration</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <systemProperties>
+ <property>
+ <name>wink-test-context-root</name>
+ <value>${artifactId}</value>
+ </property>
+ <property>
+ <name>wink-test-hostname</name>
+ <value>${wink.server.hostname}</value>
+ </property>
+ <property>
+ <name>wink-test-port</name>
+ <value>${wink.server.port}</value>
+ </property>
+ <property>
+ <name>wink-test-work-dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ <property>
+ <name>wink-test-container</name>
+ <value>${assemblyId}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.geronimo.buildsupport</groupId>
+ <artifactId>geronimo-maven-plugin</artifactId>
+ <configuration>
+ <reporters>
+ <reporter implementation="org.apache.geronimo.mavenplugins.geronimo.reporting.SurefireReporter">
+ <reportsDirectory>${project.build.directory}/surefire-reports
+ </reportsDirectory>
+ </reporter>
+ </reporters>
+
+ <assemblies>
+ <assembly>
+ <id>jetty</id>
+ <groupId>org.apache.geronimo.assemblies</groupId>
+ <artifactId>geronimo-jetty6-javaee5</artifactId>
+ <version>2.1.4</version>
+ <classifier>bin</classifier>
+ <type>zip</type>
+ </assembly>
+
+ <assembly>
+ <id>jetty-minimal</id>
+ <groupId>org.apache.geronimo.assemblies</groupId>
+ <artifactId>geronimo-jetty6-minimal</artifactId>
+ <version>2.1.4</version>
+ <classifier>bin</classifier>
+ <type>zip</type>
+ </assembly>
+
+ <assembly>
+ <id>tomcat</id>
+ <groupId>org.apache.geronimo.assemblies</groupId>
+ <artifactId>geronimo-tomcat6-javaee5</artifactId>
+ <version>2.1.4</version>
+ <classifier>bin</classifier>
+ <type>zip</type>
+ </assembly>
+
+ <assembly>
+ <id>tomcat-minimal</id>
+ <groupId>org.apache.geronimo.assemblies</groupId>
+ <artifactId>geronimo-tomcat6-minimal</artifactId>
+ <version>2.1.4</version>
+ <classifier>bin</classifier>
+ <type>zip</type>
+ </assembly>
+
+ <assembly>
+ <id>framework</id>
+ <groupId>org.apache.geronimo.assemblies</groupId>
+ <artifactId>geronimo-framework</artifactId>
+ <version>2.1.4</version>
+ <classifier>bin</classifier>
+ <type>zip</type>
+ </assembly>
+ </assemblies>
+
+ <defaultAssemblyId>jetty</defaultAssemblyId>
+
+ <optionSets>
+ <optionSet>
+ <id>morememory</id>
+ <options>
+ <option>-Xmx512m</option>
+ <option>-XX:MaxPermSize=128m</option>
+ </options>
+ </optionSet>
+
+ <optionSet>
+ <id>debug</id>
+ <options>
+ <option>-Xdebug</option>
+ <option>-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n</option>
+ </options>
+ </optionSet>
+ </optionSets>
+ </configuration>
+ <executions>
+ <execution>
+ <id>deploy-wars</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>deploy-module</goal>
+ </goals>
+ <configuration>
+ <moduleArchive>${project.build.directory}/${artifactId}-${version}.war
+ </moduleArchive>
+ </configuration>
+ </execution>
+ <execution>
+ <id>undeploy-war-as-moduleId</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>undeploy-module</goal>
+ </goals>
+ <configuration>
+ <moduleId>${groupId}/${artifactId}/${version}/war
+ </moduleId>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <configuration>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ </container>
+ </configuration>
+ <executions>
+ <execution>
+ <id>cargo-start</id>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <wait>false</wait>
+ <deployables/>
+ </configuration>
+ </execution>
+ <execution>
+ <id>cargo-stop</id>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ <phase>post-integration-test</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.10</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>testsuite-with-geronimo-jetty</id>
+ <activation>
+ <property>
+ <name>assemblyId</name>
+ <value>jetty</value>
+ </property>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.geronimo.buildsupport</groupId>
+ <artifactId>geronimo-maven-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>start</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start-server</goal>
+ </goals>
+ <configuration>
+ <logOutput>true</logOutput>
+ <background>true</background>
+ <verifyTimeout>300</verifyTimeout>
+ <refresh>true</refresh>
+ <optionSets>
+ <optionSet>
+ <id>default</id>
+ <options>
+ <option>-XX:MaxPermSize=160m
+ </option>
+ </options>
+ </optionSet>
+ </optionSets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.geronimo.buildsupport</groupId>
+ <artifactId>geronimo-maven-plugin</artifactId>
+ <inherited>true</inherited>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>testsuite-with-geronimo-tomcat</id>
+ <activation>
+ <property>
+ <name>assemblyId</name>
+ <value>tomcat</value>
+ </property>
+ </activation>
+ <properties>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.geronimo.buildsupport</groupId>
+ <artifactId>geronimo-maven-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>start</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start-server</goal>
+ </goals>
+ <configuration>
+ <logOutput>true</logOutput>
+ <background>true</background>
+ <verifyTimeout>300</verifyTimeout>
+ <refresh>true</refresh>
+ <optionSets>
+ <optionSet>
+ <id>default</id>
+ <options>
+ <option>-XX:MaxPermSize=160m
+ </option>
+ </options>
+ </optionSet>
+ </optionSets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.geronimo.buildsupport</groupId>
+ <artifactId>geronimo-maven-plugin</artifactId>
+ <inherited>true</inherited>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>testsuite-with-cargo-jetty-embedded</id>
+ <activation>
+ <property>
+ <name>assemblyId</name>
+ <value>cargo-jetty</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>testsuite-with-jetty-standalone</id>
+ <activation>
+ <property>
+ <name>assemblyId</name>
+ <value>jetty-standalone</value>
+ </property>
+ </activation>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.10</version>
+ <inherited>false</inherited>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>jetty-do-nothing-pre-integration</id>
+ <phase>pre-integration-test</phase>
+ </execution>
+ <execution>
+ <id>jetty-do-nothing-post-integration</id>
+ <phase>post-integration-test</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <inherited>true</inherited>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+</project>
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/pom.xml?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/pom.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/pom.xml Fri Aug 7 03:10:22 2009
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<project>
+ <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-context</artifactId>
+ <packaging>war</packaging>
+ <name>wink-jaxrs-test-context Maven Webapp</name>
+</project>
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/environment/servlets/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/environment/servlets/Application.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/environment/servlets/Application.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/environment/servlets/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.environment.servlets;
+
+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(WebContainerContextInjectionResource.class);
+ return clazzes;
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/environment/servlets/WebContainerContextInjectionResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/environment/servlets/WebContainerContextInjectionResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/environment/servlets/WebContainerContextInjectionResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/environment/servlets/WebContainerContextInjectionResource.java Fri Aug 7 03:10:22 2009
@@ -0,0 +1,104 @@
+/*
+ * 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.environment.servlets;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Context;
+
+@Path("environment/webcontainer/context/")
+public class WebContainerContextInjectionResource {
+
+ @Context
+ private HttpServletRequest httpServletRequest;
+
+ @Context
+ private HttpServletResponse httpServletResponse;
+
+ @Context
+ private ServletConfig servletConfig;
+
+ @Context
+ private ServletContext servletContext;
+
+ @GET
+ public String getHTTPRequestPathInfo() {
+ return httpServletRequest.getPathInfo();
+ }
+
+ @POST
+ public String getHTTPResponse() {
+ httpServletResponse.addHeader("responseheadername", "responseheadervalue");
+ httpServletResponse.setStatus(HttpServletResponse.SC_OK);
+
+ try {
+ PrintWriter pw =
+ new PrintWriter(new OutputStreamWriter(httpServletResponse.getOutputStream()));
+ /*
+ * PrintWriter does not automatically flush so going to flush pw
+ * manually. Reminder, cannot just flush HttpServletResponse
+ * OutputStream either since decorated class has no idea about
+ * PrintWriter.
+ */
+ pw.write("Hello World");
+ pw.flush();
+ /*
+ * this should always be committed now
+ */
+ if (httpServletResponse.isCommitted()) {
+ pw.write(" -- I was committted");
+ }
+ pw.flush();
+ } catch (IOException e) {
+ e.printStackTrace();
+ throw new RuntimeException("Could not output the servlet response.");
+ }
+
+ return "Shouldn't see me";
+ }
+
+ @GET
+ @Path("servletcontext")
+ public void getServletContext() throws IOException, ServletException {
+ httpServletRequest.setAttribute("wink", "testing 1-2-3");
+ servletContext.getRequestDispatcher("/servlets-test.jsp").include(httpServletRequest,
+ httpServletResponse);
+ httpServletRequest.removeAttribute("wink");
+
+ // need to flush buffer so the response is committed
+ httpServletResponse.flushBuffer();
+ }
+
+ @GET
+ @Path("servletconfig")
+ public String getServletConfig() {
+ return servletConfig.getServletName();
+ }
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/httpheaders/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/httpheaders/Application.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/httpheaders/Application.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/httpheaders/Application.java Fri Aug 7 03:10:22 2009
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.wink.itest.httpheaders;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Application to test the HTTP headers
+ */
+public class Application extends javax.ws.rs.core.Application {
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ Set<Class<?>> clazzes = new HashSet<Class<?>>();
+ clazzes.add(HttpHeadersMethodsResource.class);
+ return clazzes;
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/httpheaders/HttpHeadersMethodsResource.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/httpheaders/HttpHeadersMethodsResource.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/httpheaders/HttpHeadersMethodsResource.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/httpheaders/HttpHeadersMethodsResource.java Fri Aug 7 03:10:22 2009
@@ -0,0 +1,143 @@
+/*
+ * 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.httpheaders;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Cookie;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+
+@Path("context/httpheaders")
+public class HttpHeadersMethodsResource {
+
+ @Context
+ private HttpHeaders headersfield;
+
+ @GET
+ @Path("acceptablelanguages")
+ public String getLanguages() {
+ List<Locale> languages = headersfield.getAcceptableLanguages();
+ StringBuilder sb = new StringBuilder("acceptablelanguages:");
+ for (Locale l : languages) {
+ sb.append(l.getLanguage() + ":");
+ }
+ return sb.toString();
+ }
+
+ @GET
+ @Path("acceptablemediatypes")
+ public String getAcceptableMediaTypes() {
+ List<MediaType> mediatypes = headersfield.getAcceptableMediaTypes();
+ StringBuilder sb = new StringBuilder("acceptablemediatypes:");
+ for (MediaType mt : mediatypes) {
+ sb.append(mt.getType() + "/" + mt.getSubtype() + ":");
+ }
+ return sb.toString();
+ }
+
+ @POST
+ @Path("requestmediatype")
+ public String getRequestMediaType() {
+ MediaType mt = headersfield.getMediaType();
+ StringBuilder sb = new StringBuilder("mediatype:");
+ if (mt != null) {
+ sb.append(mt.getType() + "/" + mt.getSubtype() + ":");
+ } else {
+ sb.append("null:");
+ }
+ return sb.toString();
+ }
+
+ @POST
+ @Path("language")
+ public String getLanguage() {
+ Locale l = headersfield.getLanguage();
+ StringBuilder sb = new StringBuilder("language:");
+ if (l != null) {
+ sb.append(l.getLanguage() + ":");
+ } else {
+ sb.append("null:");
+ }
+ return sb.toString();
+ }
+
+ @POST
+ @Path("cookies")
+ public String getCookies() {
+ Map<String, Cookie> cookies = headersfield.getCookies();
+ StringBuilder sb = new StringBuilder("cookies:");
+ if (cookies == null) {
+ sb.append("null:");
+ } else {
+ List<String> cookieNames = new ArrayList<String>(cookies.keySet());
+ Collections.sort(cookieNames);
+ for (String c : cookieNames) {
+ sb.append(c + "=" + cookies.get(c).getValue() + ":");
+ }
+ }
+ return sb.toString();
+ }
+
+ @GET
+ public String getHeader(@Context HttpHeaders headers, @QueryParam("name") String headerName) {
+ try {
+ List<String> values = headers.getRequestHeader(headerName);
+ if (values == null) {
+ return "requestheader:null:";
+ } else {
+ values = new ArrayList<String>(values);
+ }
+ Collections.sort(values);
+ return "requestheader:" + values.toString();
+ } catch (IllegalArgumentException e) {
+ return "requestheader:illegalarg:";
+ }
+ }
+
+ @GET
+ @Path("/requestheaders")
+ public String getHeaders(@Context HttpHeaders headers, @QueryParam("name") String headerName) {
+ MultivaluedMap<String, String> requestHeaders = headers.getRequestHeaders();
+ List<String> keys = new ArrayList<String>(requestHeaders.keySet());
+ Collections.sort(keys);
+ StringBuilder sb = new StringBuilder("requestheaders:");
+ for (String k : keys) {
+ sb.append(k + "=");
+ List<String> values = requestHeaders.get(k);
+ if (values != null) {
+ values = new ArrayList<String>(values);
+ Collections.sort(values);
+ sb.append(values + ":");
+ }
+ }
+ return sb.toString();
+ }
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/Application.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/Application.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/Application.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/Application.java Fri Aug 7 03:10:22 2009
@@ -0,0 +1,77 @@
+/*
+ * 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.providers;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.wink.itest.providers.readers.MyMessageBodyReaderApplicationWildcardForShort;
+import org.apache.wink.itest.providers.readers.MyMessageBodyReaderForStrings;
+import org.apache.wink.itest.providers.readers.MyMessageBodyReaderInherited;
+import org.apache.wink.itest.providers.readers.MyMessageBodyReaderJSONForInteger;
+import org.apache.wink.itest.providers.readers.MyMessageBodyReaderJSONForLong;
+import org.apache.wink.itest.providers.readers.MyMessageBodyReaderJSONForShort;
+import org.apache.wink.itest.providers.readers.MyMessageBodyReaderWildcardForShort;
+import org.apache.wink.itest.providers.readers.MyMessageBodyReaderXMLAndJSONForNumber;
+
+public class Application extends javax.ws.rs.core.Application {
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ Set<Class<?>> clazzes = new HashSet<Class<?>>();
+ clazzes.add(MyResource.class);
+ return clazzes;
+ }
+
+ @Override
+ public Set<Object> getSingletons() {
+ Set<Object> objs = new HashSet<Object>();
+ objs.add(new ExceptionMapperForMyException());
+
+ objs.add(new MyJAXBContextResolverForXML());
+ objs.add(new MyExceptionContextResolver());
+ objs.add(new MyStringContextForAllWildcard());
+ objs.add(new MyStringContextForTextWildcard());
+ objs.add(new MyStringContextResolverForXML());
+ objs.add(new MyStringContextResolverForXML2());
+ objs.add(new MyStringContextResolverForXMLAndJSON());
+
+ objs.add(new MyMessageBodyWriterJSONForInteger());
+ objs.add(new MyMessageBodyWriterJSONForLong());
+ objs.add(new MyMessageBodyWriterXMLAndJSONForNumber());
+ objs.add(new MyMessageBodyWriterJSONForShort());
+ objs.add(new MyMessageBodyWriterApplicationWildcardForShort());
+ objs.add(new MyMessageBodyWriterWildcardForShort());
+ objs.add(new MyStringWriterForStrings());
+ objs.add(new MyMessageBodyWriterInherited());
+
+ objs.add(new MyMessageBodyReaderJSONForInteger());
+ objs.add(new MyMessageBodyReaderJSONForLong());
+ objs.add(new MyMessageBodyReaderXMLAndJSONForNumber());
+ objs.add(new MyMessageBodyReaderApplicationWildcardForShort());
+ objs.add(new MyMessageBodyReaderJSONForShort());
+ objs.add(new MyMessageBodyReaderWildcardForShort());
+ objs.add(new MyMessageBodyReaderForStrings());
+ objs.add(new MyMessageBodyReaderInherited());
+
+ return objs;
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/ExceptionMapperForMyException.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/ExceptionMapperForMyException.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/ExceptionMapperForMyException.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/ExceptionMapperForMyException.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.providers;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+public class ExceptionMapperForMyException implements ExceptionMapper<MyException> {
+
+ public Response toResponse(MyException arg0) {
+ return Response.serverError().entity(arg0).build();
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyException.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyException.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyException.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyException.java Fri Aug 7 03:10:22 2009
@@ -0,0 +1,26 @@
+/*
+ * 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.providers;
+
+public class MyException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyException2.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyException2.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyException2.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyException2.java Fri Aug 7 03:10:22 2009
@@ -0,0 +1,26 @@
+/*
+ * 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.providers;
+
+public class MyException2 extends MyException {
+
+ private static final long serialVersionUID = 1L;
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyExceptionContextResolver.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyExceptionContextResolver.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyExceptionContextResolver.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyExceptionContextResolver.java Fri Aug 7 03:10:22 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 org.apache.wink.itest.providers;
+
+import javax.ws.rs.Produces;
+import javax.ws.rs.ext.ContextResolver;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+@Produces("text/xml")
+public class MyExceptionContextResolver implements ContextResolver<Exception> {
+
+ public Exception getContext(Class<?> arg0) {
+ if (ExceptionMapperForMyException.class.isAssignableFrom(arg0)) {
+ return new MyException();
+ } else if (MyResource.class.isAssignableFrom(arg0)) {
+ return new MyException2();
+ }
+ return null;
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyJAXBContextResolverForXML.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyJAXBContextResolverForXML.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyJAXBContextResolverForXML.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyJAXBContextResolverForXML.java Fri Aug 7 03:10:22 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 org.apache.wink.itest.providers;
+
+import javax.ws.rs.Produces;
+import javax.ws.rs.ext.ContextResolver;
+import javax.ws.rs.ext.Provider;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+
+import org.apache.wink.itest.providers.xml.RootElement;
+
+@Provider
+@Produces("text/xml")
+public class MyJAXBContextResolverForXML implements ContextResolver<JAXBContext> {
+
+ public JAXBContext getContext(Class<?> arg0) {
+ if (RootElement.class.isAssignableFrom(arg0)) {
+ try {
+ return JAXBContext.newInstance(ObjectFactory.class.getPackage().getName());
+ } catch (JAXBException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterApplicationWildcardForShort.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterApplicationWildcardForShort.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterApplicationWildcardForShort.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterApplicationWildcardForShort.java Fri Aug 7 03:10:22 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 org.apache.wink.itest.providers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+@Produces("application/*")
+public class MyMessageBodyWriterApplicationWildcardForShort implements MessageBodyWriter<Short> {
+
+ public long getSize(Short arg0, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4) {
+ return -1;
+ }
+
+ public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) {
+ return true;
+ }
+
+ public void writeTo(Short arg0,
+ Class<?> arg1,
+ Type arg2,
+ Annotation[] arg3,
+ MediaType arg4,
+ MultivaluedMap<String, Object> arg5,
+ OutputStream arg6) throws IOException, WebApplicationException {
+ /* do nothing */
+ }
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInherited.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInherited.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInherited.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInherited.java Fri Aug 7 03:10:22 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 org.apache.wink.itest.providers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+@Produces("abcd/efgh")
+public class MyMessageBodyWriterInherited extends MyMessageBodyWriterInheritedSuperclass {
+
+ @Override
+ public long getSize(List arg0, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4) {
+ return -1;
+ }
+
+ @Override
+ public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) {
+ return arg0 == List.class;
+ }
+
+ @Override
+ public void writeTo(List arg0,
+ Class<?> arg1,
+ Type arg2,
+ Annotation[] arg3,
+ MediaType arg4,
+ MultivaluedMap<String, Object> arg5,
+ OutputStream arg6) throws IOException, WebApplicationException {
+ /* do nothing */
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInheritedSuperclass.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInheritedSuperclass.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInheritedSuperclass.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInheritedSuperclass.java Fri Aug 7 03:10:22 2009
@@ -0,0 +1,50 @@
+/*
+ * 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.providers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+
+public abstract class MyMessageBodyWriterInheritedSuperclass implements
+ MyMessageBodyWriterInterface {
+
+ public abstract long getSize(List arg0,
+ Class<?> arg1,
+ Type arg2,
+ Annotation[] arg3,
+ MediaType arg4);
+
+ public abstract boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3);
+
+ public abstract void writeTo(List arg0,
+ Class<?> arg1,
+ Type arg2,
+ Annotation[] arg3,
+ MediaType arg4,
+ MultivaluedMap<String, Object> arg5,
+ OutputStream arg6) throws IOException, WebApplicationException;
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInterface.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInterface.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInterface.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterInterface.java Fri Aug 7 03:10:22 2009
@@ -0,0 +1,28 @@
+/*
+ * 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.providers;
+
+import java.util.List;
+
+import javax.ws.rs.ext.MessageBodyWriter;
+
+public interface MyMessageBodyWriterInterface extends MessageBodyWriter<List> {
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForInteger.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForInteger.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForInteger.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForInteger.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.providers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+@Produces("application/json")
+public class MyMessageBodyWriterJSONForInteger implements MessageBodyWriter<Object> {
+
+ public long getSize(Object arg0, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4) {
+ return -1;
+ }
+
+ public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) {
+ return arg0.equals(Integer.class);
+ }
+
+ public void writeTo(Object arg0,
+ Class<?> arg1,
+ Type arg2,
+ Annotation[] arg3,
+ MediaType arg4,
+ MultivaluedMap<String, Object> arg5,
+ OutputStream arg6) throws IOException, WebApplicationException {
+ /* do nothing */
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForLong.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForLong.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForLong.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForLong.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.providers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+@Produces("application/json")
+public class MyMessageBodyWriterJSONForLong implements MessageBodyWriter<Object> {
+
+ public long getSize(Object arg0, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4) {
+ return -1;
+ }
+
+ public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) {
+ return arg0.equals(Long.class);
+ }
+
+ public void writeTo(Object arg0,
+ Class<?> arg1,
+ Type arg2,
+ Annotation[] arg3,
+ MediaType arg4,
+ MultivaluedMap<String, Object> arg5,
+ OutputStream arg6) throws IOException, WebApplicationException {
+ /* do nothing */
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForShort.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForShort.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForShort.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterJSONForShort.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.providers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+@Produces("application/json")
+public class MyMessageBodyWriterJSONForShort implements MessageBodyWriter<Object> {
+
+ public long getSize(Object arg0, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4) {
+ return -1;
+ }
+
+ public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) {
+ return Short.class.equals(arg0);
+ }
+
+ public void writeTo(Object arg0,
+ Class<?> arg1,
+ Type arg2,
+ Annotation[] arg3,
+ MediaType arg4,
+ MultivaluedMap<String, Object> arg5,
+ OutputStream arg6) throws IOException, WebApplicationException {
+ /* do nothing */
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterWildcardForShort.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterWildcardForShort.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterWildcardForShort.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterWildcardForShort.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.providers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+public class MyMessageBodyWriterWildcardForShort implements MessageBodyWriter<Object> {
+
+ public long getSize(Object arg0, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4) {
+ return -1;
+ }
+
+ public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) {
+ return Short.class.equals(arg0);
+ }
+
+ public void writeTo(Object arg0,
+ Class<?> arg1,
+ Type arg2,
+ Annotation[] arg3,
+ MediaType arg4,
+ MultivaluedMap<String, Object> arg5,
+ OutputStream arg6) throws IOException, WebApplicationException {
+ /* do nothing */
+ }
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterXMLAndJSONForNumber.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterXMLAndJSONForNumber.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterXMLAndJSONForNumber.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyMessageBodyWriterXMLAndJSONForNumber.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.providers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+@Produces(value = {"text/xml", "application/json"})
+public class MyMessageBodyWriterXMLAndJSONForNumber implements MessageBodyWriter<Object> {
+
+ public long getSize(Object arg0, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4) {
+ return -1;
+ }
+
+ public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) {
+ return (Integer.class.equals(arg0) || Long.class.equals(arg0));
+ }
+
+ public void writeTo(Object arg0,
+ Class<?> arg1,
+ Type arg2,
+ Annotation[] arg3,
+ MediaType arg4,
+ MultivaluedMap<String, Object> arg5,
+ OutputStream arg6) throws IOException, WebApplicationException {
+ /* do nothing */
+ }
+
+}
Added: incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyNonMappedException.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyNonMappedException.java?rev=801869&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyNonMappedException.java (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-itest-context/src/main/java/org/apache/wink/itest/providers/MyNonMappedException.java Fri Aug 7 03:10:22 2009
@@ -0,0 +1,26 @@
+/*
+ * 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.providers;
+
+public class MyNonMappedException extends MyException {
+
+ private static final long serialVersionUID = 1L;
+
+}