Author: wtam
Date: Tue Aug 17 16:49:06 2010
New Revision: 986392

URL: http://svn.apache.org/viewvc?rev=986392&view=rev
Log:
[CAMEL-3055] made CxfMtomDisabledProducerPayloadModeTest more reliable by not 
depending on mailcap setting in the environment

Modified:
    
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomDisabledProducerPayloadModeTest.java

Modified: 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomDisabledProducerPayloadModeTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomDisabledProducerPayloadModeTest.java?rev=986392&r1=986391&r2=986392&view=diff
==============================================================================
--- 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomDisabledProducerPayloadModeTest.java
 (original)
+++ 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomDisabledProducerPayloadModeTest.java
 Tue Aug 17 16:49:06 2010
@@ -142,15 +142,18 @@ public class CxfMtomDisabledProducerPayl
             
             dh = map.get(MtomTestHelper.REQ_IMAGE_CID);
             Assert.assertEquals("image/jpeg", dh.getContentType());
-            Object content = null;
-            try {
-                content = (BufferedImage)dh.getContent();
+
+            BufferedImage bufferedImage = null;
+            try {  
+                bufferedImage = ImageIO.read(dh.getInputStream());
+
             } catch (IOException e) {
                 e.printStackTrace();
             }
-            Assert.assertEquals(41, ((BufferedImage)content).getWidth());
-            Assert.assertEquals(39, ((BufferedImage)content).getHeight());  
-            
+            Assert.assertNotNull(bufferedImage);
+            Assert.assertEquals(41, bufferedImage.getWidth());
+            Assert.assertEquals(39, bufferedImage.getHeight());  
+
             // add output attachments
             map = (Map) 
ctx.getMessageContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS); 
 


Reply via email to