cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r490115 - in /incubator/cxf/trunk/rt/transports: http/src/main/java/org/apache/cxf/transport/http/ http2/src/main/java/org/apache/cxf/transport/http/ http2/src/test/java/org/apache/cxf/transport/http/
Date Mon, 25 Dec 2006 07:48:40 GMT
Author: ningjiang
Date: Sun Dec 24 23:48:39 2006
New Revision: 490115

URL: http://svn.apache.org/viewvc?view=rev&rev=490115
Log:
[CXF-326] Got cxf-rt-bindings-http, cxf-jca and cxf-systest's test passed with cxf-rt-transports-http2.

TO test the cxf-transports-http2 with the other modules, you need to replaced the ./rt/ws/rm/pom.xml,
./rt/bindings/http/pom.xml, ./systests/pom.xml and ./integration/jca/pom.xml's related modules
from "cxf-rt-transports-http" to "cxf-rt-transports-http2" in your working space.
And run mvn clean install from trunk. 

Modified:
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java
    incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
    incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java
    incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java?view=diff&rev=490115&r1=490114&r2=490115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java
Sun Dec 24 23:48:39 2006
@@ -150,13 +150,10 @@
             // TODO Auto-generated catch block
             e1.printStackTrace();
         }
-
-        if ("".equals(smap) && "".equals(contextName)) {
-            handler.setName("/");
-        } else {
-            handler.setName(smap);
-        }
+        
+        handler.setName(smap);        
         context.addHandler(handler);
+        
         try {
             handler.start();
         } catch (Exception e) {

Modified: incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?view=diff&rev=490115&r1=490114&r2=490115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Sun Dec 24 23:48:39 2006
@@ -182,7 +182,7 @@
      */
     public void send(Message message) throws IOException {
         Map<String, List<String>> headers = setHeaders(message);
-        URL currentURL = setupURL(message);
+        URL currentURL = setupURL(message);        
         URLConnection connection = 
             connectionFactory.createConnection(getProxy(), currentURL);
         connection.setDoOutput(true);        

Modified: incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java?view=diff&rev=490115&r1=490114&r2=490115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
(original)
+++ incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPDestination.java
Sun Dec 24 23:48:39 2006
@@ -290,7 +290,7 @@
             inMessage.put(HTTP_REQUEST, req);
             inMessage.put(HTTP_RESPONSE, resp);            
             inMessage.put(Message.HTTP_REQUEST_METHOD, req.getMethod());
-            inMessage.put(Message.PATH_INFO, req.getPathInfo());
+            inMessage.put(Message.PATH_INFO, req.getContextPath() + req.getPathInfo()); 
          
             inMessage.put(Message.QUERY_STRING, req.getQueryString());
             inMessage.put(Message.CONTENT_TYPE, req.getContentType());
             inMessage.setContent(InputStream.class, req.getInputStream());

Modified: incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java?view=diff&rev=490115&r1=490114&r2=490115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java
(original)
+++ incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apache/cxf/transport/http/JettyHTTPServerEngine.java
Sun Dec 24 23:48:39 2006
@@ -167,19 +167,8 @@
      * @param url the URL the servant was registered against.
      */
     public synchronized void removeServant(URL url) {
-        String lpath = url.getPath();
+        String contextName = HttpUriMapper.getContextName(url.getPath());
         
-        String contextName = "";
-        String servletMap = lpath;
-        int idx = lpath.lastIndexOf('/');
-        if (idx > 0) {
-            contextName = lpath.substring(0, idx);
-            servletMap = lpath.substring(idx);
-        }
-        if ("".equals(servletMap) && "".equals(contextName)) {
-            servletMap = "/";
-        }
-
         boolean found = false;
         // REVISIT: how come server can be null?
         if (server != null) {            
@@ -221,18 +210,7 @@
      * @return the HttpHandler if registered
      */
     public synchronized Handler getServant(URL url)  {
-        String lpath = url.getPath();
-        
-        String contextName = "";
-        String servletMap = lpath;
-        int idx = lpath.lastIndexOf('/');
-        if (idx > 0) {
-            contextName = lpath.substring(0, idx);
-            servletMap = lpath.substring(idx);
-        }
-        if ("".equals(servletMap) && "".equals(contextName)) {
-            servletMap = "/";
-        }
+        String contextName = HttpUriMapper.getContextName(url.getPath());
         
         Handler ret = null;
         // REVISIT: how come server can be null?

Modified: incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java?view=diff&rev=490115&r1=490114&r2=490115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java
(original)
+++ incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apache/cxf/transport/http/JettyHTTPDestinationTest.java
Sun Dec 24 23:48:39 2006
@@ -148,7 +148,7 @@
                      "GET");
         assertEquals("unexpected path",
                      inMessage.get(Message.PATH_INFO),
-                     "bar/foo");
+                     "/bar/foo");
         assertEquals("unexpected query",
                      inMessage.get(Message.QUERY_STRING),
                      "?customerId=abc&cutomerAdd=def");
@@ -340,30 +340,26 @@
             EasyMock.expectLastCall();
             request.setHandled(true);
             EasyMock.expectLastCall();
-        } else { // method is POST         
-            request.getMethod();
-            EasyMock.expectLastCall().andReturn(method);
-            request.getInputStream();
-            EasyMock.expectLastCall().andReturn(is);
-            request.getPathInfo();
-            EasyMock.expectLastCall().andReturn("bar/foo");
-            request.getQueryString();
-            EasyMock.expectLastCall().andReturn(query);
-            request.getContentType();
-            EasyMock.expectLastCall().andReturn("text/xml charset=utf8");
+        } else { // method is POST 
+            EasyMock.expect(request.getMethod()).andReturn(method);            
+            EasyMock.expect(request.getInputStream()).andReturn(is);
+            EasyMock.expect(request.getContextPath()).andReturn("/bar");
+            EasyMock.expect(request.getPathInfo()).andReturn("/foo");
+            EasyMock.expect(request.getQueryString()).andReturn(query);            
+            EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8");
+            
             HttpFields httpFields = new HttpFields();
             httpFields.add("content-type", "text/xml");
             httpFields.add("content-type", "charset=utf8");
             httpFields.put(JettyHTTPDestinationTest.AUTH_HEADER, JettyHTTPDestinationTest.BASIC_AUTH);
-            request.getHeaderNames();
-            EasyMock.expectLastCall().andReturn(httpFields.getFieldNames());
+            
+            EasyMock.expect(request.getHeaderNames()).andReturn(httpFields.getFieldNames());
             request.getHeaders("content-type");
             EasyMock.expectLastCall().andReturn(httpFields.getValues("content-type"));
             request.getHeaders(JettyHTTPDestinationTest.AUTH_HEADER);
             EasyMock.expectLastCall().andReturn(httpFields.getValues(JettyHTTPDestinationTest.AUTH_HEADER));
-           
-            request.getInputStream();                       
-            EasyMock.expectLastCall().andReturn(is);
+                                              
+            EasyMock.expect(request.getInputStream()).andReturn(is);
             request.setHandled(true);
             EasyMock.expectLastCall();  
             response.flushBuffer();
@@ -437,7 +433,7 @@
                      "POST");
         assertEquals("unexpected path",
                      inMessage.get(Message.PATH_INFO),
-                     "bar/foo");
+                     "/bar/foo");
         assertEquals("unexpected query",
                      inMessage.get(Message.QUERY_STRING),
                      "?name");



Mime
View raw message