servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r722022 - in /servicemix/components/bindings/servicemix-jms/trunk/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:15 GMT
Author: gnodet
Date: Mon Dec  1 02:03:10 2008
New Revision: 722022

URL: http://svn.apache.org/viewvc?rev=722022&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/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java
    servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java

Modified: servicemix/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java?rev=722022&r1=722021&r2=722022&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java
(original)
+++ servicemix/components/bindings/servicemix-jms/trunk/src/main/java/org/apache/servicemix/jms/endpoints/AbstractJmsMarshaler.java
Mon Dec  1 02:03:10 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;
@@ -118,7 +117,9 @@
      * @return true if it should be copied
      */
     protected boolean shouldIncludeHeader(String name, Object value) {
-        return (value instanceof String || value instanceof Number || value instanceof Date)
+        return (value instanceof Boolean || value instanceof Byte || value instanceof Short
+                || value instanceof Integer || value instanceof Long || value instanceof
Float
+                || value instanceof Double || value instanceof String)
                && (!isNeedJavaIdentifiers() || isJavaIdentifier(name));
     }
 

Modified: servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java?rev=722022&r1=722021&r2=722022&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java
(original)
+++ servicemix/components/bindings/servicemix-jms/trunk/src/test/java/org/apache/servicemix/jms/JmsProviderEndpointTest.java
Mon Dec  1 02:03:10 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.common.JbiConstants;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.jbi.jaxp.StringSource;
 import org.apache.servicemix.jbi.util.FileUtil;
@@ -77,6 +79,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);
@@ -86,7 +89,9 @@
         assertNotNull("Expected property not found", msg
             .getStringProperty(MSG_PROPERTY));
         assertNull("Found blacklisted property", msg
-                   .getStringProperty(MSG_PROPERTY_BLACKLISTED));
+            .getStringProperty(MSG_PROPERTY_BLACKLISTED));
+        assertNull("Found " + JbiConstants.DATESTAMP_PROPERTY_NAME + " property", msg
+            .getObjectProperty(JbiConstants.DATESTAMP_PROPERTY_NAME));
         assertNotNull(msg);
     }
     



Mime
View raw message