mirror of https://github.com/apache/archiva.git
Switching to new API
This commit is contained in:
parent
91900a6376
commit
aa8de8c74b
|
@ -47,7 +47,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase1Test
|
||||||
|
|
||||||
taskExecutor.executeTask( repoTask );
|
taskExecutor.executeTask( repoTask );
|
||||||
|
|
||||||
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
|
Collection<String> unprocessedResultList = testConsumer.getConsumed();
|
||||||
|
|
||||||
assertNotNull( unprocessedResultList );
|
assertNotNull( unprocessedResultList );
|
||||||
assertEquals( "Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() );
|
assertEquals( "Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() );
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
|
||||||
taskExecutor.executeTask( repoTask );
|
taskExecutor.executeTask( repoTask );
|
||||||
|
|
||||||
// check no artifacts processed
|
// check no artifacts processed
|
||||||
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
|
Collection<String> unprocessedResultList = testConsumer.getConsumed();
|
||||||
|
|
||||||
assertNotNull( unprocessedResultList );
|
assertNotNull( unprocessedResultList );
|
||||||
assertEquals( "Incorrect number of unprocessed artifacts detected. No new artifacts should have been found.", 0,
|
assertEquals( "Incorrect number of unprocessed artifacts detected. No new artifacts should have been found.", 0,
|
||||||
|
@ -139,7 +139,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
|
||||||
taskExecutor.executeTask( repoTask );
|
taskExecutor.executeTask( repoTask );
|
||||||
|
|
||||||
// check no artifacts processed
|
// check no artifacts processed
|
||||||
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
|
Collection<String> unprocessedResultList = testConsumer.getConsumed();
|
||||||
assertNotNull( unprocessedResultList );
|
assertNotNull( unprocessedResultList );
|
||||||
assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
|
assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
|
||||||
unprocessedResultList.size() );
|
unprocessedResultList.size() );
|
||||||
|
@ -186,7 +186,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
|
||||||
taskExecutor.executeTask( repoTask );
|
taskExecutor.executeTask( repoTask );
|
||||||
|
|
||||||
// check no artifacts processed
|
// check no artifacts processed
|
||||||
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
|
Collection<String> unprocessedResultList = testConsumer.getConsumed();
|
||||||
assertNotNull( unprocessedResultList );
|
assertNotNull( unprocessedResultList );
|
||||||
assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
|
assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
|
||||||
unprocessedResultList.size() );
|
unprocessedResultList.size() );
|
||||||
|
@ -219,7 +219,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
|
||||||
|
|
||||||
taskExecutor.executeTask( repoTask );
|
taskExecutor.executeTask( repoTask );
|
||||||
|
|
||||||
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
|
Collection<String> unprocessedResultList = testConsumer.getConsumed();
|
||||||
|
|
||||||
assertNotNull( unprocessedResultList );
|
assertNotNull( unprocessedResultList );
|
||||||
assertEquals( "Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() );
|
assertEquals( "Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() );
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class TestConsumer
|
||||||
extends AbstractMonitoredConsumer
|
extends AbstractMonitoredConsumer
|
||||||
implements KnownRepositoryContentConsumer
|
implements KnownRepositoryContentConsumer
|
||||||
{
|
{
|
||||||
private Set<ArtifactReference> consumed = new HashSet<ArtifactReference>();
|
private Set<String> consumed = new HashSet<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RepositoryContentFactory factory;
|
private RepositoryContentFactory factory;
|
||||||
|
@ -98,11 +98,12 @@ public class TestConsumer
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
consumed.add( repository.toArtifactReference( path ) );
|
repository.toItemSelector( path );
|
||||||
|
consumed.add( path );
|
||||||
}
|
}
|
||||||
catch ( LayoutException e )
|
catch ( LayoutException e )
|
||||||
{
|
{
|
||||||
throw new ConsumerException( e.getMessage(), e );
|
// Layout exception for specific paths
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,7 +126,7 @@ public class TestConsumer
|
||||||
completeScan();
|
completeScan();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<ArtifactReference> getConsumed()
|
public Collection<String> getConsumed()
|
||||||
{
|
{
|
||||||
return consumed;
|
return consumed;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue