You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ni...@apache.org on 2007/12/03 14:31:08 UTC

svn commit: r600528 - in /incubator/cxf/branches/2.0.x-fixes: ./ parent/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/core/src/test/java/org/apache/cxf/bus/extension/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ rt/tra...

Author: ningjiang
Date: Mon Dec  3 05:31:02 2007
New Revision: 600528

URL: http://svn.apache.org/viewvc?rev=600528&view=rev
Log:
Merged revisions 600507 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r600507 | ningjiang | 2007-12-03 20:30:38 +0800 (Mon, 03 Dec 2007) | 2 lines
  
  CXF-1187 CXF-1249 Fixed Several Spring2.5 related issues.
  Added the profile spring2.5 which builds CXF with Spring 2.5
........

Added:
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/MyResourceService.java
      - copied unchanged from r600507, incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/extension/MyResourceService.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/MySetterService.java
      - copied unchanged from r600507, incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/extension/MySetterService.java
Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/parent/pom.xml
    incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/MyService.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
    incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
    incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java
    incubator/cxf/branches/2.0.x-fixes/systests/pom.xml
    incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/servlet/ErrorContextSerletTest.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/parent/pom.xml?rev=600528&r1=600527&r2=600528&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/parent/pom.xml (original)
+++ incubator/cxf/branches/2.0.x-fixes/parent/pom.xml Mon Dec  3 05:31:02 2007
@@ -51,6 +51,7 @@
         <saaj.version>1.3</saaj.version>
         <saaj.impl.version>1.3</saaj.impl.version>
         <spring.version>2.0.6</spring.version>
+        <spring.mock>spring-mock</spring.mock>
         <wsdl4j.version>1.6.1</wsdl4j.version>
         <derby.version>10.2.2.0</derby.version>
         <activemq.version>4.1.1</activemq.version>
@@ -995,7 +996,16 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>spring2.5</id>
+            <properties>
+               <spring.version>2.5</spring.version>
+               <spring.mock>spring-test</spring.mock> 
+            </properties>
+        </profile>
     </profiles>
+
+
 
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/branches/2.0.x-fixes/parent</connection>

Modified: incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java?rev=600528&r1=600527&r2=600528&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java Mon Dec  3 05:31:02 2007
@@ -158,8 +158,7 @@
     public void setBus(Bus bus) {
         this.bus = bus;
     }
-
-    @Resource(name = "activationNamespaces")
+    
     public void setActivationNamespaces(Collection<String> ans) {
         activationNamespaces = ans;
     }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java?rev=600528&r1=600527&r2=600528&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java Mon Dec  3 05:31:02 2007
@@ -77,11 +77,15 @@
     }
     
     @Test
-    public void testActivateViaNS() {        
+    public void testActivateViaNS() {
+        verifyActivateViaNS(MyResourceService.class.getName(), "http://cxf.apache.org/resource");
+        verifyActivateViaNS(MySetterService.class.getName(), "http://cxf.apache.org/setter");
+    }
+    
+    public void verifyActivateViaNS(String extensionClass, String ns) {        
         
         Extension e = new Extension();
-        e.setClassname(MyService.class.getName());
-        String ns = "http://cxf.apache.org/integer";
+        e.setClassname(MyResourceService.class.getName());       
         e.getNamespaces().add(ns);
         e.setDeferred(true);
         manager.processExtension(e);
@@ -96,6 +100,7 @@
         MyService first = myService;
         manager.activateViaNS(ns);
         assertSame(first, myService);
+        myService = null;
     }
     
     public void setMyService(MyService m) {

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/MyService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/MyService.java?rev=600528&r1=600527&r2=600528&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/MyService.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/extension/MyService.java Mon Dec  3 05:31:02 2007
@@ -21,26 +21,10 @@
 
 import java.util.Collection;
 
-import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
 
-public class MyService {
-    @Resource(name = "activationNamespaces")
-    Collection<String> activationNamespaces;
+public interface MyService {
+        
+    Collection<String> getActivationNamespaces();
     
-    @Resource(name = "extensionManagerTest")
-    ExtensionManagerTest extensionManagerTest;
-    
-    
-    public MyService() {
-    }
-    
-    public Collection<String> getActivationNamespaces() {
-        return activationNamespaces;
-    }
-    
-    @PostConstruct
-    void registerMyselfAsExtension() {
-        extensionManagerTest.setMyService(this);
-    }
+    void registerMyselfAsExtension(); 
 }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?rev=600528&r1=600527&r2=600528&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java Mon Dec  3 05:31:02 2007
@@ -57,6 +57,7 @@
 
     @Override
     protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        boolean isAbstract = false;
         NamedNodeMap atts = element.getAttributes();
         String bus = element.getAttribute("bus");
         if (StringUtils.isEmpty(bus)) {
@@ -76,6 +77,7 @@
 
             if ("createdFromAPI".equals(name)) {
                 bean.setAbstract(true);
+                isAbstract = true;
             } else if (isAttribute(pre, name) && !"publish".equals(name) && !"bus".equals(name)) {
                 if ("endpointName".equals(name) || "serviceName".equals(name)) {
                     QName q = parseQName(element, val);
@@ -89,6 +91,7 @@
                 }
             } else if ("abstract".equals(name)) {
                 bean.setAbstract(true);
+                isAbstract = true;
             }
         }
         
@@ -115,10 +118,10 @@
                 }
             }
         }
-
-        bean.setInitMethodName("publish");
-        bean.setDestroyMethodName("stop");
-
+        if (!isAbstract) {
+            bean.setInitMethodName("publish");
+            bean.setDestroyMethodName("stop");
+        }
         // We don't want to delay the registration of our Server
         bean.setLazyInit(false);
     }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java?rev=600528&r1=600527&r2=600528&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java Mon Dec  3 05:31:02 2007
@@ -78,9 +78,7 @@
   
     /**
      * This collection contains "activationNamespaces" which is synominous
-     * with "transportId"s. TransportIds are already part of 
-     * AbstractTransportFactory.
-     * TODO: Change these to "transportIds"?
+     * with "transportId"s. 
      */
     protected Collection<String> activationNamespaces;
 
@@ -102,11 +100,10 @@
     }
 
     /**
-     * This call is used by spring to "inject" the transport ids.
-     * TODO: Change this to "setTransportIds"?
+     * This call is used by CXF ExtensionManager to inject the activationNamespaces
      * @param ans The transport ids.
      */
-    @Resource(name = "activationNamespaces")
+    
     public void setActivationNamespaces(Collection<String> ans) {
         activationNamespaces = ans;
     }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java?rev=600528&r1=600527&r2=600528&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java Mon Dec  3 05:31:02 2007
@@ -72,6 +72,9 @@
         if (null == bus) {
             return;
         }
+        if (activationNamespaces == null) {
+            activationNamespaces = getTransportIds();
+        }
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
         if (null != dfm && null != activationNamespaces) {
             for (String ns : activationNamespaces) {

Modified: incubator/cxf/branches/2.0.x-fixes/systests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/pom.xml?rev=600528&r1=600527&r2=600528&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/systests/pom.xml (original)
+++ incubator/cxf/branches/2.0.x-fixes/systests/pom.xml Mon Dec  3 05:31:02 2007
@@ -350,7 +350,7 @@
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
-            <artifactId>spring-mock</artifactId>
+            <artifactId>${spring.mock}</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>

Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/servlet/ErrorContextSerletTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/servlet/ErrorContextSerletTest.java?rev=600528&r1=600527&r2=600528&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/servlet/ErrorContextSerletTest.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/servlet/ErrorContextSerletTest.java Mon Dec  3 05:31:02 2007
@@ -47,11 +47,12 @@
         try {
             sr = new ServletRunner(getResourceAsStream(getConfiguration()), CONTEXT);
             sr.newClient().getResponse(CONTEXT_URL + "/services");
-            // there expect a class not found exception
-            fail("we expect a CannotLoadBeanClassException here");
+            // there expect a spring bean exception
+            fail("we expect a spring bean Exception here");
         } catch (Exception ex) {
-            assertTrue("we expect a CannotLoadBeanClassException here",
-                      ex instanceof org.springframework.beans.factory.CannotLoadBeanClassException);
+            // supprot spring 2.0.x and sping 2.5
+            assertTrue("we expect a Bean Exception here",
+                      ex instanceof org.springframework.beans.FatalBeanException);
         } 
     }