diff options
author | Yegor Kozlov <yegor@apache.org> | 2012-01-19 08:09:26 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2012-01-19 08:09:26 +0000 |
commit | 2de8e3793566b4e9640012968910fac528020ad9 (patch) | |
tree | aac911856d04bf3ab8e922ae456a87050bd4fe98 /src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java | |
parent | 013ba86bb066ec9ddc30caa90c616baac5ffaa4b (diff) | |
download | poi-2de8e3793566b4e9640012968910fac528020ad9.tar.gz poi-2de8e3793566b4e9640012968910fac528020ad9.zip |
more XSLF tests to ensure that poi-ooxml-schemas.jar contains all used classes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1233242 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java index 989b237f82..50d4c812b5 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java @@ -219,7 +219,79 @@ public class TestXSLFTextParagraph extends TestCase { XSLFTextShape sh3 = (XSLFTextShape)shapes[2];
assertEquals("Foundation", sh3.getText());
assertEquals(TextAlign.CENTER, sh3.getTextParagraphs().get(0).getTextAlign());
+ }
+ public void testParagraphProperties(){
+ XMLSlideShow ppt = new XMLSlideShow();
+ XSLFSlide slide = ppt.createSlide();
+ XSLFTextShape sh = slide.createAutoShape();
+ XSLFTextParagraph p = sh.addNewTextParagraph();
+ assertFalse(p.isBullet());
+ p.setBullet(true);
+ assertTrue(p.isBullet());
+
+ assertEquals("\u2022", p.getBulletCharacter());
+ p.setBulletCharacter("*");
+ assertEquals("*", p.getBulletCharacter());
+
+ assertEquals("Arial", p.getBulletFont());
+ p.setBulletFont("Calibri");
+ assertEquals("Calibri", p.getBulletFont());
+
+ assertEquals(null, p.getBulletFontColor());
+ p.setBulletFontColor(Color.red);
+ assertEquals(Color.red, p.getBulletFontColor());
+
+ assertEquals(100.0, p.getBulletFontSize());
+ p.setBulletFontSize(200.);
+ assertEquals(200., p.getBulletFontSize());
+ p.setBulletFontSize(-20.);
+ assertEquals(-20.0, p.getBulletFontSize());
+
+ assertEquals(72.0, p.getDefaultTabSize());
+
+ assertEquals(0.0, p.getIndent());
+ p.setIndent(72.0);
+ assertEquals(72.0, p.getIndent());
+ p.setIndent(-1.0); // the value of -1.0 resets to the defaults
+ assertEquals(0.0, p.getIndent());
+
+ assertEquals(0.0, p.getLeftMargin());
+ p.setLeftMargin(72.0);
+ assertEquals(72.0, p.getLeftMargin());
+ p.setLeftMargin(-1.0); // the value of -1.0 resets to the defaults
+ assertEquals(0.0, p.getLeftMargin());
+
+ assertEquals(0, p.getLevel());
+ p.setLevel(1);
+ assertEquals(1, p.getLevel());
+ p.setLevel(2);
+ assertEquals(2, p.getLevel());
+
+ assertEquals(100., p.getLineSpacing());
+ p.setLineSpacing(200.);
+ assertEquals(200.0, p.getLineSpacing());
+ p.setLineSpacing(-15.);
+ assertEquals(-15.0, p.getLineSpacing());
+
+ assertEquals(0., p.getSpaceAfter());
+ p.setSpaceAfter(200.);
+ assertEquals(200.0, p.getSpaceAfter());
+ p.setSpaceAfter(-15.);
+ assertEquals(-15.0, p.getSpaceAfter());
+
+ assertEquals(0., p.getSpaceBefore());
+ p.setSpaceBefore(200.);
+ assertEquals(200.0, p.getSpaceBefore());
+ p.setSpaceBefore(-15.);
+ assertEquals(-15.0, p.getSpaceBefore());
+
+ assertEquals(TextAlign.LEFT, p.getTextAlign());
+ p.setTextAlign(TextAlign.RIGHT);
+ assertEquals(TextAlign.RIGHT, p.getTextAlign());
+
+ p.setBullet(false);
+ assertFalse(p.isBullet());
}
}
|