Author: dandiep
Date: Tue Nov  7 00:06:04 2006
New Revision: 472020

URL: http://svn.apache.org/viewvc?view=rev&rev=472020
Log:
Reenable SpringServletTest. My problem was that I had tested with Spring 1.2.x 
as I was on the plane and that was all I had. Turns out the different spring 
versions use different keys to access the ApplicationContext, so my test failed 
when I changed the POM to Spring 2.0 before committing.

Modified:
    incubator/cxf/trunk/pom.xml
    
incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/ContentTypeOutInterceptor.java
    
incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/wrapped/WrappedServiceTest.java
    
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java

Modified: incubator/cxf/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/pom.xml?view=diff&rev=472020&r1=472019&r2=472020
==============================================================================
--- incubator/cxf/trunk/pom.xml (original)
+++ incubator/cxf/trunk/pom.xml Tue Nov  7 00:06:04 2006
@@ -324,7 +324,6 @@
                         <!-- do not exclude **/Abstract*Test.java 
**/Abstract*TestCase.java -->
                         <excludes>
                             <exclude>**/*$*</exclude>
-                            <exclude>**/SpringServletTest.java</exclude>
                         </excludes>
                         <reportFormat>${surefire.format}</reportFormat>
                         <useFile>${surefire.usefile}</useFile>

Modified: 
incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/ContentTypeOutInterceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/ContentTypeOutInterceptor.java?view=diff&rev=472020&r1=472019&r2=472020
==============================================================================
--- 
incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/ContentTypeOutInterceptor.java
 (original)
+++ 
incubator/cxf/trunk/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/ContentTypeOutInterceptor.java
 Tue Nov  7 00:06:04 2006
@@ -44,7 +44,7 @@
         }
         String ct = (String) message.getContextualProperty("Content-Type");
         if (ct == null) {
-            ct = "application/xml";
+            ct = "text/xml";
         }
         List<String> contentType = new ArrayList<String>();
         contentType.add(ct);

Modified: 
incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/wrapped/WrappedServiceTest.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/wrapped/WrappedServiceTest.java?view=diff&rev=472020&r1=472019&r2=472020
==============================================================================
--- 
incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/wrapped/WrappedServiceTest.java
 (original)
+++ 
incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/wrapped/WrappedServiceTest.java
 Tue Nov  7 00:06:04 2006
@@ -71,7 +71,7 @@
         assertEquals("updateCustomer", bop.getName().getLocalPart());
         
         // TEST POST/GETs
-        
+        Thread.sleep(100000000);
         Document res = get("http://localhost:9001/customers";);
         assertNotNull(res);
         

Modified: 
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java?view=diff&rev=472020&r1=472019&r2=472020
==============================================================================
--- 
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java
 (original)
+++ 
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java
 Tue Nov  7 00:06:04 2006
@@ -89,9 +89,17 @@
             // try to pull an existing ApplicationContext out of the
             // ServletContext
             ServletContext svCtx = getServletContext();
+            
+            // Spring 1.x
             ApplicationContext ctx = (ApplicationContext)svCtx
                 .getAttribute("interface 
org.springframework.web.context.WebApplicationContext.ROOT");
 
+            // Spring 2.0
+            if (ctx == null) {
+                ctx = (ApplicationContext)svCtx
+                    
.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
+            }
+            
             // This constructor works whether there is a context or not
             bus = new SpringBusFactory(ctx).getDefaultBus();
         }


Reply via email to