[MRM-694]

changes by Nap Ramirez, Maria Catherine Tan, Henry Isidro, Brett Porter and myself

-add repositoryGroups in configuration 
-updated ArchivaConfiguration and added test for this change


git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@649364 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maria Odea B. Ching 2008-04-18 04:38:48 +00:00
parent f350582905
commit fada72428f
5 changed files with 52 additions and 3 deletions

View File

@ -87,7 +87,7 @@
</execution>
</executions>
<configuration>
<version>1.1.0</version>
<version>1.2.0</version>
<model>src/main/mdo/configuration.mdo</model>
</configuration>
</plugin>

View File

@ -416,7 +416,7 @@ public class DefaultArchivaConfiguration
if ( key.startsWith( "repositories" ) || key.startsWith( "proxyConnectors" )
|| key.startsWith( "networkProxies" ) || key.startsWith( "repositoryScanning" )
|| key.startsWith( "databaseScanning" ) || key.startsWith( "remoteRepositories" )
|| key.startsWith( "managedRepositories" ) )
|| key.startsWith( "managedRepositories" ) || key.startsWith( "repositoryGroups" ) )
{
foundList = true;
}
@ -455,6 +455,10 @@ public class DefaultArchivaConfiguration
{
section.removeSubset( "legacyArtifactPaths" );
}
if ( configuration.getRepositoryGroups().isEmpty() )
{
section.removeSubset( "repositoryGroups" );
}
if ( configuration.getRepositoryScanning() != null )
{
if ( configuration.getRepositoryScanning().getKnownContentConsumers().isEmpty() )

View File

@ -56,6 +56,15 @@
<multiplicity>*</multiplicity>
</association>
</field>
<field>
<name>repositoryGroups</name>
<version>1.2.0+</version>
<association>
<type>RepositoryGroupConfiguration</type>
<multiplicity>*</multiplicity>
</association>
<description>The list of repository groups.</description>
</field>
<field>
<name>managedRepositories</name>
<version>1.0.0+</version>
@ -511,6 +520,28 @@
</codeSegment>
</codeSegments>
</class>
<class>
<name>RepositoryGroupConfiguration</name>
<version>1.2.0+</version>
<fields>
<field>
<name>id</name>
<version>1.2.0+</version>
<type>String</type>
<required>true</required>
<description>The id of the repository group.</description>
</field>
<field>
<name>repositories</name>
<version>1.2.0+</version>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
</association>
<description>The list of repository ids under the group.</description>
</field>
</fields>
</class>
<!--
____ _

View File

@ -20,6 +20,14 @@
<configuration>
<version>2</version>
<repositoryGroups>
<repositoryGroup>
<id>default</id>
<repositories>
<repository>snapshots</repository>
</repositories>
</repositoryGroup>
</repositoryGroups>
<managedRepositories>
<managedRepository>
<id>snapshots</id>

View File

@ -686,7 +686,12 @@ public class ArchivaConfigurationTest
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-remove-central" );
Configuration configuration = archivaConfiguration.getConfiguration();
RepositoryGroupConfiguration repositoryGroup = ( RepositoryGroupConfiguration ) configuration.getRepositoryGroups().get( 0 );
assertNotNull( repositoryGroup );
configuration.removeRepositoryGroup( repositoryGroup );
assertTrue( configuration.getRepositoryGroups().isEmpty() );
RemoteRepositoryConfiguration repository = configuration.getRemoteRepositoriesAsMap().get( "central" );
assertNotNull( repository );
configuration.removeRemoteRepository( repository );
@ -740,6 +745,7 @@ public class ArchivaConfigurationTest
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-read-saved" );
configuration = archivaConfiguration.getConfiguration();
assertNull( configuration.getRemoteRepositoriesAsMap().get( "central" ) );
assertTrue( configuration.getRepositoryGroups().isEmpty() );
assertNull( configuration.getManagedRepositoriesAsMap().get( "snapshots" ) );
assertTrue( configuration.getProxyConnectors().isEmpty() );
assertNull( configuration.getNetworkProxiesAsMap().get( "proxy" ) );