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 reporter = new ReportingDatabase();
35 artifactReportProcessor = (ArtifactReportProcessor) lookup( ArtifactReportProcessor.ROLE, "invalid-pom" );
39 * Test the InvalidPomArtifactReportProcessor when the artifact is an invalid pom.
41 public void testInvalidPomArtifactReportProcessorFailure()
43 Artifact artifact = createArtifact( "org.apache.maven", "artifactId", "1.0-alpha-3", "pom" );
45 artifactReportProcessor.processArtifact( artifact, null, reporter );
46 assertEquals( 1, reporter.getNumFailures() );
51 * Test the InvalidPomArtifactReportProcessor when the artifact is a valid pom.
53 public void testInvalidPomArtifactReportProcessorSuccess()
55 Artifact artifact = createArtifact( "groupId", "artifactId", "1.0-alpha-2", "pom" );
57 artifactReportProcessor.processArtifact( artifact, null, reporter );
58 assertEquals( 0, reporter.getNumFailures() );
59 assertEquals( 0, reporter.getNumWarnings() );
64 * Test the InvalidPomArtifactReportProcessor when the artifact is not a pom.
66 public void testNotAPomArtifactReportProcessorSuccess()
68 Artifact artifact = createArtifact( "groupId", "artifactId", "1.0-alpha-1", "jar" );
70 artifactReportProcessor.processArtifact( artifact, null, reporter );
71 assertEquals( 0, reporter.getNumFailures() );
72 assertEquals( 1, reporter.getNumWarnings() );