From: Brett Porter Date: Mon, 11 Sep 2006 04:55:27 +0000 (+0000) Subject: [MRM-60] add support for notices in addition to warnings and failures X-Git-Tag: archiva-0.9-alpha-1~558 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d1752d8e60819afc0d91753111266bb79336f23e;p=archiva.git [MRM-60] add support for notices in addition to warnings and failures git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@442098 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java b/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java index 0f15f22fc..3b345d36c 100644 --- a/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java +++ b/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java @@ -285,6 +285,7 @@ public class RepositoryConverterTest 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() ); @@ -454,8 +455,9 @@ public class RepositoryConverterTest 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() ); @@ -734,6 +736,7 @@ public class RepositoryConverterTest 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(); ) { @@ -906,12 +909,14 @@ public class RepositoryConverterTest { 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 ) diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/ReportingDatabase.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/ReportingDatabase.java index e81d47faa..10fa41bd3 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/ReportingDatabase.java +++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/ReportingDatabase.java @@ -58,6 +58,8 @@ public class ReportingDatabase private Map filteredDatabases = new HashMap(); + private int numNotices; + public ReportingDatabase( ReportGroup reportGroup ) { this( reportGroup, new Reporting() ); @@ -101,6 +103,21 @@ public class ReportingDatabase } } + 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 ); @@ -158,6 +175,7 @@ public class ReportingDatabase numFailures += result.getFailures().size(); numWarnings += result.getWarnings().size(); + numNotices += result.getNotices().size(); } artifactMap = map; } @@ -215,6 +233,25 @@ public class ReportingDatabase } } + 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; @@ -235,8 +272,9 @@ public class ReportingDatabase 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 ); } @@ -301,6 +339,9 @@ public class ReportingDatabase numWarnings -= results.getWarnings().size(); results.getWarnings().clear(); + numNotices -= results.getWarnings().size(); + results.getNotices().clear(); + metadataWithProblems.remove( results ); } @@ -349,6 +390,7 @@ public class ReportingDatabase numFailures -= results.getFailures().size(); numWarnings -= results.getWarnings().size(); + numNotices -= results.getNotices().size(); map.remove( key ); } @@ -378,6 +420,7 @@ public class ReportingDatabase { // clear the values rather than destroy the instance so that the "inProgress" indicator is in tact. numWarnings = 0; + numNotices = 0; numFailures = 0; artifactMap.clear(); @@ -465,6 +508,22 @@ public class ReportingDatabase 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(); ) { @@ -502,6 +561,22 @@ public class ReportingDatabase 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 ); @@ -525,4 +600,9 @@ public class ReportingDatabase return reportingDatabase.getArtifactResults( results.getGroupId(), results.getArtifactId(), results.getVersion(), results.getType(), results.getClassifier() ); } + + public int getNumNotices() + { + return numNotices; + } } diff --git a/archiva-reports-standard/src/main/mdo/reporting.mdo b/archiva-reports-standard/src/main/mdo/reporting.mdo index 74a75f4da..a190f10ce 100644 --- a/archiva-reports-standard/src/main/mdo/reporting.mdo +++ b/archiva-reports-standard/src/main/mdo/reporting.mdo @@ -79,6 +79,14 @@ * + + notices + 1.0.0 + + Result + * + + groupId true @@ -150,6 +158,14 @@ * + + notices + 1.0.0 + + Result + * + + groupId 1.0.0 diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/ChecksumArtifactReporterTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/ChecksumArtifactReporterTest.java index 03eb1387b..27b7c7ff3 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/ChecksumArtifactReporterTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/ChecksumArtifactReporterTest.java @@ -66,6 +66,7 @@ public class ChecksumArtifactReporterTest artifactReportProcessor.processArtifact( artifact, null, reportingDatabase ); assertEquals( 0, reportingDatabase.getNumFailures() ); assertEquals( 0, reportingDatabase.getNumWarnings() ); + assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() ); } /** @@ -80,6 +81,7 @@ public class ChecksumArtifactReporterTest artifactReportProcessor.processArtifact( artifact, null, reportingDatabase ); assertEquals( 1, reportingDatabase.getNumFailures() ); assertEquals( 0, reportingDatabase.getNumWarnings() ); + assertEquals( "check no notices", 0, reportingDatabase.getNumNotices() ); } /** diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DefaultArtifactReporterTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DefaultArtifactReporterTest.java index 94154945c..07d44fdfe 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DefaultArtifactReporterTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DefaultArtifactReporterTest.java @@ -16,6 +16,7 @@ package org.apache.maven.archiva.reporting; * 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; @@ -40,10 +41,13 @@ public class DefaultArtifactReporterTest 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() ); } @@ -53,6 +57,7 @@ public class DefaultArtifactReporterTest 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() ); @@ -80,6 +85,7 @@ public class DefaultArtifactReporterTest 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() ); @@ -104,6 +110,7 @@ public class DefaultArtifactReporterTest 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() ); @@ -124,6 +131,7 @@ public class DefaultArtifactReporterTest 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() ); @@ -143,13 +151,207 @@ public class DefaultArtifactReporterTest 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" ); diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DependencyArtifactReportProcessorTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DependencyArtifactReportProcessorTest.java index 1f94e276d..50e58fda0 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DependencyArtifactReportProcessorTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DependencyArtifactReportProcessorTest.java @@ -66,6 +66,7 @@ public class DependencyArtifactReportProcessorTest processor.processArtifact( artifact, model, reportingDatabase ); assertEquals( 0, reportingDatabase.getNumFailures() ); assertEquals( 0, reportingDatabase.getNumWarnings() ); + assertEquals( 0, reportingDatabase.getNumNotices() ); } private Artifact createValidArtifact() @@ -83,6 +84,7 @@ public class DependencyArtifactReportProcessorTest 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() ); @@ -101,6 +103,7 @@ public class DependencyArtifactReportProcessorTest processor.processArtifact( artifact, model, reportingDatabase ); assertEquals( 0, reportingDatabase.getNumFailures() ); assertEquals( 0, reportingDatabase.getNumWarnings() ); + assertEquals( 0, reportingDatabase.getNumNotices() ); } private Dependency createValidDependency() @@ -118,6 +121,7 @@ public class DependencyArtifactReportProcessorTest processor.processArtifact( artifact, model, reportingDatabase ); assertEquals( 0, reportingDatabase.getNumFailures() ); assertEquals( 0, reportingDatabase.getNumWarnings() ); + assertEquals( 0, reportingDatabase.getNumNotices() ); } public void testValidArtifactWithValidMultipleDependencies() @@ -133,6 +137,7 @@ public class DependencyArtifactReportProcessorTest processor.processArtifact( artifact, model, reportingDatabase ); assertEquals( 0, reportingDatabase.getNumFailures() ); assertEquals( 0, reportingDatabase.getNumWarnings() ); + assertEquals( 0, reportingDatabase.getNumNotices() ); } public void testValidArtifactWithAnInvalidDependency() @@ -148,6 +153,7 @@ public class DependencyArtifactReportProcessorTest 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(); @@ -168,6 +174,7 @@ public class DependencyArtifactReportProcessorTest 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(); @@ -196,6 +203,7 @@ public class DependencyArtifactReportProcessorTest 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(); @@ -234,6 +242,7 @@ public class DependencyArtifactReportProcessorTest 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(); @@ -253,6 +262,7 @@ public class DependencyArtifactReportProcessorTest processor.processArtifact( artifact, model, reportingDatabase ); assertEquals( 0, reportingDatabase.getNumFailures() ); assertEquals( 0, reportingDatabase.getNumWarnings() ); + assertEquals( 0, reportingDatabase.getNumNotices() ); } public void testValidArtifactWithMissingDependencyVersion() @@ -265,6 +275,7 @@ public class DependencyArtifactReportProcessorTest 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(); diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DuplicateArtifactFileReportProcessorTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DuplicateArtifactFileReportProcessorTest.java index 69f155717..3ad4bad88 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DuplicateArtifactFileReportProcessorTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/DuplicateArtifactFileReportProcessorTest.java @@ -80,6 +80,7 @@ public class DuplicateArtifactFileReportProcessorTest 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() ); } @@ -89,6 +90,7 @@ public class DuplicateArtifactFileReportProcessorTest { 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() ); } @@ -99,6 +101,7 @@ public class DuplicateArtifactFileReportProcessorTest 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() ); } @@ -110,6 +113,7 @@ public class DuplicateArtifactFileReportProcessorTest 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() ); } @@ -124,6 +128,7 @@ public class DuplicateArtifactFileReportProcessorTest 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() ); } diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/InvalidPomArtifactReportProcessorTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/InvalidPomArtifactReportProcessorTest.java index c71a06f9e..afea3474a 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/InvalidPomArtifactReportProcessorTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/InvalidPomArtifactReportProcessorTest.java @@ -60,6 +60,7 @@ public class InvalidPomArtifactReportProcessorTest artifactReportProcessor.processArtifact( artifact, null, reportDatabase ); assertEquals( 0, reportDatabase.getNumFailures() ); assertEquals( 0, reportDatabase.getNumWarnings() ); + assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() ); } @@ -73,5 +74,6 @@ public class InvalidPomArtifactReportProcessorTest artifactReportProcessor.processArtifact( artifact, null, reportDatabase ); assertEquals( 0, reportDatabase.getNumFailures() ); assertEquals( 0, reportDatabase.getNumWarnings() ); + assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() ); } } diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessorTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessorTest.java index 9a332bdca..e00e447fc 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessorTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessorTest.java @@ -58,6 +58,7 @@ public class LocationArtifactReportProcessorTest artifactReportProcessor.processArtifact( artifact, null, reportDatabase ); assertEquals( 0, reportDatabase.getNumFailures() ); assertEquals( 0, reportDatabase.getNumWarnings() ); + assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() ); } /** @@ -74,6 +75,7 @@ public class LocationArtifactReportProcessorTest artifactReportProcessor.processArtifact( artifact, model, reportDatabase ); assertEquals( 0, reportDatabase.getNumFailures() ); assertEquals( 0, reportDatabase.getNumWarnings() ); + assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() ); } /** @@ -89,6 +91,7 @@ public class LocationArtifactReportProcessorTest artifactReportProcessor.processArtifact( pomArtifact, model, reportDatabase ); assertEquals( 0, reportDatabase.getNumFailures() ); assertEquals( 0, reportDatabase.getNumWarnings() ); + assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() ); } /** @@ -105,6 +108,7 @@ public class LocationArtifactReportProcessorTest artifactReportProcessor.processArtifact( artifact, model, reportDatabase ); assertEquals( 0, reportDatabase.getNumFailures() ); assertEquals( 0, reportDatabase.getNumWarnings() ); + assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() ); } /** @@ -122,6 +126,7 @@ public class LocationArtifactReportProcessorTest artifactReportProcessor.processArtifact( artifact, model, reportDatabase ); assertEquals( 0, reportDatabase.getNumFailures() ); assertEquals( 0, reportDatabase.getNumWarnings() ); + assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() ); } /** @@ -139,6 +144,7 @@ public class LocationArtifactReportProcessorTest artifactReportProcessor.processArtifact( artifact, model, reportDatabase ); assertEquals( 0, reportDatabase.getNumFailures() ); assertEquals( 0, reportDatabase.getNumWarnings() ); + assertEquals( "Check no notices", 0, reportDatabase.getNumNotices() ); } /** diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp index 713c47bd1..948e322e8 100644 --- a/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp @@ -77,6 +77,8 @@ ${database.numFailures} " width="15" height="15" alt=""/> ${database.numWarnings} + " width="15" height="15" alt=""/> + ${database.numNotices} <%-- TODO! use better formatting here --%> @@ -106,6 +108,9 @@
  • ${result.reason}
  • + +
  • ${result.reason}
  • +

    @@ -166,6 +171,9 @@

  • ${result.reason}
  • + +
  • ${result.reason}
  • +

    diff --git a/archiva-webapp/src/main/webapp/css/site.css b/archiva-webapp/src/main/webapp/css/site.css index bb03df783..5c6faeabd 100644 --- a/archiva-webapp/src/main/webapp/css/site.css +++ b/archiva-webapp/src/main/webapp/css/site.css @@ -104,3 +104,7 @@ .warningBullet { list-style-image: url( "../images/icon_warning_sml.gif" ); } + +.infoBullet { + list-style-image: url( "../images/icon_info_sml.gif" ); +} diff --git a/design/white-site/src/site/resources/css/site.css b/design/white-site/src/site/resources/css/site.css index bb03df783..5c6faeabd 100644 --- a/design/white-site/src/site/resources/css/site.css +++ b/design/white-site/src/site/resources/css/site.css @@ -104,3 +104,7 @@ .warningBullet { list-style-image: url( "../images/icon_warning_sml.gif" ); } + +.infoBullet { + list-style-image: url( "../images/icon_info_sml.gif" ); +} diff --git a/design/white-site/src/site/xdoc/reports.xml b/design/white-site/src/site/xdoc/reports.xml index 82dd9405c..f0d95f5f2 100644 --- a/design/white-site/src/site/xdoc/reports.xml +++ b/design/white-site/src/site/xdoc/reports.xml @@ -65,6 +65,8 @@ 2 1 + + 0 Report finished: 12 Jun 2006 10:11:12, execution time: 10 minutes 15 seconds

    @@ -134,6 +136,8 @@ 2 0 + + 1 Report finished: 12 Jun 2006 10:11:12, execution time: 10 minutes 15 seconds

    @@ -165,6 +169,10 @@ Repair ) +
  • Your coffee is ready ( + Pick up + ) +