[FOray-commit] SF.net SVN: foray: [9211] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-04-18 21:14:39
|
Revision: 9211
http://svn.sourceforge.net/foray/?rev=9211&view=rev
Author: victormote
Date: 2007-04-18 14:14:41 -0700 (Wed, 18 Apr 2007)
Log Message:
-----------
Fix and use two more test files.
Modified Paths:
--------------
trunk/foray/foray-app/src/javatest/org/foray/app/TestInvalidXml.java
trunk/foray/resource/test/fo/invalid-fo-001.fo
trunk/foray/resource/test/fo/invalid-ns-001.fo
Modified: trunk/foray/foray-app/src/javatest/org/foray/app/TestInvalidXml.java
===================================================================
--- trunk/foray/foray-app/src/javatest/org/foray/app/TestInvalidXml.java 2007-04-18 21:07:43 UTC (rev 9210)
+++ trunk/foray/foray-app/src/javatest/org/foray/app/TestInvalidXml.java 2007-04-18 21:14:41 UTC (rev 9211)
@@ -41,7 +41,7 @@
* Test of fo/invalid-xml-001.fo.
* @throws FOrayException For errors creating the FO Tree.
*/
- public void testDocument001() throws FOrayException {
+ public void testXml001() throws FOrayException {
final FoDocumentReader reader = FoDocumentReader.getInstance();
try {
reader.buildFoTree("fo/invalid-xml-001.fo");
@@ -55,7 +55,7 @@
* Test of fo/invalid-xml-002.fo.
* @throws FOrayException For errors creating the FO Tree.
*/
- public void testDocument002() throws FOrayException {
+ public void testXml002() throws FOrayException {
final FoDocumentReader reader = FoDocumentReader.getInstance();
try {
reader.buildFoTree("fo/invalid-xml-002.fo");
@@ -69,7 +69,7 @@
* Test of fo/invalid-xml-003.fo.
* @throws FOrayException For errors creating the FO Tree.
*/
- public void testDocument003() throws FOrayException {
+ public void testXml003() throws FOrayException {
final FoDocumentReader reader = FoDocumentReader.getInstance();
try {
reader.buildFoTree("fo/invalid-xml-003.fo");
@@ -79,4 +79,34 @@
}
}
+ /**
+ * Test of fo/invalid-ns-001.fo, which contains an unregistered namespace.
+ * @throws FOrayException For errors creating the FO Tree.
+ */
+ public void testNamespace001() throws FOrayException {
+ final FoDocumentReader reader = FoDocumentReader.getInstance();
+ try {
+ reader.buildFoTree("fo/invalid-ns-001.fo");
+ fail("Expected FOrayException indicating an unregistered "
+ + "namespace.");
+ } catch (final FOrayException e) {
+ /* Do nothing. This is the expected case. */
+ }
+ }
+
+ /**
+ * Test of fo/invalid-fo-001.fo, which has no root element.
+ * @throws FOrayException For errors creating the FO Tree.
+ */
+ public void testFo001() throws FOrayException {
+ final FoDocumentReader reader = FoDocumentReader.getInstance();
+ try {
+ reader.buildFoTree("fo/invalid-fo-001.fo");
+ fail("Expected FOrayException indicating that the root element "
+ + "is missing.");
+ } catch (final FOrayException e) {
+ /* Do nothing. This is the expected case. */
+ }
+ }
+
}
Modified: trunk/foray/resource/test/fo/invalid-fo-001.fo
===================================================================
--- trunk/foray/resource/test/fo/invalid-fo-001.fo 2007-04-18 21:07:43 UTC (rev 9210)
+++ trunk/foray/resource/test/fo/invalid-fo-001.fo 2007-04-18 21:14:41 UTC (rev 9211)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- defines page layout -->
- <fo:layout-master-set>
+ <fo:layout-master-set xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:simple-page-master master-name="first"
page-height="29.7cm" page-width="21cm"
margin-top="1cm"
Modified: trunk/foray/resource/test/fo/invalid-ns-001.fo
===================================================================
--- trunk/foray/resource/test/fo/invalid-ns-001.fo 2007-04-18 21:07:43 UTC (rev 9210)
+++ trunk/foray/resource/test/fo/invalid-ns-001.fo 2007-04-18 21:14:41 UTC (rev 9211)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<fo:root source-document="a" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master
margin-right="1.5cm"
@@ -16,9 +16,9 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="first">
- <fo:flow source-document="a" flow-name="xsl-region-body">
+ <fo:flow flow-name="xsl-region-body">
- <fo:block source-document="inherit" space-before.optimum="3pt" space-after.optimum="15pt">
+ <fo:block space-before.optimum="3pt" space-after.optimum="15pt">
The Counter Extension
</fo:block>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|