1 package org.apache.maven.archiva.reporting;
4 * Copyright 2005-2006 The Apache Software Foundation.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 import org.apache.maven.artifact.Artifact;
22 * This class tests the InvalidPomArtifactReportProcessor class.
24 public class InvalidPomArtifactReportProcessorTest
25 extends AbstractRepositoryReportsTestCase
27 private ArtifactReportProcessor artifactReportProcessor;
29 private ReportingDatabase reportDatabase;
35 artifactReportProcessor = (ArtifactReportProcessor) lookup( ArtifactReportProcessor.ROLE, "invalid-pom" );
37 ReportGroup reportGroup = (ReportGroup) lookup( ReportGroup.ROLE, "health" );
38 reportDatabase = new ReportingDatabase( reportGroup );
42 * Test the InvalidPomArtifactReportProcessor when the artifact is an invalid pom.
44 public void testInvalidPomArtifactReportProcessorFailure()
46 Artifact artifact = createArtifact( "org.apache.maven", "artifactId", "1.0-alpha-3", "pom" );
48 artifactReportProcessor.processArtifact( artifact, null, reportDatabase );
49 assertEquals( 1, reportDatabase.getNumFailures() );
54 * Test the InvalidPomArtifactReportProcessor when the artifact is a valid pom.
56 public void testInvalidPomArtifactReportProcessorSuccess()
58 Artifact artifact = createArtifact( "groupId", "artifactId", "1.0-alpha-2", "pom" );
60 artifactReportProcessor.processArtifact( artifact, null, reportDatabase );
61 assertEquals( 0, reportDatabase.getNumFailures() );
62 assertEquals( 0, reportDatabase.getNumWarnings() );
67 * Test the InvalidPomArtifactReportProcessor when the artifact is not a pom.
69 public void testNotAPomArtifactReportProcessorSuccess()
71 Artifact artifact = createArtifact( "groupId", "artifactId", "1.0-alpha-1", "jar" );
73 artifactReportProcessor.processArtifact( artifact, null, reportDatabase );
74 assertEquals( 0, reportDatabase.getNumFailures() );
75 assertEquals( 0, reportDatabase.getNumWarnings() );