cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r889074 - in /cxf/branches/2.1.x-fixes: ./ rt/transports/jms/ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/test/resources/ testutils/src/ma...
Date Thu, 10 Dec 2009 03:34:58 GMT
Author: dkulp
Date: Thu Dec 10 03:34:57 2009
New Revision: 889074

URL: http://svn.apache.org/viewvc?rev=889074&view=rev
Log:
Merged revisions 889070 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r889070 | dkulp | 2009-12-09 22:26:21 -0500 (Wed, 09 Dec 2009) | 9 lines
  
  Merged revisions 889065 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r889065 | dkulp | 2009-12-09 22:15:09 -0500 (Wed, 09 Dec 2009) | 1 line
    
    [CXF-2577] Only set creds if it's not already a SingleConnectionFactory
  ........
................

Added:
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/resources/jms_test_jndi.xml
      - copied unchanged from r889070, cxf/branches/2.2.x-fixes/rt/transports/jms/src/test/resources/jms_test_jndi.xml
Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/transports/jms/pom.xml
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
    cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl

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

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/pom.xml?rev=889074&r1=889073&r2=889074&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/pom.xml (original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/pom.xml Thu Dec 10 03:34:57 2009
@@ -86,6 +86,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.xbean</groupId>
+            <artifactId>xbean-spring</artifactId>
+            <version>3.5</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>commons-pool</groupId>
             <artifactId>commons-pool</artifactId>
             <version>1.5.2</version>

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java?rev=889074&r1=889073&r2=889074&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
Thu Dec 10 03:34:57 2009
@@ -32,6 +32,7 @@
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.service.model.EndpointInfo;
+import org.springframework.jms.connection.SingleConnectionFactory;
 import org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter;
 import org.springframework.jms.core.JmsTemplate;
 import org.springframework.jms.core.JmsTemplate102;
@@ -73,12 +74,15 @@
         try {
             ConnectionFactory cf = (ConnectionFactory)jmsConfig.getJndiTemplate().
                 lookup(connectionFactoryName);
-            UserCredentialsConnectionFactoryAdapter uccf = new UserCredentialsConnectionFactoryAdapter();
-            uccf.setUsername(userName);
-            uccf.setPassword(password);
-            uccf.setTargetConnectionFactory(cf);
+            if (!(cf instanceof SingleConnectionFactory)) {
+                UserCredentialsConnectionFactoryAdapter uccf = new UserCredentialsConnectionFactoryAdapter();
+                uccf.setUsername(userName);
+                uccf.setPassword(password);
+                uccf.setTargetConnectionFactory(cf);
+                cf = uccf;
+            }
             
-            return uccf;
+            return cf;
         } catch (NamingException e) {
             throw new RuntimeException(e);
         }

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java?rev=889074&r1=889073&r2=889074&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
Thu Dec 10 03:34:57 2009
@@ -545,4 +545,19 @@
         destination.shutdown();
     }
 
+    @Test
+    public void testGetSpringSingleConnectionFactoryFromWSDL() throws Exception {
+        setupServiceInfo("http://cxf.apache.org/hello_world_jms", "/wsdl/jms_test.wsdl",
+                         "HelloWorldServiceSpringICF", "HelloWorldPortSpringICF");
+        final JMSDestination destination = setupJMSDestination(true);
+        // set up the conduit send to be true
+        JMSConduit conduit = setupJMSConduit(true, false);
+        final Message outMessage = new MessageImpl();
+        setupMessageHeader(outMessage, null);
+        sendoutMessage(conduit, outMessage, true);
+        waitForReceiveDestMessage();
+        conduit.close();
+        destination.shutdown();
+    }
+
 }

Modified: cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl?rev=889074&r1=889073&r2=889074&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl (original)
+++ cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl Thu Dec 10 03:34:57
2009
@@ -583,6 +583,20 @@
         </port>
     </service>
 
+    <service name="HelloWorldServiceSpringICF">
+           <port binding="tns:HelloWorldPortBinding" name="HelloWorldPortSpringICF">
+               <jms:clientConfig useConduitIdSelector="false"/>
+               <jms:address
+                   jndiConnectionFactoryName="ConnectionFactory" 
+                   jmsDestinationName="dynamicQueues/test.jmstransport.text">
+                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.xbean.spring.jndi.SpringInitialContextFactory"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="classpath:/jms_test_jndi.xml"/>
+               </jms:address>
+            
+               <jms:server durableSubscriberName="CXF_subscriber"/>
+           </port>
+    </service>        
+
 </definitions>
 
 



Mime
View raw message