From 4b9ef913f999b1d4fa9d953443f3c7ddfea9c018 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 13 Sep 2011 13:22:36 +0000 Subject: [PATCH] [MRM-1504] Add a new module for repository administration management : remove some direct use of archivaconfiguration in the webapp git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1170171 13f79535-47bb-0310-9956-ffa450edef68 --- .../web/action/DeleteArtifactAction.java | 56 +++++++++++-------- .../AbstractRepositoriesAdminAction.java | 40 ------------- .../AddManagedRepositoryAction.java | 34 ----------- .../AddRemoteRepositoryAction.java | 25 --------- .../EditManagedRepositoryAction.java | 6 +- .../repositories/RepositoriesAction.java | 1 - .../repositories/SortRepositoriesAction.java | 47 ++++++++++++++++ .../web/action/DeleteArtifactActionTest.java | 3 +- .../AddManagedRepositoryActionTest.java | 1 - .../AddRemoteRepositoryActionTest.java | 2 +- .../DeleteManagedRepositoryActionTest.java | 1 - .../DeleteRemoteRepositoryActionTest.java | 1 - .../DeleteRepositoryGroupActionTest.java | 1 - .../EditManagedRepositoryActionTest.java | 1 - .../EditRemoteRepositoryActionTest.java | 1 - .../RepositoryGroupsActionTest.java | 2 +- 16 files changed, 86 insertions(+), 136 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java index 431075ccb..4ed4f50bd 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java @@ -21,6 +21,9 @@ package org.apache.maven.archiva.web.action; import com.opensymphony.xwork2.Preparable; import com.opensymphony.xwork2.Validateable; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.audit.Auditable; import org.apache.archiva.checksum.ChecksumAlgorithm; @@ -31,11 +34,13 @@ import org.apache.archiva.metadata.repository.MetadataRepositoryException; import org.apache.archiva.metadata.repository.MetadataResolutionException; import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.repository.events.RepositoryListener; +import org.apache.archiva.security.AccessDeniedException; +import org.apache.archiva.security.ArchivaSecurityException; +import org.apache.archiva.security.PrincipalNotFoundException; +import org.apache.archiva.security.UserRepositories; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.common.utils.VersionComparator; import org.apache.maven.archiva.common.utils.VersionUtil; -import org.apache.maven.archiva.configuration.ArchivaConfiguration; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.model.ArchivaRepositoryMetadata; import org.apache.maven.archiva.model.VersionedReference; import org.apache.maven.archiva.repository.ContentNotFoundException; @@ -47,10 +52,6 @@ import org.apache.maven.archiva.repository.metadata.MetadataTools; import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException; import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader; import org.apache.maven.archiva.repository.metadata.RepositoryMetadataWriter; -import org.apache.archiva.security.AccessDeniedException; -import org.apache.archiva.security.ArchivaSecurityException; -import org.apache.archiva.security.PrincipalNotFoundException; -import org.apache.archiva.security.UserRepositories; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; @@ -104,15 +105,15 @@ public class DeleteArtifactAction @Inject private UserRepositories userRepositories; - @Inject - private ArchivaConfiguration configuration; - @Inject private RepositoryContentFactory repositoryFactory; @Inject private List listeners; + @Inject + private ManagedRepositoryAdmin managedRepositoryAdmin; + private ChecksumAlgorithm[] algorithms = new ChecksumAlgorithm[]{ ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 }; @PostConstruct @@ -193,22 +194,21 @@ public class DeleteArtifactAction public String doDelete() { - Date lastUpdatedTimestamp = Calendar.getInstance().getTime(); - - TimeZone timezone = TimeZone.getTimeZone( "UTC" ); - DateFormat fmt = new SimpleDateFormat( "yyyyMMdd.HHmmss" ); - fmt.setTimeZone( timezone ); - ManagedRepositoryConfiguration repoConfig = - configuration.getConfiguration().findManagedRepositoryById( repositoryId ); - - VersionedReference ref = new VersionedReference(); - ref.setArtifactId( artifactId ); - ref.setGroupId( groupId ); - ref.setVersion( version ); RepositorySession repositorySession = repositorySessionFactory.createSession(); try { + Date lastUpdatedTimestamp = Calendar.getInstance().getTime(); + + TimeZone timezone = TimeZone.getTimeZone( "UTC" ); + DateFormat fmt = new SimpleDateFormat( "yyyyMMdd.HHmmss" ); + fmt.setTimeZone( timezone ); + ManagedRepository repoConfig = getManagedRepositoryAdmin().getManagedRepository( repositoryId ); + + VersionedReference ref = new VersionedReference(); + ref.setArtifactId( artifactId ); + ref.setGroupId( groupId ); + ref.setVersion( version ); ManagedRepositoryContent repository = repositoryFactory.getManagedRepositoryContent( repositoryId ); String path = repository.toMetadataPath( ref ); @@ -280,6 +280,11 @@ public class DeleteArtifactAction addActionError( "Repository exception: " + e.getMessage() ); return ERROR; } + catch ( RepositoryAdminException e ) + { + addActionError( "RepositoryAdmin exception: " + e.getMessage() ); + return ERROR; + } finally { repositorySession.close(); @@ -453,8 +458,13 @@ public class DeleteArtifactAction this.repositoryFactory = repositoryFactory; } - public void setConfiguration( ArchivaConfiguration configuration ) + public ManagedRepositoryAdmin getManagedRepositoryAdmin() + { + return managedRepositoryAdmin; + } + + public void setManagedRepositoryAdmin( ManagedRepositoryAdmin managedRepositoryAdmin ) { - this.configuration = configuration; + this.managedRepositoryAdmin = managedRepositoryAdmin; } } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java index e2bc9f43b..4de336c02 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java @@ -50,19 +50,12 @@ public abstract class AbstractRepositoriesAdminAction implements SecureAction, Auditable { - @Inject - protected ArchivaConfiguration archivaConfiguration; - @Inject private ManagedRepositoryAdmin managedRepositoryAdmin; @Inject private RepositoryCommonValidator repositoryCommonValidator; - public ArchivaConfiguration getArchivaConfiguration() - { - return archivaConfiguration; - } public SecureActionBundle getSecureActionBundle() throws SecureActionException @@ -75,40 +68,7 @@ public abstract class AbstractRepositoriesAdminAction return bundle; } - public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) - { - this.archivaConfiguration = archivaConfiguration; - } - /** - * Save the configuration. - * - * @param configuration the configuration to save. - * @return the webwork result code to issue. - * @throws IOException thrown if unable to save file to disk. - * @throws InvalidConfigurationException thrown if configuration is invalid. - * @throws RegistryException thrown if configuration subsystem has a problem saving the configuration to disk. - */ - protected String saveConfiguration( Configuration configuration ) - { - try - { - archivaConfiguration.save( configuration ); - addActionMessage( "Successfully saved configuration" ); - } - catch ( IndeterminateConfigurationException e ) - { - addActionError( e.getMessage() ); - return INPUT; - } - catch ( RegistryException e ) - { - addActionError( "Configuration Registry Exception: " + e.getMessage() ); - return INPUT; - } - - return SUCCESS; - } public ManagedRepositoryAdmin getManagedRepositoryAdmin() { diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java index 24e9714f0..dfb1aa39a 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java @@ -24,8 +24,6 @@ import com.opensymphony.xwork2.Validateable; import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.lang.StringUtils; -import org.apache.maven.archiva.configuration.Configuration; -import org.codehaus.redback.components.scheduler.CronExpressionValidator; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; @@ -101,41 +99,9 @@ public class AddManagedRepositoryAction return result; } - // FIXME olamy dupe with admin repo component @Override public void validate() { - Configuration config = archivaConfiguration.getConfiguration(); - - CronExpressionValidator validator = new CronExpressionValidator(); - String repoId = repository.getId(); - - if ( config.getManagedRepositoriesAsMap().containsKey( repoId ) ) - { - addFieldError( "repository.id", "Unable to add new repository with id [" + repoId - + "], that id already exists as a managed repository." ); - } - else if ( config.getRemoteRepositoriesAsMap().containsKey( repoId ) ) - { - addFieldError( "repository.id", "Unable to add new repository with id [" + repoId - + "], that id already exists as a remote repository." ); - } - else if ( config.getRepositoryGroupsAsMap().containsKey( repoId ) ) - { - addFieldError( "repository.id", "Unable to add new repository with id [" + repoId - + "], that id already exists as a repository group." ); - } - else if ( repoId.toLowerCase().contains( "stage" ) ) - { - addFieldError( "repository.id", "Unable to add new repository with id [" + repoId - + "], repository id cannot contains word stage" ); - } - - if ( !validator.validate( repository.getCronExpression() ) ) - { - addFieldError( "repository.refreshCronExpression", "Invalid cron expression." ); - } - // trim all unecessary trailing/leading white-spaces; always put this statement before the closing braces(after all validation). trimAllRequestParameterValues(); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java index 4261dc028..8561bb1af 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java @@ -23,7 +23,6 @@ import com.opensymphony.xwork2.Preparable; import com.opensymphony.xwork2.Validateable; import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.remote.RemoteRepository; -import org.apache.maven.archiva.configuration.Configuration; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; @@ -70,30 +69,6 @@ public class AddRemoteRepositoryAction return result; } - // FIXME olamy dupe with admin repo component - @Override - public void validate() - { - Configuration config = archivaConfiguration.getConfiguration(); - - String repoId = repository.getId(); - - if ( config.getManagedRepositoriesAsMap().containsKey( repoId ) ) - { - addFieldError( "repository.id", "Unable to add new repository with id [" + repoId - + "], that id already exists as a managed repository." ); - } - else if ( config.getRemoteRepositoriesAsMap().containsKey( repoId ) ) - { - addFieldError( "repository.id", "Unable to add new repository with id [" + repoId - + "], that id already exists as a remote repository." ); - } - else if ( config.getRepositoryGroupsAsMap().containsKey( repoId ) ) - { - addFieldError( "repository.id", "Unable to add new repository with id [" + repoId - + "], that id already exists as a repository group." ); - } - } public RemoteRepository getRepository() { diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java index 14732f956..6a76ba21c 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java @@ -24,7 +24,6 @@ import com.opensymphony.xwork2.Validateable; import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.lang.StringUtils; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.codehaus.redback.components.scheduler.CronExpressionValidator; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; @@ -87,11 +86,10 @@ public class EditManagedRepositoryAction return save( true ); } - // FIXME olamy use ManagedRepositoryAdmin rather tha, directly archivaConfiguration public String commit() + throws RepositoryAdminException { - ManagedRepositoryConfiguration existingConfig = - archivaConfiguration.getConfiguration().findManagedRepositoryById( repository.getId() ); + ManagedRepository existingConfig = getManagedRepositoryAdmin().getManagedRepository( repository.getId() ); boolean resetStats = false; // check if the location was changed diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java index a8af45def..359e69d76 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java @@ -34,7 +34,6 @@ import org.apache.archiva.metadata.repository.stats.RepositoryStatistics; import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.archiva.web.util.ContextUtils; -import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.web.action.AbstractActionSupport; import org.apache.struts2.interceptor.ServletRequestAware; import org.codehaus.plexus.redback.rbac.Resource; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java index 1b15394d6..bc0589711 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java @@ -20,11 +20,15 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; +import org.codehaus.plexus.registry.RegistryException; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; +import javax.inject.Inject; import java.util.List; /** @@ -41,6 +45,9 @@ public class SortRepositoriesAction private String targetRepo; + @Inject + protected ArchivaConfiguration archivaConfiguration; + public String sortDown() { Configuration config = archivaConfiguration.getConfiguration(); @@ -75,6 +82,36 @@ public class SortRepositoriesAction return saveConfiguration( config ); } +/** + * Save the configuration. + * + * @param configuration the configuration to save. + * @return the webwork result code to issue. + * @throws java.io.IOException thrown if unable to save file to disk. + * @throws org.apache.maven.archiva.configuration.InvalidConfigurationException thrown if configuration is invalid. + * @throws org.codehaus.plexus.registry.RegistryException thrown if configuration subsystem has a problem saving the configuration to disk. + */ + protected String saveConfiguration( Configuration configuration ) + { + try + { + archivaConfiguration.save( configuration ); + addActionMessage( "Successfully saved configuration" ); + } + catch ( IndeterminateConfigurationException e ) + { + addActionError( e.getMessage() ); + return INPUT; + } + catch ( RegistryException e ) + { + addActionError( "Configuration Registry Exception: " + e.getMessage() ); + return INPUT; + } + + return SUCCESS; + } + public String getRepoGroupId() { return repoGroupId; @@ -121,4 +158,14 @@ public class SortRepositoriesAction { return ( idx >= 0 ) && ( idx < repositories.size() ); } + + public ArchivaConfiguration getArchivaConfiguration() + { + return archivaConfiguration; + } + + public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) + { + this.archivaConfiguration = archivaConfiguration; + } } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java index c13829d58..ad5db8f78 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java @@ -21,6 +21,7 @@ package org.apache.maven.archiva.web.action; import net.sf.beanlib.provider.replicator.BeanReplicator; import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.RepositorySession; @@ -102,7 +103,7 @@ public class DeleteArtifactActionTest repositorySessionFactory.setRepositorySession( repositorySession ); - action.setConfiguration( configuration ); + (( DefaultManagedRepositoryAdmin)action.getManagedRepositoryAdmin()).setArchivaConfiguration( configuration ); action.setRepositoryFactory( repositoryFactory ); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java index e3bab24e6..d67b037e9 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java @@ -81,7 +81,6 @@ public class AddManagedRepositoryActionTest archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); - action.setArchivaConfiguration( archivaConfiguration ); roleManagerControl = MockControl.createControl( RoleManager.class ); roleManager = (RoleManager) roleManagerControl.getMock(); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java index adf74c7f9..c2880a0d5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java @@ -56,7 +56,7 @@ public class AddRemoteRepositoryActionTest archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); - action.setArchivaConfiguration( archivaConfiguration ); + ( (DefaultRemoteRepositoryAdmin) action.getRemoteRepositoryAdmin() ).setArchivaConfiguration( archivaConfiguration ); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java index 8a9dfdd7b..a480e4770 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java @@ -99,7 +99,6 @@ public class DeleteManagedRepositoryActionTest archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); - action.setArchivaConfiguration( archivaConfiguration ); roleManagerControl = MockControl.createControl( RoleManager.class ); roleManager = (RoleManager) roleManagerControl.getMock(); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java index 8493e47ee..e714107f8 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java @@ -61,7 +61,6 @@ public class DeleteRemoteRepositoryActionTest archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); - action.setArchivaConfiguration( archivaConfiguration ); ( (DefaultRemoteRepositoryAdmin) action.getRemoteRepositoryAdmin() ).setArchivaConfiguration( archivaConfiguration ); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java index e83c8d099..c5ad973b2 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java @@ -56,7 +56,6 @@ public class DeleteRepositoryGroupActionTest archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); - action.setArchivaConfiguration( archivaConfiguration ); ( (DefaultRepositoryGroupAdmin) action.getRepositoryGroupAdmin() ).setArchivaConfiguration( archivaConfiguration ); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java index bda413032..df4b07cf0 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java @@ -92,7 +92,6 @@ public class EditManagedRepositoryActionTest archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); - action.setArchivaConfiguration( archivaConfiguration ); roleManagerControl = MockControl.createControl( RoleManager.class ); roleManager = (RoleManager) roleManagerControl.getMock(); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java index f89c14598..47c90182a 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java @@ -64,7 +64,6 @@ public class EditRemoteRepositoryActionTest archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); - action.setArchivaConfiguration( archivaConfiguration ); ( (DefaultRemoteRepositoryAdmin) action.getRemoteRepositoryAdmin() ).setArchivaConfiguration( archivaConfiguration ); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java index 844778aa9..0d7600b28 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java @@ -65,7 +65,7 @@ public class RepositoryGroupsActionTest archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); - action.setArchivaConfiguration( archivaConfiguration ); + ( (DefaultRepositoryGroupAdmin) action.getRepositoryGroupAdmin() ).setArchivaConfiguration( archivaConfiguration ); ( (DefaultManagedRepositoryAdmin) ( (DefaultRepositoryGroupAdmin) action.getRepositoryGroupAdmin() ).getManagedRepositoryAdmin() ).setArchivaConfiguration( -- 2.39.5