//page.setOdfAttribute( OdfName.newName( OdfNamespace.newName(OdfDocumentNamespace.DRAW), "master-page-name" ), "Default" );
page.setDrawNameAttribute("page1");
page.setDrawStyleNameAttribute("dp1");
page.setDrawMasterPageNameAttribute("Default");
DrawLineElement line = page.newDrawLineElement("6cm", "10cm", "15cm", "20cm");
//line.setOdfAttribute( OdfName.newName( OdfNamespace.newName(OdfDocumentNamespace.DRAW), "style-name" ), "gr1" );
//line.setOdfAttribute( OdfName.newName( OdfNamespace.newName(OdfDocumentNamespace.DRAW), "text-style-name" ), "P1" );
//line.setOdfAttribute( OdfName.newName( OdfNamespace.newName(OdfDocumentNamespace.DRAW), "layer" ), "layout" );
line.setDrawStyleNameAttribute("gr1");
line.setDrawTextStyleNameAttribute("P1");
line.setDrawLayerAttribute("layer");
XPath xpath = contentDom.getXPath();
DrawPageElement graphicTest = (DrawPageElement) xpath.evaluate("//draw:page[last()]", contentDom, XPathConstants.NODE);
Assert.assertNotNull(graphicTest.getChildNodes());
Assert.assertTrue(graphicTest.getChildNodes().item(0) instanceof DrawLineElement);