abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject svn commit: r538542 - /incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
Date Wed, 16 May 2007 11:37:48 GMT
Author: ugo
Date: Wed May 16 04:37:45 2007
New Revision: 538542

URL: http://svn.apache.org/viewvc?view=rev&rev=538542
Log:
Testcase for ABDERA-47

Modified:
    incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java

Modified: incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java?view=diff&rev=538542&r1=538541&r2=538542
==============================================================================
--- incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
(original)
+++ incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
Wed May 16 04:37:45 2007
@@ -19,7 +19,10 @@
 
 import java.util.Date;
 
+import org.apache.abdera.Abdera;
 import org.apache.abdera.model.AtomDate;
+import org.apache.abdera.model.Content;
+import org.apache.abdera.model.Entry;
 import org.apache.abdera.util.AbderaConfiguration;
 import org.apache.abdera.util.URIHelper;
 
@@ -70,5 +73,20 @@
     atomNow = AtomDate.valueOf(rfc3339);
     Date parsed = atomNow.getDate();
     assertEquals(now, parsed);
+  }
+  
+  public void testAbderaEncodingHandling() throws Exception {
+      Abdera abdera = new Abdera();
+      Entry entry = abdera.newEntry();
+      entry.setId("http://example.com/entry/1");
+      entry.setTitle("Whatever");
+      entry.setUpdated(new Date());
+      Content content = entry.getFactory().newContent(Content.Type.XML);
+      String s = "<x>" + new Character((char) 224) + "</x>";
+      content.setValue(s);
+      content.setMimeType("application/xml+whatever");
+      entry.setContentElement(content);
+      assertNotNull(entry.getContent());
+      assertEquals(s, entry.getContent());
   }
 }



Mime
View raw message