use of org.codehaus.plexus.util.xml.XMLWriter in project maven-plugins by apache.
the class DoapUtilTest method testWriteRdfResourceElement.
/**
* Test method for {@link DoapUtil#writeRdfResourceElement(XMLWriter, String, String)}.
*
* @throws Exception if any
*/
public void testWriteRdfResourceElement() throws Exception {
StringWriter w = new StringWriter();
XMLWriter writer = new PrettyPrintXMLWriter(w);
DoapUtil.writeRdfResourceElement(writer, null, "name", "value");
w.close();
assertEquals(w.toString(), "<name " + DoapUtil.RDF_RESOURCE + "=\"value\"/>");
w = new StringWriter();
writer = new PrettyPrintXMLWriter(w);
try {
DoapUtil.writeRdfResourceElement(writer, null, null, null);
assertTrue("Null not catched", false);
} catch (IllegalArgumentException e) {
assertTrue("IllegalArgumentException catched", true);
} finally {
w.close();
}
}
use of org.codehaus.plexus.util.xml.XMLWriter in project maven-plugins by apache.
the class ApplicationXmlWriter method initializeRootElementSix.
private XMLWriter initializeRootElementSix(Writer w) {
XMLWriter writer = initializeXmlWriter(w, null);
writer.startElement(APPLICATION_ELEMENT);
writer.addAttribute("xmlns", "http://java.sun.com/xml/ns/javaee");
writer.addAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
writer.addAttribute("xsi:schemaLocation", "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd");
writer.addAttribute("version", "6");
return writer;
}
use of org.codehaus.plexus.util.xml.XMLWriter in project maven-plugins by apache.
the class ApplicationXmlWriter method initializeRootElementOneDotFour.
private XMLWriter initializeRootElementOneDotFour(Writer w) {
XMLWriter writer = initializeXmlWriter(w, null);
writer.startElement(APPLICATION_ELEMENT);
writer.addAttribute("xmlns", "http://java.sun.com/xml/ns/j2ee");
writer.addAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
writer.addAttribute("xsi:schemaLocation", "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd");
writer.addAttribute("version", "1.4");
return writer;
}
use of org.codehaus.plexus.util.xml.XMLWriter in project maven-plugins by apache.
the class ApplicationXmlWriter method initializeRootElementOneDotThree.
private XMLWriter initializeRootElementOneDotThree(Writer w) {
XMLWriter writer = initializeXmlWriter(w, DOCTYPE_1_3);
writer.startElement(APPLICATION_ELEMENT);
return writer;
}
use of org.codehaus.plexus.util.xml.XMLWriter in project maven-plugins by apache.
the class ApplicationXmlWriter method initializeRootElementSeven.
private XMLWriter initializeRootElementSeven(Writer w) {
XMLWriter writer = initializeXmlWriter(w, null);
writer.startElement(APPLICATION_ELEMENT);
writer.addAttribute("xmlns", "http://xmlns.jcp.org/xml/ns/javaee");
writer.addAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
// CHECKSTYLE_OFF: LineLength
writer.addAttribute("xsi:schemaLocation", "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd");
// CHECKSTYLE_ON: LineLength
writer.addAttribute("version", "7");
return writer;
}
Aggregations