servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r722023 - in /servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src: main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java
Date Mon, 01 Dec 2008 10:03:36 GMT
Author: gnodet
Date: Mon Dec  1 02:03:30 2008
New Revision: 722023

URL: http://svn.apache.org/viewvc?rev=722023&view=rev
Log:
SM-1697: new smx-jms marshaler throws exception attempting to copy property JbiConstants.DATESTAMP_PROPERTY_NAME
from NMR to JMS

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java?rev=722023&r1=722022&r2=722023&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java
Mon Dec  1 02:03:30 2008
@@ -16,7 +16,6 @@
  */
 package org.apache.servicemix.jms.endpoints;
 
-import java.util.Date;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Set;
@@ -110,8 +109,11 @@
      * @return true if it should be copied
      */
     private boolean shouldIncludeHeader(String name, Object value) {
-        return (value instanceof String || value instanceof Number || value instanceof Date)
-               && (!isNeedJavaIdentifiers() || isJavaIdentifier(name));
+        boolean allowed = value instanceof Boolean || value instanceof Byte || value instanceof
Short;
+        allowed |= value instanceof Integer || value instanceof Long || value instanceof
Float;
+        allowed |= value instanceof Double || value instanceof String;
+        allowed &= !isNeedJavaIdentifiers() || isJavaIdentifier(name);
+        return allowed;
     }
 
     /**

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java?rev=722023&r1=722022&r2=722023&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-jms/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java
Mon Dec  1 02:03:30 2008
@@ -17,6 +17,7 @@
 package org.apache.servicemix.jms;
 
 import java.io.ByteArrayOutputStream;
+import java.util.Calendar;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -31,6 +32,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.activemq.pool.PooledConnectionFactory;
+import org.apache.servicemix.JbiConstants;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.jbi.jaxp.StringSource;
 import org.apache.servicemix.jbi.util.FileUtil;
@@ -57,6 +59,7 @@
         NormalizedMessage inMessage = me.getInMessage();
         inMessage.setProperty(MSG_PROPERTY, "Test-Value");
         inMessage.setProperty(MSG_PROPERTY_BLACKLISTED, "Unwanted value");
+        inMessage.setProperty(JbiConstants.DATESTAMP_PROPERTY_NAME, Calendar.getInstance().getTime());
         inMessage.setContent(new StringSource("<hello>world</hello>"));
         me.setService(new QName("jms"));
         client.sendSync(me);
@@ -65,6 +68,8 @@
         Message msg = jmsTemplate.receive("destination");
         assertNull("Found not expected property", msg.getStringProperty(MSG_PROPERTY));
         assertNull("Found blacklisted property", msg.getStringProperty(MSG_PROPERTY_BLACKLISTED));
+        assertNull("Found " + JbiConstants.DATESTAMP_PROPERTY_NAME + " property", 
+            msg.getObjectProperty(JbiConstants.DATESTAMP_PROPERTY_NAME));
         assertNotNull(msg);
     }
 



Mime
View raw message