abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1372029 [2/17] - in /abdera/java/trunk: ./ parser/src/test/java/org/apache/abdera/test/parser/stax/ parser/src/test/resources/ parser/src/test/resources/feedvalidator.org/ parser/src/test/resources/feedvalidator.org/testcases/ parser/src/t...
Date Sat, 11 Aug 2012 21:15:47 GMT

Modified: abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java?rev=1372029&r1=1372028&r2=1372029&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java
(original)
+++ abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java
Sat Aug 11 21:15:23 2012
@@ -33,20 +33,11 @@ public abstract class BaseParserTestCase
         return abdera.getParser();
     }
 
-    protected static <T extends Element> Document<T> parse(IRI uri) {
-        try {
-            String uriStr = uri.toString();
-            String path = uriStr.substring(uriStr.indexOf("//") + 1);
-            InputStream stream = BaseParserTestCase.class.getResourceAsStream(path);
-            return getParser().parse(stream, uri.toString());
-        } catch (Exception e) {
-            // when getting it local fails, fall back to getting it from the server
-            try {
-                return getParser().parse(uri.toURL().openStream(), uri.toString());
-            } catch (Exception ex) {
-            }
-        }
-        return null;
+    protected static <T extends Element> Document<T> parse(IRI uri) throws Exception
{
+        String uriStr = uri.toString();
+        String path = uriStr.substring(uriStr.indexOf("//") + 1);
+        InputStream stream = BaseParserTestCase.class.getResourceAsStream(path);
+        return getParser().parse(stream, uri.toString());
     }
 
 }



Mime
View raw message