Here's a patch that gets the tests up and running via ant.  Basically
just adds a few little TestSuite classes, and tweaks build.xml to copy
the test resources from the correct location (they were moved
recently) and to run the new test suites.

-garrett

[[[
Get the tests running via ant.

* build/build.xml
 Add new properties, parser.test.java and parser.test.resources.
 (test): Run new test suites.
 (build): Copy test resources from the correct location.

* core/src/test/java/org/apache/abdera/test/core/TestSuite.java: New suite.

* parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java: Ditto.
]]]
Index: build/build.xml
===================================================================
--- build/build.xml     (revision 415130)
+++ build/build.xml     (working copy)
@@ -24,7 +24,9 @@
   <property name="core.jar" 
value="${dist}/${ant.project.name}.core.${version}.jar" />
   <property name="parser" value="${basedir}/parser" />
   <property name="parser.src" value="${parser}/src/main/java" />
-  <property name="parser.test" value="${parser}/src/test/java" />
+  <property name="parser.test" value="${parser}/src/test" />
+  <property name="parser.test.java" value="${parser}/src/test/java" />
+  <property name="parser.test.resources" value="${parser}/src/test/resources" 
/>
   <property name="parser.work" value="${work}/parser" />
   <property name="parser.jar" 
value="${dist}/${ant.project.name}.parser.${version}.jar" />
 
@@ -90,12 +92,12 @@
            destdir="${parser.work}"
            classpathref="jar.dependencies" 
            classpath="${core.work}" />
-       <javac srcdir="${parser.test}"
+       <javac srcdir="${parser.test.java}"
               destdir="${test}"
               classpathref="jar.dependencies"
               classpath="${core.work};${parser.work}" />
        <copy todir="${test}">
-         <fileset dir="${parser.test}">
+         <fileset dir="${parser.test.resources}">
            <include name="*.xml"/>
          </fileset>
        </copy>
@@ -114,9 +116,15 @@
   </target>
   
   <target name="test" depends="build">
-    <!--java classpathref="jar.dependencies" 
+    <echo>Running Core Tests...</echo>
+    <java classpathref="jar.dependencies" 
           classpath="${core.work}:${parser.work}:${server.work}:${test}"
-          classname="org.apache.abdera.test.TestSuite" /-->
+          classname="org.apache.abdera.test.core.TestSuite" />
+
+    <echo>Running Stax Parser Tests...</echo>
+    <java classpathref="jar.dependencies" 
+          classpath="${core.work}:${parser.work}:${server.work}:${test}"
+          classname="org.apache.abdera.test.parser.stax.TestSuite" />
   </target>
 
   <target name="clean">
Index: core/src/test/java/org/apache/abdera/test/core/TestSuite.java
===================================================================
--- core/src/test/java/org/apache/abdera/test/core/TestSuite.java       
(revision 0)
+++ core/src/test/java/org/apache/abdera/test/core/TestSuite.java       
(revision 0)
@@ -0,0 +1,30 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.test.core;
+
+import org.apache.abdera.test.core.CoreTest;
+
+public class TestSuite extends junit.framework.TestSuite {
+  public static void main(String[] args) {
+    junit.textui.TestRunner.run(new TestSuite());
+  }
+
+  public TestSuite() {
+    addTestSuite(CoreTest.class);
+  }
+}
Index: parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java
===================================================================
--- parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java      
(revision 0)
+++ parser/src/test/java/org/apache/abdera/test/parser/stax/TestSuite.java      
(revision 0)
@@ -0,0 +1,38 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.test.parser.stax;
+
+import org.apache.abdera.test.parser.stax.AtomConformanceTest;
+import org.apache.abdera.test.parser.stax.FeedParserTest;
+import org.apache.abdera.test.parser.stax.FeedValidatorTest;
+import org.apache.abdera.test.parser.stax.FOMTest;
+import org.apache.abdera.test.parser.stax.ParserTest;
+
+public class TestSuite extends junit.framework.TestSuite {
+  public static void main(String[] args) {
+    junit.textui.TestRunner.run(new TestSuite());
+  }
+
+  public TestSuite() {
+    addTestSuite(AtomConformanceTest.class);
+    addTestSuite(FeedParserTest.class);
+    addTestSuite(FeedValidatorTest.class);
+    addTestSuite(FOMTest.class);
+    addTestSuite(ParserTest.class);
+  }
+}

Reply via email to