[MRM-546] restore correct test data and fix configuration modifications

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@587071 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2007-10-22 12:37:25 +00:00
parent 858f0283d1
commit 19afbc4ac8
3 changed files with 78 additions and 53 deletions

View File

@ -20,47 +20,58 @@
<configuration>
<version>1</version>
<managedRepositories>
<managedRepository>
<repositories>
<repository>
<id>internal</id>
<name>Archiva Managed Internal Repository</name>
<location>${appserver.base}/repositories/internal</location>
<url>file://${appserver.base}/repositories/internal</url>
<layout>default</layout>
<releases>true</releases>
<snapshots>false</snapshots>
<indexed>true</indexed>
<refreshCronExpression>0 0 * * ?</refreshCronExpression>
</managedRepository>
<managedRepository>
</repository>
<repository>
<id>snapshots</id>
<name>Archiva Managed Snapshot Repository</name>
<location>${appserver.base}/repositories/snapshots</location>
<url>file://${appserver.base}/repositories/snapshots</url>
<layout>default</layout>
<releases>false</releases>
<snapshots>true</snapshots>
<indexed>true</indexed>
<refreshCronExpression>0 0,30 * * ?</refreshCronExpression>
</managedRepository>
</managedRepositories>
<remoteRepositories>
<remoteRepository>
</repository>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>http://repo1.maven.org/maven2</url>
<layout>default</layout>
<releases>true</releases>
<snapshots>false</snapshots>
</remoteRepository>
<remoteRepository>
<indexed>false</indexed>
</repository>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven 2</name>
<url>https://maven2-repository.dev.java.net/nonav/repository</url>
<layout>default</layout>
<releases>true</releases>
<snapshots>false</snapshots>
</remoteRepository>
</remoteRepositories>
<indexed>false</indexed>
</repository>
<repository>
<id>test-repo</id>
<name>Test Repository</name>
<url>file://${appserver.base}/test-repo</url>
<layout>default</layout>
<releases>true</releases>
<snapshots>true</snapshots>
<indexed>true</indexed>
<refreshCronExpression>0 0 * * ?</refreshCronExpression>
<daysOlder>100</daysOlder>
<deleteReleasedSnapshots>true</deleteReleasedSnapshots>
</repository>
</repositories>
<proxyConnectors>
<proxyConnector>

View File

@ -20,47 +20,58 @@
<configuration>
<version>1</version>
<managedRepositories>
<managedRepository>
<repositories>
<repository>
<id>internal</id>
<name>Archiva Managed Internal Repository</name>
<location>${appserver.base}/repositories/internal</location>
<url>file://${appserver.base}/repositories/internal</url>
<layout>default</layout>
<releases>true</releases>
<snapshots>false</snapshots>
<indexed>true</indexed>
<refreshCronExpression>0 0 * * ?</refreshCronExpression>
</managedRepository>
<managedRepository>
</repository>
<repository>
<id>snapshots</id>
<name>Archiva Managed Snapshot Repository</name>
<location>${appserver.base}/repositories/snapshots</location>
<url>file://${appserver.base}/repositories/snapshots</url>
<layout>default</layout>
<releases>false</releases>
<snapshots>true</snapshots>
<indexed>true</indexed>
<refreshCronExpression>0 0,30 * * ?</refreshCronExpression>
</managedRepository>
</managedRepositories>
<remoteRepositories>
<remoteRepository>
</repository>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>http://repo1.maven.org/maven2</url>
<layout>default</layout>
<releases>true</releases>
<snapshots>false</snapshots>
</remoteRepository>
<remoteRepository>
<indexed>false</indexed>
</repository>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven 2</name>
<url>https://maven2-repository.dev.java.net/nonav/repository</url>
<layout>default</layout>
<releases>true</releases>
<snapshots>false</snapshots>
</remoteRepository>
</remoteRepositories>
<indexed>false</indexed>
</repository>
<repository>
<id>test-repo</id>
<name>Test Repository</name>
<url>file://${appserver.base}/test-repo</url>
<layout>default</layout>
<releases>true</releases>
<snapshots>true</snapshots>
<indexed>true</indexed>
<refreshCronExpression>0 0 * * ?</refreshCronExpression>
<daysOlder>0</daysOlder>
<retentionCount>2</retentionCount>
</repository>
</repositories>
<proxyConnectors>
<proxyConnector>

View File

@ -21,6 +21,7 @@ package org.apache.maven.archiva.consumers.core.repository;
import org.apache.commons.io.FileUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
import org.apache.maven.archiva.database.ArchivaDatabaseException;
@ -101,9 +102,11 @@ public class RepositoryPurgeConsumerTest
private void addRepoToConfiguration( String configHint, ManagedRepositoryConfiguration repoConfiguration )
throws Exception
{
ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class,
configHint );
archivaConfiguration.getConfiguration().addManagedRepository( repoConfiguration );
ArchivaConfiguration archivaConfiguration =
(ArchivaConfiguration) lookup( ArchivaConfiguration.class, configHint );
Configuration configuration = archivaConfiguration.getConfiguration();
configuration.removeManagedRepository( configuration.findManagedRepositoryById( repoConfiguration.getId() ) );
configuration.addManagedRepository( repoConfiguration );
}
public void testConsumerByDaysOld()
@ -217,8 +220,8 @@ public class RepositoryPurgeConsumerTest
String metadataXml = FileUtils.readFileToString( artifactMetadataFile, null );
String expectedVersions = "<expected><versions><version>2.2</version>"
+ "<version>2.3</version></versions></expected>";
String expectedVersions =
"<expected><versions><version>2.2</version>" + "<version>2.3</version></versions></expected>";
XMLAssert.assertXpathEvaluatesTo( "2.3", "//metadata/versioning/latest", metadataXml );
XMLAssert.assertXpathsEqual( "//expected/versions/version", expectedVersions,