ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1697780 - in /webservices/axiom/trunk/implementations/fom-impl: pom.xml src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
Date Tue, 25 Aug 2015 22:37:55 GMT
Author: veithen
Date: Tue Aug 25 22:37:54 2015
New Revision: 1697780

URL: http://svn.apache.org/r1697780
Log:
Use StringReader instead of ByteArrayInputStream to parse XML from strings.

Modified:
    webservices/axiom/trunk/implementations/fom-impl/pom.xml
    webservices/axiom/trunk/implementations/fom-impl/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java

Modified: webservices/axiom/trunk/implementations/fom-impl/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/pom.xml?rev=1697780&r1=1697779&r2=1697780&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/pom.xml (original)
+++ webservices/axiom/trunk/implementations/fom-impl/pom.xml Tue Aug 25 22:37:54 2015
@@ -61,6 +61,11 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>

Modified: webservices/axiom/trunk/implementations/fom-impl/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java?rev=1697780&r1=1697779&r2=1697780&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
Tue Aug 25 22:37:54 2015
@@ -26,6 +26,7 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.OutputStreamWriter;
+import java.io.StringReader;
 import java.net.URL;
 import java.util.Calendar;
 import java.util.Date;
@@ -734,10 +735,9 @@ public class FOMTest {
     @Test
     public void testContentClone() throws Exception {
         String s = "<entry xmlns='http://www.w3.org/2005/Atom'><content type='html'>test</content></entry>";
-        ByteArrayInputStream in = new ByteArrayInputStream(s.getBytes());
         Abdera abdera = new Abdera();
         Parser parser = abdera.getParser();
-        Document<Entry> doc = parser.parse(in);
+        Document<Entry> doc = parser.parse(new StringReader(s));
         Entry entry = (Entry)(doc.getRoot().clone());
         assertEquals(Content.Type.HTML, entry.getContentType());
     }
@@ -769,7 +769,7 @@ public class FOMTest {
         Abdera abdera = new Abdera();
 
         Entry entry = abdera.newEntry();
-        Document<Element> foodoc = abdera.getParser().parse(new ByteArrayInputStream("<a><b><c/></b></a>".getBytes()));
+        Document<Element> foodoc = abdera.getParser().parse(new StringReader("<a><b><c/></b></a>"));
         Element foo = foodoc.getRoot();
         entry.setContent(foo, "application/foo+xml");
         assertEquals(foo, entry.getContentElement().getValueElement());



Mime
View raw message