abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r431748 - in /incubator/abdera/java/trunk: build/ parser/src/test/java/org/apache/abdera/test/parser/stax/ parser/src/test/resources/
Date Wed, 16 Aug 2006 00:22:23 GMT
Author: jmsnell
Date: Tue Aug 15 17:22:22 2006
New Revision: 431748

URL: http://svn.apache.org/viewvc?rev=431748&view=rev
Log:
Rather than add the feedvalidator tests to our SVN, let's just go out and check them 
out during the build (if they're not already checked out) and run those tests locally.

Modified:
    incubator/abdera/java/trunk/build/build.xml
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedValidatorTest.java
    incubator/abdera/java/trunk/parser/src/test/resources/   (props changed)

Modified: incubator/abdera/java/trunk/build/build.xml
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/build/build.xml?rev=431748&r1=431747&r2=431748&view=diff
==============================================================================
--- incubator/abdera/java/trunk/build/build.xml (original)
+++ incubator/abdera/java/trunk/build/build.xml Tue Aug 15 17:22:22 2006
@@ -113,6 +113,11 @@
 
     <mkdir dir="${test}" />
 
+    <condition property="do.download.feedvalidator.tests">
+      <not>
+        <available file="${parser.test.resources}/feedvalidator.org/testcases/atom" />
+      </not>
+    </condition>
     <condition property="do.download">
       <not>
         <and>
@@ -301,7 +306,7 @@
     </copy>
   </target>
   
-  <target name="test" depends="build">
+  <target name="test" depends="build, download_feedvalidator_tests">
     <echo>Running Core Tests...</echo>
     <java classpathref="jar.dependencies" 
           classpath="${core.work}:${parser.work}:${server.work}:${test}"
@@ -535,5 +540,16 @@
          usetimestamp="true" />
     <unzip src="${basedir}/build/tools/${retroweaver.zip}"
            dest="${basedir}/build/tools/" overwrite="true"/>
+  </target>
+  
+  <target name="download_feedvalidator_tests" 
+    depends="init" if="do.download.feedvalidator.tests" >
+    <mkdir dir="${parser.test.resources}/feedvalidator.org" />
+    <exec 
+      failifexecutionfails="false"
+      dir="${parser.test.resources}/feedvalidator.org" 
+      executable="svn">
+      <arg line="co https://svn.sourceforge.net/svnroot/feedvalidator/trunk/feedvalidator/testcases/atom
testcases/atom" />
+    </exec>
   </target>
 </project>

Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java?rev=431748&r1=431747&r2=431748&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java
(original)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java
Tue Aug 15 17:22:22 2006
@@ -34,7 +34,12 @@
       String path = uriStr.substring(uriStr.indexOf("//") + 1);
       InputStream stream = BaseParserTestCase.class.getResourceAsStream(path);
       return Parser.INSTANCE.parse(stream, uri);
-    } catch (Exception e) {}
+    } catch (Exception e) {
+      // when getting it local fails, fall back to getting it from the server
+      try {
+        return Parser.INSTANCE.parse(uri.toURL().openStream(), uri);
+      } catch (Exception ex) {}
+    }
     return null;
   }
 

Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedValidatorTest.java?rev=431748&r1=431747&r2=431748&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedValidatorTest.java
(original)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedValidatorTest.java
Tue Aug 15 17:22:22 2006
@@ -43,21 +43,18 @@
 import org.apache.abdera.model.Person;
 import org.apache.abdera.model.Source;
 import org.apache.abdera.model.Text;
-import org.apache.abdera.parser.Parser;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 
-
-import junit.framework.TestCase;
-
 public class FeedValidatorTest 
-  extends TestCase {
+  extends BaseParserTestCase { //extends TestCase {
 
   private static URI baseURI = null;
   
   private static <T extends Element> Document<T> get(URI uri) {
     try {
-      return Parser.INSTANCE.parse(uri.toURL().openStream(), uri);
+      //return Parser.INSTANCE.parse(uri.toURL().openStream(), uri);
+      return parse(uri);
     } catch (Exception e) {}
     return null;
   }

Propchange: incubator/abdera/java/trunk/parser/src/test/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 15 17:22:22 2006
@@ -0,0 +1 @@
+feedvalidator.org



Mime
View raw message