use of org.apache.maven.doxia.document.DocumentMeta in project maven-plugins by apache.
the class DocumentModelBuilder method getDocumentMeta.
/**
* Extract meta information from a MavenProject.
*
* @param project a MavenProject. May be null.
* @param date the date to use in meta. May be null.
*
* @return a DocumentMeta object. Always non-null.
*/
private static DocumentMeta getDocumentMeta(MavenProject project, Date date) {
final DocumentMeta meta = new DocumentMeta();
meta.setAuthors(getAuthors(project));
meta.setCreationDate(date);
meta.setCreator(System.getProperty("user.name"));
meta.setDate(date);
meta.setDescription(project == null ? null : project.getDescription());
// meta.setGenerator( generator );
meta.setInitialCreator(System.getProperty("user.name"));
// meta.setLanguage( locale == null ? null : locale.getLanguage() );
// meta.setPageSize( pageSize );
meta.setSubject(getProjectName(project));
meta.setTitle(getProjectName(project));
return meta;
}
use of org.apache.maven.doxia.document.DocumentMeta in project maven-plugins by apache.
the class DocumentModelBuilderTest method testGetDocumentModel.
/**
* Test of getDocumentModel method, of class DocumentModelBuilder.
*/
public void testGetDocumentModel() {
DocumentModel model = new DocumentModelBuilder(new ModelBuilderMavenProjectStub()).getDocumentModel();
assertEquals("ISO-8859-1", model.getModelEncoding());
assertEquals("Test ArtifactId", model.getOutputName());
DocumentCover cover = model.getCover();
assertEquals("Test Version", cover.getCoverVersion());
assertEquals("Test Name", cover.getProjectName());
assertEquals("Test Name", cover.getCoverTitle());
assertEquals("v. Test Version", cover.getCoverSubTitle());
assertEquals("Test Organization", cover.getCompanyName());
assertEquals(2, cover.getAuthors().size());
assertFirstDocumentAuthor(cover.getAuthors().get(0));
DocumentMeta meta = model.getMeta();
assertEquals("Test Description", meta.getDescription());
assertEquals(2, meta.getAuthors().size());
assertFirstDocumentAuthor(meta.getAuthors().get(0));
assertEquals("Test Name", meta.getSubject());
assertEquals("Test Name", meta.getTitle());
DocumentTOC toc = model.getToc();
assertEquals(0, toc.getItems().size());
}
Aggregations