wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r819007 - in /incubator/wink/trunk/wink-itests/wink-itest: ./ wink-example-helloworld/ wink-example-helloworld/src/ wink-example-helloworld/src/main/ wink-example-helloworld/src/main/java/ wink-example-helloworld/src/main/java/org/ wink-exa...
Date Fri, 25 Sep 2009 20:58:49 GMT
Author: bluk
Date: Fri Sep 25 20:58:48 2009
New Revision: 819007

URL: http://svn.apache.org/viewvc?rev=819007&view=rev
Log:
Add example to itests to gather trace temporarily

Added:
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/pom.xml   (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorld.java
  (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorldApplication.java
  (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/geronimo-web.xml
  (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.filter.xml
  (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.servlet.xml
  (with props)
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/apache/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/apache/wink/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/apache/wink/example/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/apache/wink/example/helloworld/
    incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/apache/wink/example/helloworld/HelloWorldTest.java
  (with props)
Modified:
    incubator/wink/trunk/wink-itests/wink-itest/pom.xml

Modified: incubator/wink/trunk/wink-itests/wink-itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/pom.xml?rev=819007&r1=819006&r2=819007&view=diff
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/pom.xml (original)
+++ incubator/wink/trunk/wink-itests/wink-itest/pom.xml Fri Sep 25 20:58:48 2009
@@ -39,6 +39,7 @@
         <module>wink-itest-extra-providers</module>
         <module>wink-itest-filter</module>
         <module>wink-itest-client</module>
+        <module>wink-example-helloworld</module>
     </modules>
 
     <properties>

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/pom.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/pom.xml?rev=819007&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/pom.xml (added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/pom.xml Fri Sep 25
20:58:48 2009
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <artifactId>wink-itest</artifactId>
+        <groupId>org.apache.wink</groupId>
+        <version>0.2-incubating-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.wink</groupId>
+    <artifactId>wink-example-helloworld</artifactId>
+    <packaging>war</packaging>
+    <name>Apache Wink Integration Hello World Example</name>
+</project>
\ No newline at end of file

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

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorld.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorld.java?rev=819007&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorld.java
(added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorld.java
Fri Sep 25 20:58:48 2009
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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.example.helloworld;
+
+import java.util.Date;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.wink.common.model.synd.SyndEntry;
+import org.apache.wink.common.model.synd.SyndText;
+
+/**
+ * Simple example - Hello World!
+ * <p/>
+ * The SDK dispatches HTTP requests for URI
+ * <code>http://[host]:[port]/HelloWorld/rest/world</code>, where
+ * <code>HelloWorld</code> is the context root, to this class. A simple Atom
+ * entry is returned in HTTP response.
+ * <p/>
+ * The service document is available at URI
+ * <code>http://[host]:[port]/HelloWorld/rest</code> but it is empty because
+ * this simple demo doesn't contain any collection of resources.
+ * <p/>
+ * This resource must be registered within a JAX-RS application, this example
+ * uses the default usage of application /WEB-INF/application
+ */
+@Path("/world")
+public class HelloWorld {
+    public static final String ID = "helloworld:1";
+
+    /**
+     * This method is called by the SDK for HTTP GET method requests where the
+     * Accept header allows the Atom media type application/atom+xml. A
+     * SyndEntry is created with basic information. Serialization of the
+     * SyndEntry to Atom entry is performed by the SDK automatically. The
+     * default status code of 200 (OK) is returned in the response.
+     * 
+     * @return SyndEntry of the requested resource
+     */
+    @GET
+    @Produces(MediaType.APPLICATION_ATOM_XML)
+    public SyndEntry getGreeting() {
+        // create and return a syndication entry with a "Hello World!" title,
+        // some ID and the current time.
+        SyndEntry synd = new SyndEntry(new SyndText("Hello World!"), ID, new Date());
+        return synd;
+    }
+
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorld.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorldApplication.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorldApplication.java?rev=819007&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorldApplication.java
(added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorldApplication.java
Fri Sep 25 20:58:48 2009
@@ -0,0 +1,35 @@
+/*
+ * 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.example.helloworld;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ws.rs.core.Application;
+
+public class HelloWorldApplication extends Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        Set<Class<?>> classes = new HashSet<Class<?>>();
+        classes.add(HelloWorld.class);
+        return classes;
+    }
+
+}

Propchange: incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/java/org/apache/wink/example/helloworld/HelloWorldApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/geronimo-web.xml?rev=819007&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/geronimo-web.xml
(added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/geronimo-web.xml
Fri Sep 25 20:58:48 2009
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
+    xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
+    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
+
+    <sys:environment>
+        <sys:moduleId>
+            <sys:groupId>${groupId}</sys:groupId>
+            <sys:artifactId>${artifactId}</sys:artifactId>
+            <sys:version>${version}</sys:version>
+            <sys:type>war</sys:type>
+        </sys:moduleId>
+    </sys:environment>
+
+    <gbean name="DirectoryLog4jConfiguration"
+        class="org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean">
+        <attribute name="log4jResource">META-INF/log4j.properties</attribute>
+    </gbean>
+
+    <context-root>${artifactId}</context-root>
+</web-app> 

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

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.filter.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.filter.xml?rev=819007&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.filter.xml
(added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.filter.xml
Fri Sep 25 20:58:48 2009
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+    <display-name>Archetype Created Web Application</display-name>
+    <filter>
+        <filter-name>HelloWorldApp</filter-name>
+        <filter-class>${wink.rest.filter}</filter-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.example.helloworld.HelloWorldApplication</param-value>
+        </init-param>
+    </filter>
+    <filter-mapping>
+        <filter-name>HelloWorldApp</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+</web-app>

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

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.servlet.xml
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.servlet.xml?rev=819007&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.servlet.xml
(added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/main/webapp/WEB-INF/web.servlet.xml
Fri Sep 25 20:58:48 2009
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+    <display-name>Archetype Created Web Application</display-name>
+    <servlet>
+        <servlet-name>HelloWorldApp</servlet-name>
+        <servlet-class>${wink.rest.servlet}</servlet-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.wink.example.helloworld.HelloWorldApplication</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>HelloWorldApp</servlet-name>
+        <url-pattern>/hello/*</url-pattern>
+    </servlet-mapping>
+</web-app>

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

Added: incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/apache/wink/example/helloworld/HelloWorldTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/apache/wink/example/helloworld/HelloWorldTest.java?rev=819007&view=auto
==============================================================================
--- incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/apache/wink/example/helloworld/HelloWorldTest.java
(added)
+++ incubator/wink/trunk/wink-itests/wink-itest/wink-example-helloworld/src/test/java/org/apache/wink/example/helloworld/HelloWorldTest.java
Fri Sep 25 20:58:48 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 org.apache.wink.example.helloworld;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.wink.test.integration.ServerEnvironmentInfo;
+
+import junit.framework.TestCase;
+
+/**
+ * Test of response from HelloWorld Resource.
+ */
+public class HelloWorldTest extends TestCase {
+
+    private static String getBaseURI() {
+        if (ServerEnvironmentInfo.isRestFilterUsed()) {
+            return ServerEnvironmentInfo.getBaseURI();
+        }
+        return ServerEnvironmentInfo.getBaseURI() + "/hello";
+    }
+
+    private HttpClient client;
+
+    public void setUp() {
+        client = new HttpClient();
+    }
+
+    /**
+     * Tests that a Hello World app will come up.
+     * 
+     * @throws Exception
+     */
+    public void testHelloWorld() throws Exception {
+        GetMethod getMethod = new GetMethod(getBaseURI() + "/world");
+        try {
+            client.executeMethod(getMethod);
+            assertEquals(200, getMethod.getStatusCode());
+            assertTrue(getMethod.getResponseBodyAsString(), getMethod.getResponseBodyAsString().contains("Hello
World"));
+        } finally {
+            getMethod.releaseConnection();
+        }
+    }
+}

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



Mime
View raw message