cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r560551 - in /incubator/cxf/trunk/rt/transports/http-jetty/src: main/java/org/apache/cxf/transport/http_jetty/ main/java/org/apache/cxf/transport/http_jetty/spring/ test/java/org/apache/cxf/transport/http_jetty/
Date Sat, 28 Jul 2007 15:00:42 GMT
Author: ningjiang
Date: Sat Jul 28 08:00:40 2007
New Revision: 560551

URL: http://svn.apache.org/viewvc?view=rev&rev=560551
Log:
CXF-856 applied Glen' patch, also did some clean up work of the http-jetty codes

Added:
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalid-engines.xml
      - copied unchanged from r560524, incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml
Removed:
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/invalide-engines.xml
Modified:
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/Messages.properties
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?view=diff&rev=560551&r1=560550&r2=560551
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Sat Jul 28 08:00:40 2007
@@ -269,7 +269,7 @@
         ContextHandler context = new ContextHandler();
         context.setContextPath(contextName);
         
-        // bind the jetty http hanler with the context handler        
+        // bind the jetty http handler with the context handler        
         context.setHandler(handler);
         if (isSessionSupport) {            
             HashSessionManager sessionManager = new HashSessionManager();
@@ -396,20 +396,20 @@
 
     protected void retrieveListenerFactory() {
         if (tlsServerParameters != null) {
-            connectorFactory = 
-                getHTTPSConnectorFactory(tlsServerParameters);            
             if (null != connector && !(connector instanceof SslSocketConnector))
{                         
-                throw new RuntimeException("JettyServerEngine Port " 
-                        + port + " has not configured for ssl connector :" + connector);
               
+                throw new RuntimeException("Connector " + connector + " for JettyServerEngine
Port " 
+                        + port + " does not support SSL connections.");                
             }
+            connectorFactory = 
+                getHTTPSConnectorFactory(tlsServerParameters);            
             protocol = "https";
             
         } else {
-            connectorFactory = getHTTPConnectorFactory();            
             if (connector instanceof SslSocketConnector) {
-                throw new RuntimeException("JettyServerEngine Port " 
-                      + port + " has configured for ssl connector :" + connector);
+                throw new RuntimeException("Connector " + connector + " for JettyServerEngine
Port " 
+                      + port + " does not support non-SSL connections.");
             }
+            connectorFactory = getHTTPConnectorFactory();            
             protocol = "http";
         }
         LOG.fine("Configured port " + port + " for \"" + protocol + "\".");
@@ -466,8 +466,8 @@
 
     private void checkConnectorPort() throws IOException {
         if (null != connector && port != connector.getPort()) {
-            throw new IOException("The connector's port is not match"
-                        + " with the server engine port!");
+            throw new IOException("Error: Connector port " + connector.getPort() + " does
not match"
+                        + " with the server engine port " + port);
         }
     }
     

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java?view=diff&rev=560551&r1=560550&r2=560551
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
Sat Jul 28 08:00:40 2007
@@ -172,9 +172,9 @@
         } 
         // checking the protocol    
         if (!protocol.equals(ref.getProtocol())) {
-            throw new IOException("setting a wrong protocol, "
+            throw new IOException("Protocol mismatch: "
                         + "engine's protocol is " + ref.getProtocol()
-                        + "the url protocol is " + protocol);
+                        + ", the url protocol is " + protocol);
         }
                 
         return ref;
@@ -187,7 +187,7 @@
     public synchronized void destroyForPort(int port) {
         JettyHTTPServerEngine ref = portMap.remove(port);
         if (ref != null) {
-            LOG.fine("Stopping Jetty HTTP Server Engine for port " + port + ".");
+            LOG.fine("Stopping Jetty HTTP Server Engine on port " + port + ".");
             try {
                 ref.stop();
             } catch (Exception e) {

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/Messages.properties?view=diff&rev=560551&r1=560550&r2=560551
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/Messages.properties
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/Messages.properties
Sat Jul 28 08:00:40 2007
@@ -18,10 +18,7 @@
 #    under the License.
 #
 #
-UNEXPECTED_RESPONSE_TYPE_MSG = Unexpected response type {0}
-NULL_RESPONSE_MSG = Response object is null
-DECOUPLED_RESPONSE_FAILED_MSG = Decouple response failed
-START_UP_SERVER_FAILED_MSG = Start up the jetty server failed: {0}
-ADD_SERVANT_FAILED_MSG = Add the servant to jetty server failed: {0}
-REMOVE_SERVANT_FAILED_MSG = Remove the servant from the jetty server failed: {0}
-CAN_NOT_FIND_HANDLER_MSG = Can not find the handler to remove , the context url is {0}
+START_UP_SERVER_FAILED_MSG = Could not start Jetty server: {0}
+ADD_SERVANT_FAILED_MSG = Could not add servant to Jetty server: {0}
+REMOVE_SERVANT_FAILED_MSG = Could not remove servant from Jetty server: {0}
+CAN_NOT_FIND_HANDLER_MSG = Could not find the handler to remove for context url {0}

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java?view=diff&rev=560551&r1=560550&r2=560551
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHttpServerEngineBeanDefinitionParser.java
Sat Jul 28 08:00:40 2007
@@ -129,13 +129,14 @@
         PropertyValue tlsParameterMapValue  = 
             engineFactoryProperties.getPropertyValue("tlsServerParametersMap");
         if (null == tlsParameterMapValue) {
-            throw new RuntimeException("can't find the tlsParametersMap form transport factory!");
+            throw new RuntimeException("Could not find the tlsParametersMap " 
+                                       + "from the JettyHTTPServerEngineFactory!");
         } else {
             Map tlsServerParametersMap  = 
                 (Map)tlsParameterMapValue.getValue();
             result = (TLSServerParameters)tlsServerParametersMap.get(reference);
             if (result == null) {
-                throw new RuntimeException("can't find the reference [" 
+                throw new RuntimeException("Could not find the reference [" 
                                            + reference + "]'s mapping tlsParameter");
             }
         }
@@ -149,12 +150,13 @@
         PropertyValue threadingParametersMapValue = 
             engineFactoryProperties.getPropertyValue("threadingParametersMap");
         if (null == threadingParametersMapValue) {
-            throw new RuntimeException("can't find the threadingParametersMap form transport
factory!");
+            throw new RuntimeException("Could not find the threadingParametersMap " 
+                                       + "from the JettyHTTPServerEngineFactory!");
         } else {
             Map threadingParametersMap  = (Map)threadingParametersMapValue.getValue();
             result = (ThreadingParameters)threadingParametersMap.get(reference);
             if (result == null) {
-                throw new RuntimeException("can't find the reference [" 
+                throw new RuntimeException("Could not find the reference [" 
                           + reference + "]'s mapping threadingParameters");
             }
         }     

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java?view=diff&rev=560551&r1=560550&r2=560551
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactoryTest.java
Sat Jul 28 08:00:40 2007
@@ -125,19 +125,19 @@
         
         try {
             engine = factory.createJettyHTTPServerEngine(1234, "http");
-            fail("the engine's protcal should be https");
+            fail("The engine's protocol should be https");
         } catch (Exception e) {
             // expect the exception
         }
     }
     
     @Test
-    public void testAnInvalideConfiguresfile() {
+    public void testAnInvalidConfiguresfile() {
         
         // This file configures the factory to configure
         // port 1234 with default TLS.
         
-        URL config = getClass().getResource("invalide-engines.xml");
+        URL config = getClass().getResource("invalid-engines.xml");
 
         bus = new SpringBusFactory().createBus(config);
             
@@ -155,7 +155,7 @@
         
         try {
             factory.createJettyHTTPServerEngine(1234, "https");
-            fail("A configure error will should be thrown here ");            
+            fail("A configure error should be thrown here ");            
         } catch (Exception e) {
             // experct the exception
         }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java?view=diff&rev=560551&r1=560550&r2=560551
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
Sat Jul 28 08:00:40 2007
@@ -143,11 +143,7 @@
         }
     }
     
-    @Test
-    public void testSetSessionSupport() {
-        
-    }
-    
+       
     
     @Test 
     public void testaddServants() throws Exception {
@@ -197,7 +193,7 @@
         String response = null;
         try {
             response = getResponse(url.toString());
-            System.out.println("response is " + response);
+            assertEquals("the jetty http handler1 did not take effect", response, "string1string2");
         } catch (Exception ex) {
             fail("Can't get the reponse from the server " + ex);
         }



Mime
View raw message