diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-05-18 14:00:11 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-05-18 14:00:11 +0000 |
commit | f16ef429a49fa9ab4520e28d470d76c58967792b (patch) | |
tree | 17bc1934004f9ceb5d641d13514e109b924486fd /test/java | |
parent | eb1ad60936a14f46c93fd97e64fc62a8c3d9d4e2 (diff) | |
download | xmlgraphics-fop-f16ef429a49fa9ab4520e28d470d76c58967792b.tar.gz xmlgraphics-fop-f16ef429a49fa9ab4520e28d470d76c58967792b.zip |
Bugzilla #39607:
Bugfix for NPE in RTF library.
Submitted by: Julien Aymé <julien.ayme.at.gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@407553 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
3 files changed, 107 insertions, 0 deletions
diff --git a/test/java/org/apache/fop/StandardTestSuite.java b/test/java/org/apache/fop/StandardTestSuite.java index ee3c5add8..28d960446 100644 --- a/test/java/org/apache/fop/StandardTestSuite.java +++ b/test/java/org/apache/fop/StandardTestSuite.java @@ -19,6 +19,7 @@ package org.apache.fop; import org.apache.fop.render.pdf.PDFAConformanceTestCase; +import org.apache.fop.render.rtf.RichTextFormatTestSuite; import junit.framework.Test; import junit.framework.TestSuite; @@ -39,6 +40,7 @@ public class StandardTestSuite { suite.addTest(BasicDriverTestSuite.suite()); suite.addTest(UtilityCodeTestSuite.suite()); suite.addTest(new TestSuite(PDFAConformanceTestCase.class)); + suite.addTest(RichTextFormatTestSuite.suite()); //$JUnit-END$ return suite; } diff --git a/test/java/org/apache/fop/render/rtf/Bug39607TestCase.java b/test/java/org/apache/fop/render/rtf/Bug39607TestCase.java new file mode 100644 index 000000000..9c853735a --- /dev/null +++ b/test/java/org/apache/fop/render/rtf/Bug39607TestCase.java @@ -0,0 +1,64 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed 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. + */ + +/* $Id$ */ + +package org.apache.fop.render.rtf; + +import java.io.StringWriter; + +import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfDocumentArea; +import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFile; +import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph; +import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection; +import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable; +import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow; + +import junit.framework.TestCase; + +/** + * Test for http://issues.apache.org/bugzilla/show_bug.cgi?id=39607 + */ +public class Bug39607TestCase extends TestCase { + + /** + * Test for the NPE describes in bug 39607 + * @throws Exception If an error occurs + */ + public void testForNPE() throws Exception { + StringWriter writer = new StringWriter(); + RtfFile f = new RtfFile(writer); + + RtfDocumentArea doc = f.startDocumentArea(); + + RtfSection section = doc.newSection(); + + RtfParagraph paragraph = section.newParagraph(); + paragraph.newText("Testing fop - rtf module - class RtfTableRow"); + paragraph.close(); + + RtfTable table = section.newTable(null); + RtfTableRow row = table.newTableRow(); + row.newTableCell(2000).newParagraph().newText("blah"); + row.newTableCell(5000).newParagraph().newText("doubleBlah"); + row.close(); + table.close(); + section.close(); + doc.close(); + f.flush(); + } + +} diff --git a/test/java/org/apache/fop/render/rtf/RichTextFormatTestSuite.java b/test/java/org/apache/fop/render/rtf/RichTextFormatTestSuite.java new file mode 100644 index 000000000..5f90a403c --- /dev/null +++ b/test/java/org/apache/fop/render/rtf/RichTextFormatTestSuite.java @@ -0,0 +1,41 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed 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. + */ + +/* $Id$ */ + +package org.apache.fop.render.rtf; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * Test suite for FOP's RTF library. + */ +public class RichTextFormatTestSuite { + + /** + * Builds the test suite + * @return the test suite + */ + public static Test suite() { + TestSuite suite = new TestSuite( + "Test suite for RTF library"); + //$JUnit-BEGIN$ + suite.addTest(new TestSuite(Bug39607TestCase.class)); + //$JUnit-END$ + return suite; + } +} |