nick 2005/08/14 12:27:45
Modified: src/scratchpad/testcases/org/apache/poi/hslf/record
TestStyleTextPropAtom.java
Log:
Add a few more tests
Revision Changes Path
1.4 +38 -0
jakarta-poi/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java
Index: TestStyleTextPropAtom.java
===================================================================
RCS file:
/home/cvs/jakarta-poi/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestStyleTextPropAtom.java 14 Aug 2005 17:52:43 -0000 1.3
+++ TestStyleTextPropAtom.java 14 Aug 2005 19:27:45 -0000 1.4
@@ -113,6 +113,44 @@
assertEquals(25, b_ch_3.getCharactersCovered());
}
+
+ public void testCharacterPropOrdering() throws Exception {
+ StyleTextPropAtom stpb = new
StyleTextPropAtom(data_b,0,data_b.length);
+ stpb.setParentTextSize(data_b_text_len);
+
+ LinkedList b_ch_l = stpb.getCharacterStyles();
+ TextPropCollection b_ch_2 = (TextPropCollection)b_ch_l.get(1);
+ LinkedList b_ch2_tp = b_ch_2.getTextPropList();
+
+ // First item should be a CharFlagsTextProp
+ TextProp tp = (TextProp)b_ch2_tp.get(0);
+ assertEquals(true, b_ch2_tp.get(0) instanceof
CharFlagsTextProp);
+ }
+
+
+ public void testCharacterProps() throws Exception {
+ StyleTextPropAtom stpb = new
StyleTextPropAtom(data_b,0,data_b.length);
+ stpb.setParentTextSize(data_b_text_len);
+
+ LinkedList b_ch_l = stpb.getCharacterStyles();
+ TextPropCollection b_ch_1 = (TextPropCollection)b_ch_l.get(0);
+ TextPropCollection b_ch_2 = (TextPropCollection)b_ch_l.get(1);
+ TextPropCollection b_ch_3 = (TextPropCollection)b_ch_l.get(2);
+
+ // 1st is bold
+ CharFlagsTextProp cf_1_1 =
(CharFlagsTextProp)b_ch_1.getTextPropList().get(0);
+
//assertEquals(true,cf_1_1.getSubValue(CharFlagsTextProp.BOLD_IDX));
+
+ // 2nd is italic
+ CharFlagsTextProp cf_2_1 =
(CharFlagsTextProp)b_ch_2.getTextPropList().get(0);
+
//assertEquals(true,cf_1_1.getSubValue(CharFlagsTextProp.ITALIC_IDX));
+
+ // 3rd is normal
+ //CharFlagsTextProp cf_3_1 =
(CharFlagsTextProp)b_ch_3.getTextPropList().get(0);
+
+ }
+
+
public void testWrite() throws Exception {
StyleTextPropAtom stpa = new
StyleTextPropAtom(data_a,0,data_a.length);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/