mirror of https://github.com/apache/archiva.git
more log for MRM-1832
This commit is contained in:
parent
9a09994c8c
commit
6611fc497b
|
@ -23,6 +23,8 @@ import org.apache.archiva.admin.model.beans.ManagedRepository;
|
|||
import org.apache.archiva.consumers.AbstractMonitoredConsumer;
|
||||
import org.apache.archiva.consumers.ConsumerException;
|
||||
import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -43,6 +45,8 @@ public class InvalidScanConsumer
|
|||
*/
|
||||
private String id = "unset-id";
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger( getClass() );
|
||||
|
||||
private int processCount = 0;
|
||||
|
||||
@Override
|
||||
|
@ -87,6 +91,7 @@ public class InvalidScanConsumer
|
|||
public void processFile( String path )
|
||||
throws ConsumerException
|
||||
{
|
||||
logger.info( "processFile: {}", path );
|
||||
processCount++;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,9 +22,10 @@ package org.apache.archiva.repository.scanner;
|
|||
import junit.framework.TestCase;
|
||||
import org.apache.archiva.admin.model.beans.ManagedRepository;
|
||||
import org.apache.archiva.admin.model.beans.RemoteRepository;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
|
||||
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
@ -33,6 +34,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||
import javax.inject.Inject;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
|
@ -40,12 +42,9 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* RepositoryScannerTest
|
||||
*
|
||||
*
|
||||
*/
|
||||
@RunWith(ArchivaSpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml" })
|
||||
|
@ -79,7 +78,8 @@ public class RepositoryScannerTest
|
|||
|
||||
private ManagedRepository createDefaultRepository()
|
||||
{
|
||||
File repoDir = new File( "src/test/repositories/default-repository" );
|
||||
File repoDir =
|
||||
Paths.get( System.getProperty( "basedir" ), "src/test/repositories/default-repository" ).toFile();
|
||||
|
||||
assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
|
||||
|
||||
|
@ -89,9 +89,9 @@ public class RepositoryScannerTest
|
|||
private ManagedRepository createSimpleRepository()
|
||||
throws IOException, ParseException
|
||||
{
|
||||
File srcDir = new File( "src/test/repositories/simple-repository" );
|
||||
File srcDir = Paths.get( System.getProperty( "basedir" ), "src/test/repositories/simple-repository" ).toFile();
|
||||
|
||||
File repoDir = new File( "target/test-repos/simple-repository" );
|
||||
File repoDir = Paths.get( System.getProperty( "basedir" ), "target/test-repos/simple-repository" ).toFile();
|
||||
|
||||
FileUtils.deleteDirectory( repoDir );
|
||||
|
||||
|
@ -116,7 +116,7 @@ public class RepositoryScannerTest
|
|||
|
||||
private ManagedRepository createLegacyRepository()
|
||||
{
|
||||
File repoDir = new File( "src/test/repositories/legacy-repository" );
|
||||
File repoDir = Paths.get( System.getProperty( "basedir" ), "src/test/repositories/legacy-repository" ).toFile();
|
||||
|
||||
assertTrue( "Legacy Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
|
||||
|
||||
|
@ -238,7 +238,8 @@ public class RepositoryScannerTest
|
|||
KnownScanConsumer consumer = new KnownScanConsumer();
|
||||
consumer.setIncludes(
|
||||
new String[]{ "**/*.jar", "**/*.war", "**/*.pom", "**/maven-metadata.xml", "**/*-site.xml", "**/*.zip",
|
||||
"**/*.tar.gz", "**/*.sha1", "**/*.md5" } );
|
||||
"**/*.tar.gz", "**/*.sha1", "**/*.md5" }
|
||||
);
|
||||
knownConsumers.add( consumer );
|
||||
|
||||
List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>();
|
||||
|
|
Loading…
Reference in New Issue