xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Pepping <spepp...@leverkruid.eu>
Subject Re: running fop tests
Date Sat, 17 Sep 2011 17:48:43 GMT
I constructed an ant target junit-jar-main, which depends on a
selection of junit tests which are relevant for fop.jar. I made the
following modifications to the build file:

Index: build.xml
===================================================================
--- build.xml	(revision 963413)
+++ build.xml	(working copy)
@@ -116,24 +116,36 @@
     <include name="fop.js"/>
     <include name="fop"/>
   </fileset>
+  <property name="java-share" value="/usr/share/java"/>
   <path id="libs-build-classpath">
-    <fileset dir="${basedir}/lib">
-      <include name="*.jar"/>
-    </fileset>
+	<pathelement location="${java-share}/avalon-framework.jar"/>
+	<pathelement location="${java-share}/batik-all.jar"/>
+	<pathelement location="${java-share}/commons-io.jar"/>
+	<pathelement location="${java-share}/commons-logging.jar"/>
+	<pathelement location="${java-share}/serializer.jar"/>
+	<pathelement location="${java-share}/servlet-api.jar"/>
+	<pathelement location="${java-share}/xalan2.jar"/>
+	<pathelement location="${java-share}/xercesImpl.jar"/>
+	<pathelement location="${java-share}/xml-apis.jar"/>
+	<pathelement location="${java-share}/xml-apis-ext.jar"/>
+	<pathelement location="${java-share}/xmlgraphics-commons.jar"/>
   </path>
   <property name="lib-tools" value="${basedir}/lib/build"/>
   <path id="libs-tools-build-classpath">
     <path refid="libs-build-classpath"/>
-    <fileset dir="${lib-tools}">
-      <include name="*.jar"/>
-    </fileset>
+	<!-- <pathelement location="${lib-tools}/asm-3.1.jar.jar"/> -->
+	<!-- <pathelement location="${lib-tools}/asm-commons-3.1.jar"/> -->
+	<!-- <pathelement location="${lib-tools}/backport-util-concurrent-3.1.jar"/> -->
+	<!-- <pathelement location="${lib-tools}/jaxen-1.1.1.jar"/> -->
+	<!-- <pathelement location="${lib-tools}/pmd-4.2.5.jar"/> -->
+	<pathelement location="${java-share}/qdox.jar"/>
+	<!-- <pathelement location="${lib-tools}/retroweaver-2.0.6-patched.jar"/> -->
+	<!-- <pathelement location="${lib-tools}/retroweaver-rt-2.0.6-patched.jar"/> -->
+	<pathelement location="${java-share}/xmlunit.jar"/>
   </path>
   <path id="libs-run-classpath">
     <path refid="libs-build-classpath"/>
-    <fileset dir="${basedir}/build">
-      <include name="fop.jar"/>
-      <include name="fop-hyph.jar"/>
-    </fileset>
+	<pathelement location="${java-share}/fop.jar"/>
   </path>
   <patternset id="exclude-jai">
     <exclude name="org/apache/fop/util/bitmap/JAIMonochromeBitmapConverter.java" unless="jai.present"/>
@@ -985,6 +997,18 @@
     <echo>All Junit tests passed!</echo>
     <echo>Use the "junit-reports" target to generate HTML test reports</echo>
   </target>
+  <target name="junit-jar-main" depends="junit-userconfig, junit-basic, junit-text-linebreak,
junit-layout-standard, junit-area-tree-xml-format, junit-intermediate-format" description="Runs
FOP's JUnit tests for the main jar file" if="junit.present">
+    <fail><condition><or><isset property="fop.junit.error"/><isset
property="fop.junit.failure"/></or></condition>
+NOTE:
+**************************************************************************
+* One or more of the Junit tests had Failures or Errors or were skipped! *
+*         Please check the output above for relevant messages.           *
+*    Or use the "junit-reports" target to generate HTML test reports.    *
+**************************************************************************
+    </fail>
+    <echo>All Junit tests for the main jar file passed!</echo>
+    <echo>Use the "junit-reports" target to generate HTML test reports</echo>
+  </target>
 <!-- haven't made this dependent on "junit" as that would rerun all tests -->
   <target name="junit-reports" description="Generates HTML test reports">
     <mkdir dir="${junit.html.reports.dir}"/>

In the first part I modify the class paths, as described on the wiki
page. In the second part I define a target junit-jar-main.

I built fop.jar and ran the tests successfully in a fop source directory.

Best, Simon

On Sat, Sep 17, 2011 at 12:28:52PM +0200, Simon Pepping wrote:
> Re junit tests: ant junit runs many tests which are not related to
> fop.jar. Other jar files such as sandbox and transcoder are built, and
> irrelevant tests are run.
> 
> The following tests are relevant to the functioning of fop.jar:
> 
> junit-basic                 Runs FOP's JUnit basic tests
> junit-intermediate-format   Runs FOP's intermediate format JUnit tests
> junit-layout-standard       Runs FOP's standard JUnit layout tests
> junit-text-linebreak        Runs FOP's JUnit unicode linebreak tests
> junit-userconfig            Runs FOP's user config JUnit tests
> junit-area-tree-xml-format
> junit-render-pdf
> 
> The following test is irrelevant:
> junit-transcoder
> 
> The following test cannot be run without hyphenation patterns, and
> causes the junit target to report failure:
> junit-layout-hyphenation
> 
> Note that only the target junit reports success or failure; other
> junit targets report success even if the test reports failure.
> 
> One could construct a test junit-package which only includes tests
> relevant to fop.jar.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message