use of org.apache.maven.doxia.document.DocumentCover in project maven-plugins by apache.
the class DocumentModelBuilder method getDocumentCover.
/**
* Extract information for a DocumentCover from a MavenProject.
*
* @param project a MavenProject. May be null.
* @param date the cover date. May be null.
*
* @return a DocumentCover object. Always non-null.
*/
private static DocumentCover getDocumentCover(MavenProject project, Date date) {
final DocumentCover cover = new DocumentCover();
cover.setAuthors(getAuthors(project));
//cover.setCompanyLogo( companyLogo );
cover.setCompanyName(getProjectOrganizationName(project));
cover.setCoverDate(date);
cover.setCoverSubTitle(project == null ? null : "v. " + project.getVersion());
cover.setCoverTitle(getProjectName(project));
//cover.setCoverType( type );
cover.setCoverVersion(project == null ? null : project.getVersion());
//cover.setProjectLogo( projectLogo );
cover.setProjectName(getProjectName(project));
return cover;
}
use of org.apache.maven.doxia.document.DocumentCover 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