repositoryConverter.convert( artifact, targetRepository, reportingDatabase );
assertEquals( "check no errors", 0, reportingDatabase.getNumFailures() );
assertEquals( "check number of warnings", 2, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) );
assertTrue( "Check artifact created", artifactFile.exists() );
Artifact artifact = createArtifact( "test", "noPomArtifact", "1.0.0" );
repositoryConverter.convert( artifact, targetRepository, reportingDatabase );
assertEquals( "check no errors", 0, reportingDatabase.getNumFailures() );
- assertEquals( "check no warnings", 1, reportingDatabase.getNumWarnings() );
+ assertEquals( "check warnings", 1, reportingDatabase.getNumWarnings() );
assertEquals( "check warning message", getI18nString( "warning.missing.pom" ), getWarning().getReason() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) );
assertTrue( "Check artifact created", artifactFile.exists() );
repositoryConverter.convert( artifacts, targetRepository, reportingDatabase );
assertEquals( "check no errors", 0, reportingDatabase.getNumFailures() );
assertEquals( "check no warnings", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
for ( Iterator i = artifacts.iterator(); i.hasNext(); )
{
{
assertEquals( "check no errors", 0, reportingDatabase.getNumFailures() );
assertEquals( "check no warnings", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
}
private void checkFailure()
{
assertEquals( "check num errors", 1, reportingDatabase.getNumFailures() );
assertEquals( "check no warnings", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
}
private String getI18nString( String key )
private Map filteredDatabases = new HashMap();
+ private int numNotices;
+
public ReportingDatabase( ReportGroup reportGroup )
{
this( reportGroup, new Reporting() );
}
}
+ public void addNotice( Artifact artifact, String processor, String problem, String reason )
+ {
+ ArtifactResults results = getArtifactResults( artifact );
+ results.addNotice( createResult( processor, problem, reason ) );
+ numNotices++;
+ updateTimings();
+
+ if ( filteredDatabases.containsKey( problem ) )
+ {
+ ReportingDatabase reportingDatabase = (ReportingDatabase) filteredDatabases.get( problem );
+
+ reportingDatabase.addNotice( artifact, processor, problem, reason );
+ }
+ }
+
public void addWarning( Artifact artifact, String processor, String problem, String reason )
{
ArtifactResults results = getArtifactResults( artifact );
numFailures += result.getFailures().size();
numWarnings += result.getWarnings().size();
+ numNotices += result.getNotices().size();
}
artifactMap = map;
}
}
}
+ public void addNotice( RepositoryMetadata metadata, String processor, String problem, String reason )
+ {
+ MetadataResults results = getMetadataResults( metadata, System.currentTimeMillis() );
+ if ( !metadataWithProblems.contains( results ) )
+ {
+ metadataWithProblems.add( results );
+ }
+ results.addNotice( createResult( processor, problem, reason ) );
+ numNotices++;
+ updateTimings();
+
+ if ( filteredDatabases.containsKey( problem ) )
+ {
+ ReportingDatabase reportingDatabase = (ReportingDatabase) filteredDatabases.get( problem );
+
+ reportingDatabase.addNotice( metadata, processor, problem, reason );
+ }
+ }
+
public Set getMetadataWithProblems()
{
return metadataWithProblems;
numFailures += result.getFailures().size();
numWarnings += result.getWarnings().size();
+ numNotices += result.getNotices().size();
- if ( !result.getFailures().isEmpty() || !result.getWarnings().isEmpty() )
+ if ( !result.getFailures().isEmpty() || !result.getWarnings().isEmpty() || !result.getNotices().isEmpty() )
{
problems.add( result );
}
numWarnings -= results.getWarnings().size();
results.getWarnings().clear();
+ numNotices -= results.getWarnings().size();
+ results.getNotices().clear();
+
metadataWithProblems.remove( results );
}
numFailures -= results.getFailures().size();
numWarnings -= results.getWarnings().size();
+ numNotices -= results.getNotices().size();
map.remove( key );
}
{
// clear the values rather than destroy the instance so that the "inProgress" indicator is in tact.
numWarnings = 0;
+ numNotices = 0;
numFailures = 0;
artifactMap.clear();
reportingDatabase.numWarnings++;
}
}
+ for ( Iterator j = results.getNotices().iterator(); j.hasNext(); )
+ {
+ Result result = (Result) j.next();
+
+ if ( filter.equals( result.getProcessor() ) )
+ {
+ if ( targetResults == null )
+ {
+ // lazily create so it is not added unless it has to be
+ targetResults = createArtifactResults( reportingDatabase, results );
+ }
+
+ targetResults.addNotice( result );
+ reportingDatabase.numNotices++;
+ }
+ }
}
for ( Iterator i = this.reporting.getMetadata().iterator(); i.hasNext(); )
{
reportingDatabase.numWarnings++;
}
}
+ for ( Iterator j = results.getNotices().iterator(); j.hasNext(); )
+ {
+ Result result = (Result) j.next();
+
+ if ( filter.equals( result.getProcessor() ) )
+ {
+ if ( targetResults == null )
+ {
+ // lazily create so it is not added unless it has to be
+ targetResults = createMetadataResults( reportingDatabase, results );
+ }
+
+ targetResults.addNotice( result );
+ reportingDatabase.numNotices++;
+ }
+ }
}
filteredDatabases.put( filter, reportingDatabase );
return reportingDatabase.getArtifactResults( results.getGroupId(), results.getArtifactId(),
results.getVersion(), results.getType(), results.getClassifier() );
}
+
+ public int getNumNotices()
+ {
+ return numNotices;
+ }
}
<multiplicity>*</multiplicity>
</association>
</field>
+ <field>
+ <name>notices</name>
+ <version>1.0.0</version>
+ <association>
+ <type>Result</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
<field xml.attribute="true">
<name>groupId</name>
<identity>true</identity>
<multiplicity>*</multiplicity>
</association>
</field>
+ <field>
+ <name>notices</name>
+ <version>1.0.0</version>
+ <association>
+ <type>Result</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
<field xml.attribute="true">
<name>groupId</name>
<version>1.0.0</version>
artifactReportProcessor.processArtifact( artifact, null, reportingDatabase );
assertEquals( 0, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
}
/**
artifactReportProcessor.processArtifact( artifact, null, reportingDatabase );
assertEquals( 1, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
}
/**
* limitations under the License.
*/
+import org.apache.maven.archiva.reporting.model.ArtifactResults;
import org.apache.maven.archiva.reporting.model.MetadataResults;
import org.apache.maven.archiva.reporting.model.Result;
import org.apache.maven.artifact.Artifact;
private static final String PROBLEM = "problem";
+ private Artifact artifact;
+
public void testEmptyArtifactReporter()
{
assertEquals( "No failures", 0, reportingDatabase.getNumFailures() );
assertEquals( "No warnings", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
assertFalse( "No artifact failures", reportingDatabase.getArtifactIterator().hasNext() );
assertFalse( "No metadata failures", reportingDatabase.getMetadataIterator().hasNext() );
}
reportingDatabase.addFailure( metadata, PROCESSOR, PROBLEM, "Single Failure Reason" );
assertEquals( "failures count", 1, reportingDatabase.getNumFailures() );
assertEquals( "warnings count", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
Iterator failures = reportingDatabase.getMetadataIterator();
assertTrue( "check there is a failure", failures.hasNext() );
reportingDatabase.addFailure( metadata, PROCESSOR, PROBLEM, "Second Failure Reason" );
assertEquals( "failures count", 2, reportingDatabase.getNumFailures() );
assertEquals( "warnings count", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
Iterator failures = reportingDatabase.getMetadataIterator();
assertTrue( "check there is a failure", failures.hasNext() );
reportingDatabase.addWarning( metadata, PROCESSOR, PROBLEM, "Single Warning Message" );
assertEquals( "warnings count", 0, reportingDatabase.getNumFailures() );
assertEquals( "warnings count", 1, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
Iterator warnings = reportingDatabase.getMetadataIterator();
assertTrue( "check there is a failure", warnings.hasNext() );
reportingDatabase.addWarning( metadata, PROCESSOR, PROBLEM, "Second Warning" );
assertEquals( "warnings count", 0, reportingDatabase.getNumFailures() );
assertEquals( "warnings count", 2, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
Iterator warnings = reportingDatabase.getMetadataIterator();
assertTrue( "check there is a failure", warnings.hasNext() );
assertFalse( "no more warnings", warnings.hasNext() );
}
+ public void testMetadataSingleNotice()
+ {
+ reportingDatabase.addNotice( metadata, PROCESSOR, PROBLEM, "Single Notice Message" );
+ assertEquals( "failure count", 0, reportingDatabase.getNumFailures() );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check notices", 1, reportingDatabase.getNumNotices() );
+
+ Iterator warnings = reportingDatabase.getMetadataIterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ MetadataResults results = (MetadataResults) warnings.next();
+ warnings = results.getNotices().iterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ Result result = (Result) warnings.next();
+ assertMetadata( results );
+ assertEquals( "check failure reason", "Single Notice Message", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertFalse( "no more warnings", warnings.hasNext() );
+ }
+
+ public void testMetadataMultipleNotices()
+ {
+ reportingDatabase.addNotice( metadata, PROCESSOR, PROBLEM, "First Notice" );
+ reportingDatabase.addNotice( metadata, PROCESSOR, PROBLEM, "Second Notice" );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumFailures() );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 2, reportingDatabase.getNumNotices() );
+
+ Iterator warnings = reportingDatabase.getMetadataIterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ MetadataResults results = (MetadataResults) warnings.next();
+ warnings = results.getNotices().iterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ Result result = (Result) warnings.next();
+ assertMetadata( results );
+ assertEquals( "check failure reason", "First Notice", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertTrue( "must have 2nd warning", warnings.hasNext() );
+ result = (Result) warnings.next();
+ assertEquals( "check failure reason", "Second Notice", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertFalse( "no more warnings", warnings.hasNext() );
+ }
+
+ public void testArtifactSingleFailure()
+ {
+ reportingDatabase.addFailure( artifact, PROCESSOR, PROBLEM, "Single Failure Reason" );
+ assertEquals( "failures count", 1, reportingDatabase.getNumFailures() );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
+
+ Iterator failures = reportingDatabase.getArtifactIterator();
+ assertTrue( "check there is a failure", failures.hasNext() );
+ ArtifactResults results = (ArtifactResults) failures.next();
+ failures = results.getFailures().iterator();
+ assertTrue( "check there is a failure", failures.hasNext() );
+ Result result = (Result) failures.next();
+ assertArtifact( results );
+ assertEquals( "check failure reason", "Single Failure Reason", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertFalse( "no more failures", failures.hasNext() );
+ }
+
+ private void assertArtifact( ArtifactResults results )
+ {
+ assertEquals( "check failure cause", artifact.getGroupId(), results.getGroupId() );
+ assertEquals( "check failure cause", artifact.getArtifactId(), results.getArtifactId() );
+ assertEquals( "check failure cause", artifact.getVersion(), results.getVersion() );
+ assertEquals( "check failure cause", artifact.getClassifier(), results.getClassifier() );
+ assertEquals( "check failure cause", artifact.getType(), results.getType() );
+ }
+
+ public void testArtifactMultipleFailures()
+ {
+ reportingDatabase.addFailure( artifact, PROCESSOR, PROBLEM, "First Failure Reason" );
+ reportingDatabase.addFailure( artifact, PROCESSOR, PROBLEM, "Second Failure Reason" );
+ assertEquals( "failures count", 2, reportingDatabase.getNumFailures() );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
+
+ Iterator failures = reportingDatabase.getArtifactIterator();
+ assertTrue( "check there is a failure", failures.hasNext() );
+ ArtifactResults results = (ArtifactResults) failures.next();
+ failures = results.getFailures().iterator();
+ assertTrue( "check there is a failure", failures.hasNext() );
+ Result result = (Result) failures.next();
+ assertArtifact( results );
+ assertEquals( "check failure reason", "First Failure Reason", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertTrue( "must have 2nd failure", failures.hasNext() );
+ result = (Result) failures.next();
+ assertEquals( "check failure reason", "Second Failure Reason", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertFalse( "no more failures", failures.hasNext() );
+ }
+
+ public void testArtifactSingleWarning()
+ {
+ reportingDatabase.addWarning( artifact, PROCESSOR, PROBLEM, "Single Warning Message" );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumFailures() );
+ assertEquals( "warnings count", 1, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
+
+ Iterator warnings = reportingDatabase.getArtifactIterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ ArtifactResults results = (ArtifactResults) warnings.next();
+ warnings = results.getWarnings().iterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ Result result = (Result) warnings.next();
+ assertArtifact( results );
+ assertEquals( "check failure reason", "Single Warning Message", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertFalse( "no more warnings", warnings.hasNext() );
+ }
+
+ public void testArtifactMultipleWarnings()
+ {
+ reportingDatabase.addWarning( artifact, PROCESSOR, PROBLEM, "First Warning" );
+ reportingDatabase.addWarning( artifact, PROCESSOR, PROBLEM, "Second Warning" );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumFailures() );
+ assertEquals( "warnings count", 2, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() );
+
+ Iterator warnings = reportingDatabase.getArtifactIterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ ArtifactResults results = (ArtifactResults) warnings.next();
+ warnings = results.getWarnings().iterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ Result result = (Result) warnings.next();
+ assertArtifact( results );
+ assertEquals( "check failure reason", "First Warning", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertTrue( "must have 2nd warning", warnings.hasNext() );
+ result = (Result) warnings.next();
+ assertEquals( "check failure reason", "Second Warning", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertFalse( "no more warnings", warnings.hasNext() );
+ }
+
+ public void testArtifactSingleNotice()
+ {
+ reportingDatabase.addNotice( artifact, PROCESSOR, PROBLEM, "Single Notice Message" );
+ assertEquals( "failure count", 0, reportingDatabase.getNumFailures() );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check notices", 1, reportingDatabase.getNumNotices() );
+
+ Iterator warnings = reportingDatabase.getArtifactIterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ ArtifactResults results = (ArtifactResults) warnings.next();
+ warnings = results.getNotices().iterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ Result result = (Result) warnings.next();
+ assertArtifact( results );
+ assertEquals( "check failure reason", "Single Notice Message", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertFalse( "no more warnings", warnings.hasNext() );
+ }
+
+ public void testArtifactMultipleNotices()
+ {
+ reportingDatabase.addNotice( artifact, PROCESSOR, PROBLEM, "First Notice" );
+ reportingDatabase.addNotice( artifact, PROCESSOR, PROBLEM, "Second Notice" );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumFailures() );
+ assertEquals( "warnings count", 0, reportingDatabase.getNumWarnings() );
+ assertEquals( "check no notices", 2, reportingDatabase.getNumNotices() );
+
+ Iterator warnings = reportingDatabase.getArtifactIterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ ArtifactResults results = (ArtifactResults) warnings.next();
+ warnings = results.getNotices().iterator();
+ assertTrue( "check there is a failure", warnings.hasNext() );
+ Result result = (Result) warnings.next();
+ assertArtifact( results );
+ assertEquals( "check failure reason", "First Notice", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertTrue( "must have 2nd warning", warnings.hasNext() );
+ result = (Result) warnings.next();
+ assertEquals( "check failure reason", "Second Notice", result.getReason() );
+ assertEquals( "check failure parameters", PROCESSOR, result.getProcessor() );
+ assertEquals( "check failure parameters", PROBLEM, result.getProblem() );
+ assertFalse( "no more warnings", warnings.hasNext() );
+ }
+
protected void setUp()
throws Exception
{
super.setUp();
ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
- Artifact artifact = artifactFactory.createBuildArtifact( "groupId", "artifactId", "1.0-alpha-1", "type" );
+
+ artifact = artifactFactory.createBuildArtifact( "groupId", "artifactId", "1.0-alpha-1", "type" );
Versioning versioning = new Versioning();
versioning.addVersion( "1.0-alpha-1" );
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 0, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
}
private Artifact createValidArtifact()
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 1, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
Iterator failures = reportingDatabase.getArtifactIterator();
ArtifactResults results = (ArtifactResults) failures.next();
assertFalse( failures.hasNext() );
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 0, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
}
private Dependency createValidDependency()
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 0, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
}
public void testValidArtifactWithValidMultipleDependencies()
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 0, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
}
public void testValidArtifactWithAnInvalidDependency()
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 1, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
Iterator failures = reportingDatabase.getArtifactIterator();
ArtifactResults results = (ArtifactResults) failures.next();
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 1, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
Iterator failures = reportingDatabase.getArtifactIterator();
ArtifactResults results = (ArtifactResults) failures.next();
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 1, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
Iterator failures = reportingDatabase.getArtifactIterator();
ArtifactResults results = (ArtifactResults) failures.next();
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 1, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
Iterator failures = reportingDatabase.getArtifactIterator();
ArtifactResults results = (ArtifactResults) failures.next();
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 0, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
}
public void testValidArtifactWithMissingDependencyVersion()
processor.processArtifact( artifact, model, reportingDatabase );
assertEquals( 1, reportingDatabase.getNumFailures() );
assertEquals( 0, reportingDatabase.getNumWarnings() );
+ assertEquals( 0, reportingDatabase.getNumNotices() );
Iterator failures = reportingDatabase.getArtifactIterator();
ArtifactResults results = (ArtifactResults) failures.next();
processor.processArtifact( artifact, model, reportDatabase );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
assertEquals( "Check warnings", 1, reportDatabase.getNumWarnings() );
assertEquals( "Check no failures", 0, reportDatabase.getNumFailures() );
}
{
processor.processArtifact( artifact, model, reportDatabase );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
assertEquals( "Check warnings", 0, reportDatabase.getNumWarnings() );
assertEquals( "Check no failures", 0, reportDatabase.getNumFailures() );
}
artifact.setGroupId( "different.groupId" );
processor.processArtifact( artifact, model, reportDatabase );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
assertEquals( "Check warnings", 0, reportDatabase.getNumWarnings() );
assertEquals( "Check no failures", 0, reportDatabase.getNumFailures() );
}
processor.processArtifact( newArtifact, model, reportDatabase );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
assertEquals( "Check warnings", 0, reportDatabase.getNumWarnings() );
assertEquals( "Check no failures", 0, reportDatabase.getNumFailures() );
}
processor.processArtifact( duplicate, model, reportDatabase );
assertEquals( "Check warnings", 0, reportDatabase.getNumWarnings() );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
assertEquals( "Check no failures", 1, reportDatabase.getNumFailures() );
}
artifactReportProcessor.processArtifact( artifact, null, reportDatabase );
assertEquals( 0, reportDatabase.getNumFailures() );
assertEquals( 0, reportDatabase.getNumWarnings() );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
}
artifactReportProcessor.processArtifact( artifact, null, reportDatabase );
assertEquals( 0, reportDatabase.getNumFailures() );
assertEquals( 0, reportDatabase.getNumWarnings() );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
}
}
artifactReportProcessor.processArtifact( artifact, null, reportDatabase );
assertEquals( 0, reportDatabase.getNumFailures() );
assertEquals( 0, reportDatabase.getNumWarnings() );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
}
/**
artifactReportProcessor.processArtifact( artifact, model, reportDatabase );
assertEquals( 0, reportDatabase.getNumFailures() );
assertEquals( 0, reportDatabase.getNumWarnings() );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
}
/**
artifactReportProcessor.processArtifact( pomArtifact, model, reportDatabase );
assertEquals( 0, reportDatabase.getNumFailures() );
assertEquals( 0, reportDatabase.getNumWarnings() );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
}
/**
artifactReportProcessor.processArtifact( artifact, model, reportDatabase );
assertEquals( 0, reportDatabase.getNumFailures() );
assertEquals( 0, reportDatabase.getNumWarnings() );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
}
/**
artifactReportProcessor.processArtifact( artifact, model, reportDatabase );
assertEquals( 0, reportDatabase.getNumFailures() );
assertEquals( 0, reportDatabase.getNumWarnings() );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
}
/**
artifactReportProcessor.processArtifact( artifact, model, reportDatabase );
assertEquals( 0, reportDatabase.getNumFailures() );
assertEquals( 0, reportDatabase.getNumWarnings() );
+ assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() );
}
/**
${database.numFailures}
<img src="<c:url value="/images/icon_warning_sml.gif"/>" width="15" height="15" alt=""/>
${database.numWarnings}
+ <img src="<c:url value="/images/icon_info_sml.gif"/>" width="15" height="15" alt=""/>
+ ${database.numNotices}
<span style="font-size: x-small">
<%-- TODO! use better formatting here --%>
<c:forEach items="${artifact.warnings}" var="result">
<li class="warningBullet">${result.reason}</li>
</c:forEach>
+ <c:forEach items="${artifact.notices}" var="result">
+ <li class="infoBullet">${result.reason}</li>
+ </c:forEach>
</ul>
<p style="text-indent: 3em;">
<span style="font-size: x-small">
<c:forEach items="${metadata.warnings}" var="result">
<li class="warningBullet">${result.reason}</li>
</c:forEach>
+ <c:forEach items="${metadata.notices}" var="result">
+ <li class="infoBullet">${result.reason}</li>
+ </c:forEach>
</ul>
<p style="text-indent: 3em;">
<span style="font-size: x-small">
.warningBullet {
list-style-image: url( "../images/icon_warning_sml.gif" );
}
+
+.infoBullet {
+ list-style-image: url( "../images/icon_info_sml.gif" );
+}
.warningBullet {
list-style-image: url( "../images/icon_warning_sml.gif" );
}
+
+.infoBullet {
+ list-style-image: url( "../images/icon_info_sml.gif" );
+}
2
<img src="images/icon_warning_sml.gif" width="15" height="15" alt=""/>
1
+ <img src="images/icon_info_sml.gif" width="15" height="15" alt=""/>
+ 0
<span style="font-size: x-small">Report finished: 12 Jun 2006 10:11:12, execution time: 10 minutes 15 seconds
</span>
</p>
2
<img src="images/icon_warning_sml.gif" width="15" height="15" alt=""/>
0
+ <img src="images/icon_info_sml.gif" width="15" height="15" alt=""/>
+ 1
<span style="font-size: x-small">Report finished: 12 Jun 2006 10:11:12, execution time: 10 minutes 15 seconds
</span>
</p>
<a href="#">Repair</a>
)
</li>
+ <li class="infoBullet">Your coffee is ready (
+ <a href="#">Pick up</a>
+ )
+ </li>
</ul>
<p>
<span style="font-size: x-small; text-indent: 3em">