camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r740308 - in /camel/branches/camel-1.x: ./ components/camel-jaxb/ components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ components/camel-jaxb/src/test/java/org/apache/camel/example/
Date Tue, 03 Feb 2009 14:08:03 GMT
Author: davsclaus
Date: Tue Feb  3 14:08:03 2009
New Revision: 740308

URL: http://svn.apache.org/viewvc?rev=740308&view=rev
Log:
Merged revisions 740306 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r740306 | davsclaus | 2009-02-03 15:01:10 +0100 (Tue, 03 Feb 2009) | 1 line
  
  CAMEL-1271: Fixed spring-jaxb should skip StreamCache types in fallback type converter.
........

Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/components/camel-jaxb/pom.xml
    camel/branches/camel-1.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
    camel/branches/camel-1.x/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConverterMessageTypeTest.java

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb  3 14:08:03 2009
@@ -1 +1 @@
-/camel/trunk:739733,739904,740251,740295
+/camel/trunk:739733,739904,740251,740295,740306

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-1.x/components/camel-jaxb/pom.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jaxb/pom.xml?rev=740308&r1=740307&r2=740308&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-jaxb/pom.xml (original)
+++ camel/branches/camel-1.x/components/camel-jaxb/pom.xml Tue Feb  3 14:08:03 2009
@@ -105,4 +105,19 @@
     </dependency>
   </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <forkMode>pertest</forkMode>
+                    <excludes>
+                        <!-- TODO FIXME ASAP -->
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+
+    </build>
+
 </project>

Modified: camel/branches/camel-1.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java?rev=740308&r1=740307&r2=740308&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
(original)
+++ camel/branches/camel-1.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
Tue Feb  3 14:08:03 2009
@@ -16,8 +16,11 @@
  */
 package org.apache.camel.converter.jaxb;
 
-import java.io.*;
-
+import java.io.Closeable;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
@@ -30,6 +33,7 @@
 import org.apache.camel.NoTypeConversionAvailableException;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.TypeConverter;
+import org.apache.camel.converter.stream.StreamCache;
 import org.apache.camel.spi.TypeConverterAware;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.logging.Log;
@@ -61,7 +65,7 @@
                 return unmarshall(type, value);
             }
             if (value != null) {
-                if (isJaxbType(value.getClass())) {
+                if (isJaxbType(value.getClass()) && isNotStreamCacheType(type)) {
                     return marshall(type, value);
                 }
             }
@@ -71,6 +75,10 @@
         }
     }
 
+    private <T> boolean isNotStreamCacheType(Class<T> type) {
+        return !StreamCache.class.isAssignableFrom(type);
+    }
+
     public <T> T convertTo(Class<T> type, Exchange exchange, Object value) {
         return convertTo(type, value);
     }

Modified: camel/branches/camel-1.x/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConverterMessageTypeTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConverterMessageTypeTest.java?rev=740308&r1=740307&r2=740308&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConverterMessageTypeTest.java
(original)
+++ camel/branches/camel-1.x/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConverterMessageTypeTest.java
Tue Feb  3 14:08:03 2009
@@ -31,12 +31,8 @@
     protected TypeConverter converter = context.getTypeConverter();
 
     public void testConverter() throws Exception {
-        // TODO: fails see CAMEL-583
-        /*
         MessageType message = converter.convertTo(MessageType.class, "<message><hello>bar</hello></message>");
-
         assertNotNull("Message should not be null!", message);
-        */
     }
 
 }



Mime
View raw message