camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r800307 - in /camel/trunk/components/camel-jms/src: main/java/org/apache/camel/component/jms/DefaultJmsKeyFormatStrategy.java test/java/org/apache/camel/component/jms/DefaultJmsHeaderKeyFormatStrategyTest.java
Date Mon, 03 Aug 2009 11:16:16 GMT
Author: davsclaus
Date: Mon Aug  3 11:16:15 2009
New Revision: 800307

URL: http://svn.apache.org/viewvc?rev=800307&view=rev
Log:
CAMEL-1871: Camel preserves JMS keys using underscore as it will replace dots with _DOT_ instead
of just _

Modified:
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/DefaultJmsKeyFormatStrategy.java
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/DefaultJmsHeaderKeyFormatStrategyTest.java

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/DefaultJmsKeyFormatStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/DefaultJmsKeyFormatStrategy.java?rev=800307&r1=800306&r2=800307&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/DefaultJmsKeyFormatStrategy.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/DefaultJmsKeyFormatStrategy.java
Mon Aug  3 11:16:15 2009
@@ -26,14 +26,14 @@
 public class DefaultJmsKeyFormatStrategy implements JmsKeyFormatStrategy {
 
     public String encodeKey(String key) {
-        String answer = key.replace(".", "_");
+        String answer = key.replace(".", "_DOT_");
         answer = answer.replaceAll("-", "_HYPHEN_");
         return answer;
     }
 
     public String decodeKey(String key) {
         String answer = key.replaceAll("_HYPHEN_", "-");
-        answer = answer.replace("_", ".");
+        answer = answer.replace("_DOT_", ".");
         return answer;
     }
 

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/DefaultJmsHeaderKeyFormatStrategyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/DefaultJmsHeaderKeyFormatStrategyTest.java?rev=800307&r1=800306&r2=800307&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/DefaultJmsHeaderKeyFormatStrategyTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/DefaultJmsHeaderKeyFormatStrategyTest.java
Mon Aug  3 11:16:15 2009
@@ -19,7 +19,6 @@
 import org.junit.Assert;
 import org.junit.Test;
 
-
 /**
  * @version $Revision$
  */
@@ -32,9 +31,9 @@
         assertEquals("foo", strategy.encodeKey("foo"));
         assertEquals("foo123bar", strategy.encodeKey("foo123bar"));
         assertEquals("CamelFileName", strategy.encodeKey("CamelFileName"));
-        assertEquals("org_apache_camel_MyBean", strategy.encodeKey("org.apache.camel.MyBean"));
+        assertEquals("org_DOT_apache_DOT_camel_DOT_MyBean", strategy.encodeKey("org.apache.camel.MyBean"));
         assertEquals("Content_HYPHEN_Type", strategy.encodeKey("Content-Type"));
-        assertEquals("My_HYPHEN_Header_You", strategy.encodeKey("My-Header.You"));
+        assertEquals("My_HYPHEN_Header_DOT_You", strategy.encodeKey("My-Header.You"));
     }
 
     @Test
@@ -43,7 +42,8 @@
         assertEquals("foo123bar", strategy.decodeKey("foo123bar"));
         assertEquals("CamelFileName", strategy.decodeKey("CamelFileName"));
         assertEquals("Content-Type", strategy.decodeKey("Content_HYPHEN_Type"));
-        assertEquals("My-Header.You", strategy.decodeKey("My_HYPHEN_Header_You"));
+        assertEquals("My-Header.You", strategy.decodeKey("My_HYPHEN_Header_DOT_You"));
+        assertEquals("org.apache.camel.MyBean", strategy.decodeKey("org_DOT_apache_DOT_camel_DOT_MyBean"));
     }
 
 }



Mime
View raw message