abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ckopp...@apache.org
Subject svn commit: r1052465 - in /abdera/java/trunk/parser/src/test: java/org/apache/abdera/test/parser/stax/FOMDivTest.java java/org/apache/abdera/test/parser/stax/TestSuite.java resources/utf8characters.xml
Date Fri, 24 Dec 2010 09:10:12 GMT
Author: ckoppelt
Date: Fri Dec 24 09:10:12 2010
New Revision: 1052465

URL: http://svn.apache.org/viewvc?rev=1052465&view=rev
Log:
added unit test for ABDERA-251 and and ABDERA-243

Added:
    abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMDivTest.java
    abdera/java/trunk/parser/src/test/resources/utf8characters.xml
Removed:
    abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java

Added: abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMDivTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMDivTest.java?rev=1052465&view=auto
==============================================================================
--- abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMDivTest.java
(added)
+++ abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMDivTest.java
Fri Dec 24 09:10:12 2010
@@ -0,0 +1,28 @@
+package org.apache.abdera.test.parser.stax;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+
+import org.apache.abdera.Abdera;
+import org.apache.abdera.model.Document;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Text;
+import org.junit.Test;
+
+public class FOMDivTest {
+    
+    @Test
+    public void getInternalValueWithUtf8Characters (){
+        Abdera abdera = new Abdera ();
+        InputStream in = FOMTest.class.getResourceAsStream("/utf8characters.xml");
+        Document<Entry> doc = abdera.getParser().parse(in);
+        Entry entry = doc.getRoot();
+
+        assertEquals("Item", entry.getTitle());
+        assertEquals(Text.Type.TEXT, entry.getTitleType());
+        String value = entry.getContentElement().getValue();
+        assertTrue(value.contains("Ȁȁ"));
+    }
+}

Added: abdera/java/trunk/parser/src/test/resources/utf8characters.xml
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/test/resources/utf8characters.xml?rev=1052465&view=auto
==============================================================================
--- abdera/java/trunk/parser/src/test/resources/utf8characters.xml (added)
+++ abdera/java/trunk/parser/src/test/resources/utf8characters.xml Fri Dec 24 09:10:12 2010
@@ -0,0 +1,9 @@
+<?xml version="1.0" ?>
+<entry xmlns="http://www.w3.org/2005/Atom"> 
+   <title>Item</title>
+   <content type="xhtml" xmlns:xhtml = "http://www.w3.org/1999/xhtml" >
+		<xhtml:div>
+			<p>This is simple XHTML &#x200;&#x201; contained within a xhtml:div tag.</p>
+		</xhtml:div>
+	</content>
+</entry>
\ No newline at end of file



Mime
View raw message