abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r564796 - in /incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax: FOMTest.java ParserTest.java
Date Fri, 10 Aug 2007 23:14:38 GMT
Author: jmsnell
Date: Fri Aug 10 16:14:37 2007
New Revision: 564796

URL: http://svn.apache.org/viewvc?view=rev&rev=564796
Log:
Commit https://issues.apache.org/jira/browse/ABDERA-57
"FOMTest & ParserTest fail if there is a space in your directory"

Patch provided by Dan Diephouse. Thanks!

Modified:
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java

Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java?view=diff&rev=564796&r1=564795&r2=564796
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
(original)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
Fri Aug 10 16:14:37 2007
@@ -188,7 +188,7 @@
     URL url = FOMTest.class.getResource("/simple.xml");
     InputStream in = url.openStream();
 
-    Document<Feed> doc = getParser().parse(in, url.toString(), options);
+    Document<Feed> doc = getParser().parse(in, url.toString().replaceAll(" ", "%20"),
options);
     Feed feed = doc.getRoot();
     
     assertEquals(feed.getTitle(),"Example Feed");
@@ -219,7 +219,7 @@
     URL url = FOMTest.class.getResource("/simple.xml");
     InputStream in = url.openStream();
 
-    Document<Feed> doc = getParser().parse(in, url.toString(), options);
+    Document<Feed> doc = getParser().parse(in, url.toString().replaceAll(" ", "%20"),
options);
     Feed feed = doc.getRoot();
     
     assertEquals(feed.getTitle(),"Example Feed");

Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java?view=diff&rev=564796&r1=564795&r2=564796
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java
(original)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java
Fri Aug 10 16:14:37 2007
@@ -58,22 +58,26 @@
 
     InputStream is = ParserTest.class.getResourceAsStream("/simpleFeed.xml");
     Document<Feed> feedDoc = getParser().parse(new InputStreamReader(is), 
-        ParserTest.class.getResource("/simpleEntry.xml").toExternalForm());
+        getResourceName("/simpleEntry.xml"));
     assertTrue(feedDoc.getRoot() instanceof Feed);
     assertEquals(feedDoc.getCharset(), "utf-8");
 
     is = ParserTest.class.getResourceAsStream("/simpleEntry.xml");
     Document<Entry> entryDoc = getParser().parse(new InputStreamReader(is),
-        ParserTest.class.getResource("/simpleEntry.xml").toExternalForm());
+        getResourceName("/simpleEntry.xml"));
     assertTrue(entryDoc.getRoot() instanceof Entry);
     assertEquals(entryDoc.getCharset(), "utf-8");
 
     is = ParserTest.class.getResourceAsStream("/simpleService.xml");
     Document<Service> serviceDoc = getParser().parse(new InputStreamReader(is),
-        ParserTest.class.getResource("/simpleEntry.xml").toExternalForm());
+        getResourceName("/simpleEntry.xml"));
     assertTrue(serviceDoc.getRoot() instanceof Service);
     assertEquals(serviceDoc.getCharset(), "utf-8");
     
+  }
+
+  private static String getResourceName(String name) {
+    return ParserTest.class.getResource(name).toExternalForm().replaceAll(" ", "%20");
   }
   
   /**



Mime
View raw message