aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2009-08-19 18:51:44 +0000
committerYegor Kozlov <yegor@apache.org>2009-08-19 18:51:44 +0000
commit8b283b14b10c01f6b7247555ac0098258d7f0164 (patch)
treec5186589a87b7e5c49b3394a6d750a8c09e1b686 /src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
parentbb7b42c1265efe711303c4f38b25bc0a1eb92247 (diff)
downloadpoi-8b283b14b10c01f6b7247555ac0098258d7f0164.tar.gz
poi-8b283b14b10c01f6b7247555ac0098258d7f0164.zip
Centralize logic for finding/opening sample files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@805928 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java')
-rw-r--r--src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
index f02135afac..12405fb4a7 100644
--- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
+++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
@@ -22,6 +22,7 @@ import java.math.BigInteger;
import junit.framework.TestCase;
import org.apache.poi.POIXMLDocument;
+import org.apache.poi.xwpf.XWPFTestDataSamples;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTInd;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTJc;
@@ -41,26 +42,13 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTextAlignment;
* Tests for XWPF Paragraphs
*/
public final class TestXWPFParagraph extends TestCase {
- /**
- * A simple file
- */
- private XWPFDocument xml;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- File file = new File(
- System.getProperty("HWPF.testdata.path") +
- File.separator + "ThreeColHead.docx"
- );
- assertTrue(file.exists());
- xml = new XWPFDocument(POIXMLDocument.openPackage(file.toString()));
- }
/**
* Check that we get the right paragraph from the header
*/
public void disabled_testHeaderParagraph() {
+ XWPFDocument xml = XWPFTestDataSamples.openSampleDocument("ThreeColHead.docx");
+
XWPFHeader hdr = xml.getHeaderFooterPolicy().getDefaultHeader();
assertNotNull(hdr);
@@ -77,6 +65,7 @@ public final class TestXWPFParagraph extends TestCase {
* Check that we get the right paragraphs from the document
*/
public void disabled_testDocumentParagraph() {
+ XWPFDocument xml = XWPFTestDataSamples.openSampleDocument("ThreeColHead.docx");
XWPFParagraph[] ps = xml.getParagraphs();
assertEquals(10, ps.length);