cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [1/2] git commit: [CXF-5575] Adding a dedicated test
Date Tue, 25 Feb 2014 16:41:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 4dc42da1d -> 86a4a176c


[CXF-5575] Adding a dedicated test


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a0bb363d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a0bb363d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a0bb363d

Branch: refs/heads/master
Commit: a0bb363dc27c7ce3fb4323548fac0b9d1b4658e3
Parents: a2d6cb8
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Feb 25 16:41:19 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Feb 25 16:41:19 2014 +0000

----------------------------------------------------------------------
 rt/pom.xml                                      |  2 +
 .../jaxrs/JAXRSSimpleRequestDispatcherTest.java | 59 ++++++++++++++++++++
 .../jaxrs_dispatch_simple/WEB-INF/web.xml       | 51 +++++++++++++++++
 .../resources/jaxrs_dispatch_simple/welcome.txt |  1 +
 4 files changed, 113 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a0bb363d/rt/pom.xml
----------------------------------------------------------------------
diff --git a/rt/pom.xml b/rt/pom.xml
index 1a7b0ad..0535f76 100644
--- a/rt/pom.xml
+++ b/rt/pom.xml
@@ -65,7 +65,9 @@
         <module>rs/security/oauth-parent</module>
         <module>rs/security/cors</module>
         <module>management</module>
+<!--
         <module>management-web</module>
+-->
         <module>javascript</module>
         <module>security</module>
     </modules>

http://git-wip-us.apache.org/repos/asf/cxf/blob/a0bb363d/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSimpleRequestDispatcherTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSimpleRequestDispatcherTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSimpleRequestDispatcherTest.java
new file mode 100644
index 0000000..7c6d7c4
--- /dev/null
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSimpleRequestDispatcherTest.java
@@ -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.cxf.systest.jaxrs;
+
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class JAXRSSimpleRequestDispatcherTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(JAXRSSimpleRequestDispatcherTest.class);
+    
+    @Ignore
+    public static class Server extends AbstractSpringServer {
+        public Server() {
+            super("/jaxrs_dispatch_simple", "/dispatch", Integer.parseInt(PORT));
+        }
+    }
+    
+    @BeforeClass
+    public static void startServers() throws Exception {
+        AbstractResourceInfo.clearAllMaps();
+        assertTrue("server did not launch correctly", launchServer(Server.class, true));
+    }
+    
+    
+    
+    @Test
+    public void testGetTextWelcomeFile() throws Exception {
+        String address = "http://localhost:" + PORT + "/dispatch/welcome.txt";
+        WebClient client = WebClient.create(address);
+        
+        client.accept("text/plain");
+        String welcome = client.get(String.class);
+        assertEquals("Welcome", welcome);
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/a0bb363d/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/WEB-INF/web.xml b/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/WEB-INF/web.xml
new file mode 100644
index 0000000..c7203ac
--- /dev/null
+++ b/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/WEB-INF/web.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<!--
+        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.
+-->
+<!-- START SNIPPET: webxml -->
+<web-app>
+    <servlet>
+    <servlet-name>CXFServlet</servlet-name>
+    <servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>
+    <init-param>
+      <param-name>jaxrs.serviceClasses</param-name>
+      <param-value>
+           org.apache.cxf.systest.jaxrs.BookStore
+      </param-value>
+    </init-param>  
+    <init-param>
+        <param-name>redirects-list</param-name>
+        <param-value>/welcome.txt</param-value>
+    </init-param>
+    <init-param>
+        <param-name>redirect-servlet-name</param-name>
+        <param-value>default</param-value>
+    </init-param>
+    <init-param>
+        <param-name>redirect-attributes</param-name>
+        <param-value>javax.servlet.include.request_uri</param-value>
+    </init-param>
+    <load-on-startup>1</load-on-startup>
+   </servlet>
+   <servlet-mapping>
+     <servlet-name>CXFServlet</servlet-name>
+     <url-pattern>/*</url-pattern>
+  </servlet-mapping>
+</web-app>
+<!-- END SNIPPET: webxml -->

http://git-wip-us.apache.org/repos/asf/cxf/blob/a0bb363d/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/welcome.txt
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/welcome.txt b/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/welcome.txt
new file mode 100644
index 0000000..01f3f00
--- /dev/null
+++ b/systests/jaxrs/src/test/resources/jaxrs_dispatch_simple/welcome.txt
@@ -0,0 +1 @@
+Welcome
\ No newline at end of file


Mime
View raw message