Added the role-hint for md5 Digester to the plexus test config.

Re-initialize the reporter in every testcase as it isn't reset
and the internal error/succes etc. lists can contain values from
previous testcases.


git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@430624 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kenney Westerhof 2006-08-11 02:19:29 +00:00
parent 92753d6b7d
commit 61c4bb7f1d
2 changed files with 12 additions and 3 deletions

View File

@ -33,8 +33,6 @@ import java.util.Collections;
public class DuplicateArtifactFileReportProcessorTest
extends AbstractRepositoryReportsTestCase
{
private MockArtifactReporter reporter;
private Artifact artifact;
private Model model;
@ -55,7 +53,6 @@ public class DuplicateArtifactFileReportProcessorTest
artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
artifact = createArtifact( "groupId", "artifactId", "1.0-alpha-1", "1.0-alpha-1", "jar" );
reporter = new MockArtifactReporter();
model = new Model();
RepositoryArtifactIndexFactory factory =
@ -76,6 +73,8 @@ public class DuplicateArtifactFileReportProcessorTest
{
artifact.setFile( null );
MockArtifactReporter reporter = new MockArtifactReporter();
processor.processArtifact( model, artifact, reporter, repository );
assertEquals( "Check no successes", 0, reporter.getSuccesses() );
@ -86,6 +85,8 @@ public class DuplicateArtifactFileReportProcessorTest
public void testSuccessOnAlreadyIndexedArtifact()
throws Exception
{
MockArtifactReporter reporter = new MockArtifactReporter();
processor.processArtifact( model, artifact, reporter, repository );
assertEquals( "Check no successes", 1, reporter.getSuccesses() );
@ -96,6 +97,8 @@ public class DuplicateArtifactFileReportProcessorTest
public void testSuccessOnDifferentGroupId()
throws Exception
{
MockArtifactReporter reporter = new MockArtifactReporter();
artifact.setGroupId( "different.groupId" );
processor.processArtifact( model, artifact, reporter, repository );
@ -109,6 +112,8 @@ public class DuplicateArtifactFileReportProcessorTest
{
Artifact newArtifact = createArtifact( "groupId", "artifactId", "1.0-alpha-1", "1.0-alpha-1", "pom" );
MockArtifactReporter reporter = new MockArtifactReporter();
processor.processArtifact( model, newArtifact, reporter, repository );
assertEquals( "Check no successes", 1, reporter.getSuccesses() );
@ -123,6 +128,9 @@ public class DuplicateArtifactFileReportProcessorTest
artifact.getVersion(), artifact.getType() );
duplicate.setFile( artifact.getFile() );
MockArtifactReporter reporter = new MockArtifactReporter();
System.err.println("OKAY");
processor.processArtifact( model, duplicate, reporter, repository );
assertEquals( "Check no successes", 0, reporter.getSuccesses() );

View File

@ -7,6 +7,7 @@
<requirements>
<requirement>
<role>org.apache.maven.repository.digest.Digester</role>
<role-hint>md5</role-hint>
</requirement>
<requirement>
<role>org.apache.maven.repository.indexing.RepositoryArtifactIndexFactory</role>