aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2008-09-15 11:02:18 +0000
committerNick Burch <nick@apache.org>2008-09-15 11:02:18 +0000
commit7bd89bc944ca0a48cd23bdaf52d470c080425330 (patch)
tree87b97af9fc8df17a991ce1ae0885d1971167427a /src/testcases
parentd514f9b689602c73110d5c73b8941829af4c6ec0 (diff)
downloadpoi-7bd89bc944ca0a48cd23bdaf52d470c080425330.tar.gz
poi-7bd89bc944ca0a48cd23bdaf52d470c080425330.zip
Finish exposing the name of Named Cell Styles via HSSFCellStyle (normally held on the parent style though)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@695420 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
index e2783b4434..a4cf005a0c 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
@@ -334,10 +334,28 @@ public class TestCellStyle
assertEquals(23, cs2.getIndex());
assertEquals(24, cs3.getIndex());
+ assertNull(cs1.getParentStyle());
+ assertNotNull(cs2.getParentStyle());
+ assertNotNull(cs3.getParentStyle());
+
+ assertEquals(21, cs2.getParentStyle().getIndex());
+ assertEquals(22, cs3.getParentStyle().getIndex());
+
+ // Now check we can get style records for
+ // the parent ones
+ assertNull(wb.getWorkbook().getStyleRecord(15));
+ assertNull(wb.getWorkbook().getStyleRecord(23));
+ assertNull(wb.getWorkbook().getStyleRecord(24));
+
+ assertNotNull(wb.getWorkbook().getStyleRecord(21));
+ assertNotNull(wb.getWorkbook().getStyleRecord(22));
+
// Now check the style names
-// assertEquals(null, cs1.getUserStyleName());
-// assertEquals("style1", cs2.getUserStyleName());
-// assertEquals("style2", cs3.getUserStyleName());
+ assertEquals(null, cs1.getUserStyleName());
+ assertEquals(null, cs2.getUserStyleName());
+ assertEquals(null, cs3.getUserStyleName());
+ assertEquals("style1", cs2.getParentStyle().getUserStyleName());
+ assertEquals("style2", cs3.getParentStyle().getUserStyleName());
}
public static void main(String [] ignored_args)