cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r966858 - in /cxf/branches/servlet3jetty7: rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ systests/transports/src/test/java/org/apache/cxf/systest/http_...
Date Thu, 22 Jul 2010 21:09:36 GMT
Author: dkulp
Date: Thu Jul 22 21:09:36 2010
New Revision: 966858

URL: http://svn.apache.org/viewvc?rev=966858&view=rev
Log:
Get more tests working

Modified:
    cxf/branches/servlet3jetty7/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
    cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerGreeterNoWsdlTest.java
    cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
    cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java
    cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml
    cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/server.xml

Modified: cxf/branches/servlet3jetty7/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=966858&r1=966857&r2=966858&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++ cxf/branches/servlet3jetty7/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Thu Jul 22 21:09:36 2010
@@ -53,6 +53,7 @@ import org.eclipse.jetty.server.ssl.SslS
 import org.eclipse.jetty.util.component.Container;
 import org.eclipse.jetty.util.thread.OldQueuedThreadPool;
 import org.eclipse.jetty.util.thread.QueuedThreadPool;
+import org.eclipse.jetty.util.thread.ThreadPool;
 
 
 /**
@@ -375,28 +376,8 @@ public class JettyHTTPServerEngine
 
             try {                
                 setReuseAddress(connector);
+                setupThreadPool();
                 server.start();
-               
-                AbstractConnector aconn = (AbstractConnector) connector;
-                if (isSetThreadingParameters()) {
-                    if (aconn.getThreadPool() instanceof OldQueuedThreadPool) {
-                        OldQueuedThreadPool pool = (OldQueuedThreadPool)aconn.getThreadPool();
-                        if (getThreadingParameters().isSetMinThreads()) {
-                            pool.setMinThreads(getThreadingParameters().getMinThreads());
-                        }
-                        if (getThreadingParameters().isSetMaxThreads()) {
-                            pool.setMaxThreads(getThreadingParameters().getMaxThreads());
-                        }
-                    } else if (aconn.getThreadPool() instanceof QueuedThreadPool) {
-                        QueuedThreadPool pool = (QueuedThreadPool)aconn.getThreadPool();
-                        if (getThreadingParameters().isSetMinThreads()) {
-                            pool.setMinThreads(getThreadingParameters().getMinThreads());
-                        }
-                        if (getThreadingParameters().isSetMaxThreads()) {
-                            pool.setMaxThreads(getThreadingParameters().getMaxThreads());
-                        }
-                    }
-                }
             } catch (Exception e) {
                 LOG.log(Level.SEVERE, "START_UP_SERVER_FAILED_MSG", new Object[] {e.getMessage(),
port});
                 //problem starting server
@@ -449,6 +430,34 @@ public class JettyHTTPServerEngine
         ++servantCount;
     }
     
+    protected void setupThreadPool() {
+        AbstractConnector aconn = (AbstractConnector) connector;
+        if (isSetThreadingParameters()) {
+            ThreadPool pool = aconn.getThreadPool();
+            if (pool == null) {
+                pool = new QueuedThreadPool();
+                aconn.setThreadPool(pool);
+            }
+            if (pool instanceof OldQueuedThreadPool) {
+                OldQueuedThreadPool pl = (OldQueuedThreadPool)pool;
+                if (getThreadingParameters().isSetMinThreads()) {
+                    pl.setMinThreads(getThreadingParameters().getMinThreads());
+                }
+                if (getThreadingParameters().isSetMaxThreads()) {
+                    pl.setMaxThreads(getThreadingParameters().getMaxThreads());
+                }
+            } else if (pool instanceof QueuedThreadPool) {
+                QueuedThreadPool pl = (QueuedThreadPool)pool;
+                if (getThreadingParameters().isSetMinThreads()) {
+                    pl.setMinThreads(getThreadingParameters().getMinThreads());
+                }
+                if (getThreadingParameters().isSetMaxThreads()) {
+                    pl.setMaxThreads(getThreadingParameters().getMaxThreads());
+                }
+            }
+        }
+    }
+    
     private void setReuseAddress(Connector conn) throws IOException {
         if (conn instanceof AbstractConnector) {
             ((AbstractConnector)conn).setReuseAddress(isReuseAddress());

Modified: cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerGreeterNoWsdlTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerGreeterNoWsdlTest.java?rev=966858&r1=966857&r2=966858&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerGreeterNoWsdlTest.java
(original)
+++ cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerGreeterNoWsdlTest.java
Thu Jul 22 21:09:36 2010
@@ -79,7 +79,7 @@ public class ClientServerGreeterNoWsdlTe
         
         assertEquals(200, httpConnection.getResponseCode());
     
-        assertEquals("text/xml; charset=utf-8", httpConnection.getContentType());
+        assertEquals("text/xml;charset=utf-8", httpConnection.getContentType().toLowerCase());
         assertEquals("OK", httpConnection.getResponseMessage());
         
         InputStream in = httpConnection.getInputStream();

Modified: cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?rev=966858&r1=966857&r2=966858&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
(original)
+++ cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
Thu Jul 22 21:09:36 2010
@@ -680,7 +680,7 @@ public class ClientServerTest extends Ab
                 BindingProvider bp = (BindingProvider)greeter;
                 Map<String, Object> responseContext = bp.getResponseContext();
                 String contentType = (String) responseContext.get(Message.CONTENT_TYPE);
-                assertEquals("text/xml; charset=utf-8", contentType);
+                assertEquals("text/xml;charset=utf-8", contentType.toLowerCase());
                 Integer responseCode = (Integer) responseContext.get(Message.RESPONSE_CODE);
                 assertEquals(500, responseCode.intValue());                
                 assertNotNull(brlf.getFaultInfo());
@@ -723,7 +723,7 @@ public class ClientServerTest extends Ab
         
         assertEquals(200, httpConnection.getResponseCode());
         
-        assertEquals("text/xml; charset=utf-8", httpConnection.getContentType());
+        assertEquals("text/xml;charset=utf-8", httpConnection.getContentType().toLowerCase());
         assertEquals("OK", httpConnection.getResponseMessage());
         
         InputStream in = httpConnection.getInputStream();
@@ -753,7 +753,7 @@ public class ClientServerTest extends Ab
         
         assertEquals(200, httpConnection.getResponseCode());
     
-        assertEquals("text/xml; charset=utf-8", httpConnection.getContentType());
+        assertEquals("text/xml;charset=utf-8", httpConnection.getContentType().toLowerCase());
         assertEquals("OK", httpConnection.getResponseMessage());
         
         InputStream in = httpConnection.getInputStream();
@@ -804,7 +804,7 @@ public class ClientServerTest extends Ab
         
         assertEquals(200, httpConnection.getResponseCode());
     
-        assertEquals("text/xml; charset=utf-8", httpConnection.getContentType());
+        assertEquals("text/xml;charset=utf-8", httpConnection.getContentType().toLowerCase());
         assertEquals("OK", httpConnection.getResponseMessage());
         
         InputStream in = httpConnection.getInputStream();

Modified: cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java?rev=966858&r1=966857&r2=966858&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java
(original)
+++ cxf/branches/servlet3jetty7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLTest.java
Thu Jul 22 21:09:36 2010
@@ -133,7 +133,7 @@ public class ClientServerXMLTest extends
 
         assertEquals(200, httpConnection.getResponseCode());
 
-        assertEquals("text/xml; charset=utf-8", httpConnection.getContentType());
+        assertEquals("text/xml;charset=utf-8", httpConnection.getContentType().toLowerCase());
         assertEquals("OK", httpConnection.getResponseMessage());
 
         InputStream in = httpConnection.getInputStream();
@@ -274,7 +274,7 @@ public class ClientServerXMLTest extends
             BindingProvider bp = (BindingProvider) greeter;
             Map<String, Object> responseContext = bp.getResponseContext();
             String contentType = (String) responseContext.get(Message.CONTENT_TYPE);
-            assertEquals("text/xml; charset=utf-8", contentType);
+            assertEquals("text/xml;charset=utf-8", contentType.toLowerCase());
             Integer responseCode = (Integer) responseContext.get(Message.RESPONSE_CODE);
             assertEquals(500, responseCode.intValue());
         }

Modified: cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml?rev=966858&r1=966857&r2=966858&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml
(original)
+++ cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml
Thu Jul 22 21:09:36 2010
@@ -48,19 +48,19 @@
       <constructor-arg value="."/>
       <constructor-arg value="/jsunit"/>
     </bean>
-    <bean class="org.eclipse.jetty.handler.ContextHandler">
+    <bean class="org.eclipse.jetty.server.handler.ContextHandler">
      <property name="contextPath" value="/" />
      <property name="handler">
-      <bean class="org.eclipse.jetty.handler.ResourceHandler">
+      <bean class="org.eclipse.jetty.server.handler.ResourceHandler">
        <property name="baseResource">
-        <bean class="org.eclipse.resource.FileResource">
+        <bean class="org.eclipse.jetty.util.resource.FileResource">
          <constructor-arg value="${staticResourceURL}" />
         </bean>
         </property>
       </bean>
      </property>
     </bean>
-    <bean class="org.eclipse.jetty.handler.DefaultHandler"/>
+    <bean class="org.eclipse.jetty.server.handler.DefaultHandler"/>
    </httpj:handlers>
   </httpj:engine>
  </httpj:engine-factory>

Modified: cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/server.xml
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/server.xml?rev=966858&r1=966857&r2=966858&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/server.xml
(original)
+++ cxf/branches/servlet3jetty7/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/server.xml
Thu Jul 22 21:09:36 2010
@@ -26,7 +26,7 @@ http://www.springframework.org/schema/be
   
     <http-jetty:engine-factory bus="cxf">
         <http-jetty:engine port="0">
-	    <http-jetty:threadingParameters minThreads="1" maxThreads="3"/>   
+	       <http-jetty:threadingParameters minThreads="1" maxThreads="3"/>   
         </http-jetty:engine>
     </http-jetty:engine-factory>
 



Mime
View raw message