@Test
public void testStylesDom() {
try {
OdfDocument odfdoc = OdfDocument.loadDocument(ResourceUtilities.getAbsolutePath(TEST_FILE));
OdfStylesDom stylesDom = odfdoc.getStylesDom();
Assert.assertNotNull(stylesDom);
// test styles.xml:styles
OdfOfficeStyles styles = odfdoc.getDocumentStyles();
Assert.assertNotNull(styles);
Assert.assertNotNull(styles.getDefaultStyle(OdfStyleFamily.Graphic));
Assert.assertNotNull(styles.getDefaultStyle(OdfStyleFamily.Paragraph));
Assert.assertNotNull(styles.getDefaultStyle(OdfStyleFamily.Table));
Assert.assertNotNull(styles.getDefaultStyle(OdfStyleFamily.TableRow));
OdfStyle style = styles.getStyle("Standard", OdfStyleFamily.Paragraph);
Assert.assertNotNull(style);
Assert.assertEquals(style.getStyleClassAttribute(), "text");
style = styles.getStyle("List", OdfStyleFamily.Paragraph);
Assert.assertNotNull(style);
Assert.assertEquals(style.getProperty(StyleTextPropertiesElement.FontNameComplex), "Tahoma1");
Assert.assertTrue(style.hasProperty(StyleTextPropertiesElement.FontNameComplex));
Assert.assertFalse(style.hasProperty(StyleTextPropertiesElement.FontNameAsian));
Assert.assertNull(styles.getStyle("foobar", OdfStyleFamily.Chart));
// test styles.xml:automatic-styles
OdfOfficeAutomaticStyles autostyles = stylesDom.getAutomaticStyles();
Assert.assertNotNull(autostyles);
OdfStylePageLayout pageLayout = autostyles.getPageLayout("pm1");
Assert.assertNotNull(pageLayout);
Assert.assertEquals(pageLayout.getProperty(StylePageLayoutPropertiesElement.PageWidth), "8.5in");