Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ private void writeFieldsTable(XMLWriter w, List<ModelField> fields, boolean elem

w.writeMarkup(getDescription(f));

if (f.isRequired()) {
w.writeMarkup("<p><strong>Required</strong>: Yes.</p>");
}

// Write the default value, if it exists.
// But only for fields that are not a ModelAssociation
if (f.getDefaultValue() != null && !(f instanceof ModelAssociation)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ private void checkMavenXdocGenerator() throws Exception {

// verify( "org.codehaus.modello.generator.xml.cdoc.XdocVerifier", "xdoc" );
checkInternalLinks("maven.xml");

String content = FileUtils.fileRead(new File(getOutputDirectory(), "maven.xml"), "UTF-8");

Pattern requiredModelVersion =
Pattern.compile("<code>modelVersion</code>.*?<strong>Required</strong>: Yes\\.", Pattern.DOTALL);
assertTrue(requiredModelVersion.matcher(content).find(), "Required modelVersion field should be documented");

Pattern requiredGroupId =
Pattern.compile("<code>groupId</code>.*?<strong>Required</strong>: Yes\\.", Pattern.DOTALL);
assertTrue(requiredGroupId.matcher(content).find(), "Required groupId field should be documented");
}

public void checkFeaturesXdocGenerator() throws Exception {
Expand Down