Author: veithen
Date: Wed Feb 16 11:32:45 2011
New Revision: 1071211

URL: http://svn.apache.org/viewvc?rev=1071211&view=rev
Log:
Added a couple of assertions to PartOnFileTest so that we can debug the problem 
reported by Amila Maha Arachchi on [email protected].

Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java?rev=1071211&r1=1071210&r2=1071211&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/PartOnFileTest.java
 Wed Feb 16 11:32:45 2011
@@ -23,6 +23,7 @@ import org.apache.axiom.om.AbstractTestC
 import org.apache.axiom.om.TestConstants;
 
 import javax.activation.DataHandler;
+import javax.activation.DataSource;
 import javax.activation.FileDataSource;
 import java.io.File;
 import java.io.InputStream;
@@ -52,18 +53,18 @@ public class PartOnFileTest extends Abst
         Attachments attachments =
                 new Attachments(inStream, 
TestConstants.MTOM_MESSAGE_CONTENT_TYPE, true, temp.getPath(), "1");
 
-        DataHandler p = attachments
+        DataHandler dh = attachments
                 
.getDataHandler("1.urn:uuid:[email protected]");
+        
+        assertNotNull(dh);
 
-        if (!(p.getDataSource() instanceof FileDataSource)) {
-            fail("Expected PartOnFile");
+        DataSource ds = dh.getDataSource();
+        assertNotNull(ds);
+        if (!(ds instanceof FileDataSource)) {
+            fail("Expected FileDataSource, but got " + 
ds.getClass().getName());
         }
 
-//             
assertEquals("<1.urn:uuid:[email protected]>", 
p.getContentID());
-        assertEquals("image/jpeg", p.getContentType());
-
-//             p.addHeader("Some-New-Header", "TestNH");
-//             assertEquals(p.getHeader("Some-New-Header"), "TestNH");
+        assertEquals("image/jpeg", dh.getContentType());
     }
 
     public void testGetAllheaders() throws Exception {


Reply via email to