cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ulhasbh...@apache.org
Subject svn commit: r696724 - in /cxf/branches/2.0.x-fixes: ./ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/
Date Thu, 18 Sep 2008 17:20:29 GMT
Author: ulhasbhole
Date: Thu Sep 18 10:20:29 2008
New Revision: 696724

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

................
  r696721 | ulhasbhole | 2008-09-18 18:13:06 +0100 (Thu, 18 Sep 2008) | 9 lines
  
  Merged revisions 696720 via svnmerge from 
  https://svn.eu.apache.org/repos/asf/cxf/trunk
  
  ........
    r696720 | ulhasbhole | 2008-09-18 18:10:28 +0100 (Thu, 18 Sep 2008) | 1 line
    
    * [CXF-1805] Use of Content-Type in JMS Header not in line with JMS specification
  ........
................

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 18 10:20:29 2008
@@ -1,3 +1,3 @@
-/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509,695553,695555,695563,695875-695877,695940,695980,696436
-/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484,695537,695552,695561,695619,695684,695835,695935,695977,696433
+/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509,695553,695555,695563,695875-695877,695940,695980,696436,696721
+/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484,695537,695552,695561,695619,695684,695835,695935,695977,696433,696720
 /incubator/cxf/trunk:434594-651668

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

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java?rev=696724&r1=696723&r2=696724&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
Thu Sep 18 10:20:29 2008
@@ -21,6 +21,7 @@
 
 public final class JMSConstants {
     
+    public static final String JMS_CONTENT_TYPE = "SOAPJMS_contentType";
     public static final String JMS_QUEUE = "queue";
     public static final String JMS_TOPIC = "topic";
 

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java?rev=696724&r1=696723&r2=696724&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
Thu Sep 18 10:20:29 2008
@@ -212,7 +212,9 @@
             props.add(prop);
 
             protHeaders.put(name, Collections.singletonList(val));
-            if (name.equals(org.apache.cxf.message.Message.CONTENT_TYPE) && val !=
null) {
+            if (name.equals(org.apache.cxf.message.Message.CONTENT_TYPE)
+                || name.equals(JMSConstants.JMS_CONTENT_TYPE) 
+                && val != null) {
                 inMessage.put(org.apache.cxf.message.Message.CONTENT_TYPE, val);
             }
 
@@ -237,7 +239,13 @@
                 value.append(s);
                 first = false;
             }
-            message.setStringProperty(entry.getKey(), value.toString());
+            //Incase if the Content-Type header key is Content-Type replace with JMS_Content_Type
+            if (entry.getKey().equals(org.apache.cxf.message.Message.CONTENT_TYPE)) {
+                message.setStringProperty(JMSConstants.JMS_CONTENT_TYPE, value.toString());
+            } else {
+                message.setStringProperty(entry.getKey(), value.toString());    
+            }
+            
         }
     }
 
@@ -255,14 +263,17 @@
         String contentType = (String)message.get(org.apache.cxf.message.Message.CONTENT_TYPE);
 
         Map<String, List<String>> headers = JMSUtils.getSetProtocolHeaders(message);
-        if (headers.get(org.apache.cxf.message.Message.CONTENT_TYPE) == null) {
-            List<String> ct = new ArrayList<String>();
-            ct.add(contentType);
-            headers.put(org.apache.cxf.message.Message.CONTENT_TYPE, ct);
+        List<String> ct;
+        if (headers.get(JMSConstants.JMS_CONTENT_TYPE) != null) {
+            ct = headers.get(JMSConstants.JMS_CONTENT_TYPE);
+        } else if (headers.get(org.apache.cxf.message.Message.CONTENT_TYPE) != null) {
+            ct = headers.get(org.apache.cxf.message.Message.CONTENT_TYPE);
         } else {
-            List<String> ct = headers.get(org.apache.cxf.message.Message.CONTENT_TYPE);
-            ct.add(contentType);
+            ct = new ArrayList<String>();
+            headers.put(JMSConstants.JMS_CONTENT_TYPE, ct);
         }
+        
+        ct.add(contentType);
     }
 
     public static boolean isDestinationStyleQueue(AddressType address) {

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java?rev=696724&r1=696723&r2=696724&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
Thu Sep 18 10:20:29 2008
@@ -389,8 +389,8 @@
         
         assertTrue("property has been excluded, only CONTENT_TYPE should be here", 
                 inHeader.getProperty().size() == 1);
-        assertTrue("property has been excluded, only CONTENT_TYPE should be here", 
-                inHeader.getProperty().get(0).getName().equals(Message.CONTENT_TYPE));
+        assertTrue("property has been excluded, only " + JMSConstants.JMS_CONTENT_TYPE +
"should be here",
+                inHeader.getProperty().get(0).getName().equals(JMSConstants.JMS_CONTENT_TYPE));
 
         // wait for a while for the jms session recycling
         Thread.sleep(1000);



Mime
View raw message