From: Olivier Lamy Date: Tue, 22 Apr 2014 12:52:25 +0000 (+1000) Subject: more log for MRM-1832 X-Git-Tag: archiva-2.1.0~67 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6611fc497b8122c26418a26a6f2fc46e8e7b4af5;p=archiva.git more log for MRM-1832 --- diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java index 717b8ba58..a253179f7 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java @@ -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; @@ -42,6 +44,8 @@ public class InvalidScanConsumer * default-value="unset-id" */ private String id = "unset-id"; + + private Logger logger = LoggerFactory.getLogger( getClass() ); private int processCount = 0; @@ -87,6 +91,7 @@ public class InvalidScanConsumer public void processFile( String path ) throws ConsumerException { + logger.info( "processFile: {}", path ); processCount++; } diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java index a19b16db7..dc40787fc 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java @@ -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,15 +42,12 @@ 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" } ) +@RunWith(ArchivaSpringJUnit4ClassRunner.class) +@ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml" }) public class RepositoryScannerTest extends TestCase { @@ -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 invalidConsumers = new ArrayList<>();