You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2016/05/08 16:29:41 UTC
svn commit: r1742834 -
/webservices/axiom/trunk/aspects/core-aspects/src/test/java/org/apache/axiom/core/stream/serializer/SerializerTest.java
Author: veithen
Date: Sun May 8 16:29:41 2016
New Revision: 1742834
URL: http://svn.apache.org/viewvc?rev=1742834&view=rev
Log:
Add test cases.
Modified:
webservices/axiom/trunk/aspects/core-aspects/src/test/java/org/apache/axiom/core/stream/serializer/SerializerTest.java
Modified: webservices/axiom/trunk/aspects/core-aspects/src/test/java/org/apache/axiom/core/stream/serializer/SerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/test/java/org/apache/axiom/core/stream/serializer/SerializerTest.java?rev=1742834&r1=1742833&r2=1742834&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/test/java/org/apache/axiom/core/stream/serializer/SerializerTest.java (original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/test/java/org/apache/axiom/core/stream/serializer/SerializerTest.java Sun May 8 16:29:41 2016
@@ -23,6 +23,7 @@ import static com.google.common.truth.Tr
import java.io.ByteArrayOutputStream;
import java.io.StringWriter;
+import org.apache.commons.io.output.NullOutputStream;
import org.junit.Test;
public class SerializerTest {
@@ -52,4 +53,26 @@ public class SerializerTest {
handler.completed();
assertThat(new String(baos.toByteArray(), "iso-8859-15")).isEqualTo("<test>aΣ\u20AC</test>");
}
+
+ @Test
+ // TODO: this should throw an exception
+ public void testUnmappableCharacterInComment() throws Exception {
+ SerializerXmlHandler handler = new SerializerXmlHandler(new NullOutputStream(), "iso-8859-1");
+ handler.startFragment();
+ handler.startComment();
+ handler.processCharacterData("\u20AC", false);
+ handler.endComment();
+ handler.completed();
+ }
+
+ @Test
+ // TODO: this must throw an exception!
+ public void testUnmappableCharacterInName() throws Exception {
+ SerializerXmlHandler handler = new SerializerXmlHandler(new NullOutputStream(), "iso-8859-15");
+ handler.startFragment();
+ handler.startElement("", "\u0370", "");
+ handler.attributesCompleted();
+ handler.endElement();
+ handler.completed();
+ }
}