Browse Source

Enabled fotree junit tests.



git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@280298 13f79535-47bb-0310-9956-ffa450edef68
pull/31/head
Finn Bock 18 years ago
parent
commit
1788fd470c

+ 27
- 1
build.xml View File

@@ -188,6 +188,7 @@ list of possible build targets.
<property name="build.property.examples.mime.type" value="application/pdf"/>

<property name="layoutengine.disabled" value="test/layoutengine/disabled-testcases.txt"/>
<property name="fotree.disabled" value="test/fotree/disabled-testcases.txt"/>

<property name="dist.bin.dir" value="${basedir}/dist-bin"/>
<property name="dist.src.dir" value="${basedir}/dist-src"/>
@@ -579,7 +580,7 @@ list of possible build targets.
<!-- =================================================================== -->
<!-- Testing -->
<!-- =================================================================== -->
<target name="junit" depends="package, transcoder-pkg" description="Runs FOP's JUnit tests" if="junit.present">
<target name="junit-compile" depends="package, transcoder-pkg" description="Runs FOP's JUnit tests" if="junit.present">
<mkdir dir="${build.dir}/test-classes"/>
<javac destdir="${build.dir}/test-classes" fork="javac.fork"
debug="${javac.debug}" deprecation="${javac.deprecation}"
@@ -593,6 +594,9 @@ list of possible build targets.
</fileset>
</classpath>
</javac>
</target>

<target name="junit" depends="junit-compile" description="Runs FOP's JUnit tests" if="junit.present">
<echo message="Running basic functionality tests for fop-transcoder.jar"/>
<mkdir dir="${build.dir}/test-reports/fop-transcoder"/>
<junit haltonerror="yes" fork="${junit.fork}">
@@ -683,6 +687,28 @@ list of possible build targets.
</junit>
</target>

<target name="junit-fotree" depends="junit-compile" description="Runs FOP's FO tree JUnit tests" if="junit.present">
<echo message="Running fo tree tests"/>
<junit haltonerror="yes" fork="${junit.fork}">
<sysproperty key="basedir" value="${basedir}"/>
<sysproperty key="jawa.awt.headless" value="true"/>
<sysproperty key="fop.layoutengine.disabled" value="${fotree.disabled}"/>
<formatter type="brief" usefile="false"/>
<classpath>
<pathelement location="${build.dir}/test-classes"/>
<path refid="libs-build-classpath"/>
<fileset dir="build">
<include name="fop.jar"/>
</fileset>
</classpath>
<batchtest todir="${build.dir}/test-reports/fop">
<fileset dir="${build.dir}/test-classes">
<include name="org/apache/fop/fotreetest/FOTreeTestSuite.class"/>
</fileset>
</batchtest>
</junit>
</target>

<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->

+ 1
- 0
test/fotree/disabled-testcases.txt View File

@@ -0,0 +1 @@
demo-test-failure.fo

+ 1
- 0
test/java/org/apache/fop/fotreetest/FOTreeTestSuite.java View File

@@ -95,6 +95,7 @@ public final class FOTreeTestSuite {
final FOTreeTester tester, final File f) {
suite.addTest(new FOTreeTestCase(f.getName()) {
public void runTest() throws Exception {
org.apache.commons.logging.LogFactory.getLog(this.getClass()).info("Starting " + f.getName());
prepare(tester, f);
testMain();
}

+ 3
- 0
test/java/org/apache/fop/fotreetest/FOTreeTester.java View File

@@ -31,6 +31,8 @@ import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.fo.Constants;

import org.apache.fop.fotreetest.ext.TestElementMapping;

/**
* Test driver class for FO tree tests.
*/
@@ -56,6 +58,7 @@ public class FOTreeTester {
FOUserAgent ua = new FOUserAgent();
ua.setBaseURL(testFile.getParentFile().toURL().toString());
ua.setFOEventHandlerOverride(new DummyFOEventHandler(ua));
ua.addElementMapping(new TestElementMapping());
Fop fop = new Fop(Constants.RENDER_XML, ua);
SAXResult fores = new SAXResult(fop.getDefaultHandler());

+ 1
- 1
test/java/org/apache/fop/fotreetest/ext/AssertElement.java View File

@@ -48,7 +48,7 @@ public class AssertElement extends TestObj {
Locator locator,
Attributes attlist,
PropertyList propertyList) throws FOPException {
super.processNode(elementName, locator, attlist, propertyList);
//super.processNode(elementName, locator, attlist, propertyList);

ResultCollector collector = ResultCollector.getInstance();
String propName = attlist.getValue("property");

Loading…
Cancel
Save