archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1170135 [8/9] - in /archiva/trunk: ./ archiva-cli/src/main/java/org/apache/maven/archiva/cli/ archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/ archiva-modules/archiva-base/archiva-configuration/src...
Date Tue, 13 Sep 2011 12:12:52 GMT
Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java Tue Sep 13 12:12:39 2011
@@ -21,9 +21,9 @@ package org.apache.maven.archiva.web.act
 
 import com.opensymphony.xwork2.Preparable;
 import com.opensymphony.xwork2.Validateable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.admin.ArchivaAdministration;
-import org.apache.archiva.admin.repository.admin.LegacyArtifactPath;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.admin.ArchivaAdministration;
+import org.apache.archiva.admin.model.admin.LegacyArtifactPath;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java Tue Sep 13 12:12:39 2011
@@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.act
  * under the License.
  */
 
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.admin.ArchivaAdministration;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.admin.ArchivaAdministration;
 import org.apache.maven.archiva.web.action.AbstractActionSupport;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Controller;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java Tue Sep 13 12:12:39 2011
@@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Preparable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.admin.ArchivaAdministration;
-import org.apache.archiva.admin.repository.admin.LegacyArtifactPath;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.admin.ArchivaAdministration;
+import org.apache.archiva.admin.model.admin.LegacyArtifactPath;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 import org.apache.archiva.web.util.ContextUtils;
 import org.apache.maven.archiva.web.action.AbstractActionSupport;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java Tue Sep 13 12:12:39 2011
@@ -21,9 +21,9 @@ package org.apache.maven.archiva.web.act
 
 import com.opensymphony.xwork2.Preparable;
 import com.opensymphony.xwork2.Validateable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.networkproxy.NetworkProxy;
-import org.apache.archiva.admin.repository.networkproxy.NetworkProxyAdmin;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.networkproxy.NetworkProxy;
+import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.web.action.AbstractActionSupport;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java Tue Sep 13 12:12:39 2011
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Preparable;
-import org.apache.archiva.admin.repository.networkproxy.NetworkProxy;
-import org.apache.archiva.admin.repository.networkproxy.NetworkProxyAdmin;
+import org.apache.archiva.admin.model.networkproxy.NetworkProxy;
+import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 import org.apache.maven.archiva.web.action.AbstractActionSupport;
 import org.codehaus.plexus.redback.rbac.Resource;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java Tue Sep 13 12:12:39 2011
@@ -1,6 +1,6 @@
 package org.apache.maven.archiva.web.action.admin.repositories;
 
-import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin;
+import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
 
 import javax.inject.Inject;
 

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java Tue Sep 13 12:12:39 2011
@@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.act
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.repository.RepositoryCommonValidator;
-import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.audit.Auditable;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java Tue Sep 13 12:12:39 2011
@@ -21,8 +21,8 @@ package org.apache.maven.archiva.web.act
 
 import com.opensymphony.xwork2.Preparable;
 import com.opensymphony.xwork2.Validateable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.managed.ManagedRepository;
+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;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java Tue Sep 13 12:12:39 2011
@@ -21,8 +21,8 @@ package org.apache.maven.archiva.web.act
 
 import com.opensymphony.xwork2.Preparable;
 import com.opensymphony.xwork2.Validateable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.remote.RemoteRepository;
+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;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java Tue Sep 13 12:12:39 2011
@@ -20,7 +20,8 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Preparable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
+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.springframework.context.annotation.Scope;
@@ -39,20 +40,19 @@ public class DeleteManagedRepositoryActi
 {
 
 
-    private ManagedRepositoryConfiguration repository;
+    private ManagedRepository repository;
 
-    private ManagedRepositoryConfiguration stagingRepository;
+    private ManagedRepository stagingRepository;
 
     private String repoid;
 
-    // FIXME olamy use ManagedRepositoryAdmin rather tha, directly archivaConfiguration
     public void prepare()
+        throws RepositoryAdminException
     {
         if ( StringUtils.isNotBlank( repoid ) )
         {
-            this.repository = archivaConfiguration.getConfiguration().findManagedRepositoryById( repoid );
-            this.stagingRepository =
-                archivaConfiguration.getConfiguration().findManagedRepositoryById( repoid + "-stage" );
+            this.repository = getManagedRepositoryAdmin().getManagedRepository( repoid );
+            this.stagingRepository = getManagedRepositoryAdmin().getManagedRepository( repoid + "-stage" );
         }
     }
 
@@ -79,7 +79,7 @@ public class DeleteManagedRepositoryActi
 
     private String deleteRepository( boolean deleteContents )
     {
-        ManagedRepositoryConfiguration existingRepository = repository;
+        ManagedRepository existingRepository = repository;
         if ( existingRepository == null )
         {
             addActionError( "A repository with that id does not exist" );
@@ -103,12 +103,12 @@ public class DeleteManagedRepositoryActi
         return result;
     }
 
-    public ManagedRepositoryConfiguration getRepository()
+    public ManagedRepository getRepository()
     {
         return repository;
     }
 
-    public void setRepository( ManagedRepositoryConfiguration repository )
+    public void setRepository( ManagedRepository repository )
     {
         this.repository = repository;
     }

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java Tue Sep 13 12:12:39 2011
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Preparable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.remote.RemoteRepository;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.remote.RemoteRepository;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Controller;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java Tue Sep 13 12:12:39 2011
@@ -20,16 +20,18 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Preparable;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.group.RepositoryGroup;
+import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
 import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Controller;
 
+import javax.inject.Inject;
+
 /**
  * DeleteRepositoryGroupAction
- *
  */
 @Controller( "deleteRepositoryGroupAction" )
 @Scope( "prototype" )
@@ -37,15 +39,20 @@ public class DeleteRepositoryGroupAction
     extends AbstractRepositoriesAdminAction
     implements Preparable
 {
-    private RepositoryGroupConfiguration repositoryGroup;
+    private RepositoryGroup repositoryGroup;
+
+    @Inject
+    private RepositoryGroupAdmin repositoryGroupAdmin;
 
     private String repoGroupId;
 
     public void prepare()
+        throws RepositoryAdminException
     {
+
         if ( StringUtils.isNotBlank( repoGroupId ) )
         {
-            this.repositoryGroup = archivaConfiguration.getConfiguration().findRepositoryGroupById( repoGroupId );
+            this.repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( repoGroupId );
         }
     }
 
@@ -62,26 +69,32 @@ public class DeleteRepositoryGroupAction
 
     public String delete()
     {
-        Configuration config = archivaConfiguration.getConfiguration();
 
-        RepositoryGroupConfiguration group = config.findRepositoryGroupById( repoGroupId );
-        if ( group == null )
+        try
         {
-            addActionError( "A repository group with that id does not exist." );
+            RepositoryGroup group = repositoryGroupAdmin.getRepositoryGroup( repoGroupId );
+            if ( group == null )
+            {
+                addActionError( "A repository group with that id does not exist." );
+                return ERROR;
+            }
+
+            repositoryGroupAdmin.deleteRepositoryGroup( repoGroupId, getAuditInformation() );
+            return SUCCESS;
+        }
+        catch ( RepositoryAdminException e )
+        {
+            addActionError( "error occured " + e.getMessage() );
             return ERROR;
         }
-
-        config.removeRepositoryGroup( group );
-        triggerAuditEvent( AuditEvent.DELETE_REPO_GROUP + " " + repoGroupId );
-        return saveConfiguration( config );
     }
 
-    public RepositoryGroupConfiguration getRepositoryGroup()
+    public RepositoryGroup getRepositoryGroup()
     {
         return repositoryGroup;
     }
 
-    public void setRepositoryGroup( RepositoryGroupConfiguration repositoryGroup )
+    public void setRepositoryGroup( RepositoryGroup repositoryGroup )
     {
         this.repositoryGroup = repositoryGroup;
     }

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java Tue Sep 13 12:12:39 2011
@@ -21,8 +21,8 @@ package org.apache.maven.archiva.web.act
 
 import com.opensymphony.xwork2.Preparable;
 import com.opensymphony.xwork2.Validateable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.managed.ManagedRepository;
+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;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java Tue Sep 13 12:12:39 2011
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Preparable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.remote.RemoteRepository;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.remote.RemoteRepository;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Controller;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java Tue Sep 13 12:12:39 2011
@@ -20,12 +20,12 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Preparable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.group.RepositoryGroupAdmin;
-import org.apache.archiva.admin.repository.managed.ManagedRepository;
-import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.admin.repository.remote.RemoteRepository;
-import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.model.remote.RemoteRepository;
+import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
 import org.apache.archiva.admin.repository.utils.RepositoryComparator;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
@@ -35,7 +35,6 @@ import org.apache.archiva.metadata.repos
 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.configuration.Configuration;
 import org.apache.maven.archiva.web.action.AbstractActionSupport;
 import org.apache.struts2.interceptor.ServletRequestAware;
 import org.codehaus.plexus.redback.rbac.Resource;
@@ -66,9 +65,6 @@ public class RepositoriesAction
 {
 
     @Inject
-    private ArchivaConfiguration archivaConfiguration;
-
-    @Inject
     private ManagedRepositoryAdmin managedRepositoryAdmin;
 
     @Inject

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java Tue Sep 13 12:12:39 2011
@@ -20,10 +20,10 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Preparable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.group.RepositoryGroup;
-import org.apache.archiva.admin.repository.group.RepositoryGroupAdmin;
-import org.apache.archiva.admin.repository.managed.ManagedRepository;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.group.RepositoryGroup;
+import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.web.util.ContextUtils;
 import org.apache.struts2.interceptor.ServletRequestAware;
 import org.springframework.context.annotation.Scope;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java Tue Sep 13 12:12:39 2011
@@ -29,13 +29,14 @@ import java.util.List;
 
 /**
  * SortRepositoriesAction
- *
+ * FIXME remove access to archivaconfiguration
  */
 @Controller( "sortRepositoriesAction" )
 @Scope( "prototype" )
 public class SortRepositoriesAction
     extends AbstractRepositoriesAdminAction
 {
+
     private String repoGroupId;
 
     private String targetRepo;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java Tue Sep 13 12:12:39 2011
@@ -21,9 +21,9 @@ package org.apache.maven.archiva.web.act
 
 import com.opensymphony.xwork2.Preparable;
 import com.opensymphony.xwork2.Validateable;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.admin.ArchivaAdministration;
-import org.apache.archiva.admin.repository.admin.FileType;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.admin.ArchivaAdministration;
+import org.apache.archiva.admin.model.admin.FileType;
 import org.apache.archiva.admin.repository.admin.FiletypeToMapClosure;
 import org.apache.archiva.audit.Auditable;
 import org.apache.archiva.repository.scanner.RepositoryContentConsumers;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java Tue Sep 13 12:12:39 2011
@@ -19,6 +19,8 @@ package org.apache.maven.archiva.web.act
  * under the License.
  */
 
+import net.sf.beanlib.provider.replicator.BeanReplicator;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.RepositorySession;
@@ -131,7 +133,9 @@ public class DeleteArtifactActionTest
         Configuration config = createConfiguration();
 
         ManagedRepositoryContent repoContent = new ManagedDefaultRepositoryContent();
-        repoContent.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) );
+        repoContent.setRepository(
+            new BeanReplicator().replicateBean( config.findManagedRepositoryById( REPOSITORY_ID ),
+                                                ManagedRepository.class ) );
 
         configurationControl.expectAndReturn( configuration.getConfiguration(), config );
         repositoryFactoryControl.expectAndReturn( repositoryFactory.getManagedRepositoryContent( REPOSITORY_ID ),

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,6 +20,8 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Action;
+import net.sf.beanlib.provider.replicator.BeanReplicator;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.Dependency;
 import org.apache.archiva.metadata.model.MailingList;
@@ -58,7 +60,7 @@ public class ShowArtifactActionTest
     private static final String TEST_SNAPSHOT_VERSION = "1.0-SNAPSHOT";
 
     private static final String TEST_TS_SNAPSHOT_VERSION = "1.0-20091120.111111-1";
-    
+
     private static final String TEST_NAMESPACE = "namespace";
 
     private static final String OTHER_TEST_REPO = "first-repo";
@@ -74,6 +76,44 @@ public class ShowArtifactActionTest
 
     private static final String TEST_TYPE = "jar";
 
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+        action = (ShowArtifactAction) getActionProxy( "/showArtifact.action" ).getAction();
+
+        metadataResolver = new TestMetadataResolver();
+        MetadataRepository repo = mock( MetadataRepository.class );
+        RepositorySession repositorySession = mock( RepositorySession.class );
+        when( repositorySession.getResolver() ).thenReturn( metadataResolver );
+        when( repositorySession.getRepository() ).thenReturn( repo );
+        TestRepositorySessionFactory repositorySessionFactory =
+            applicationContext.getBean( "repositorySessionFactory#test", TestRepositorySessionFactory.class );
+        repositorySessionFactory.setRepositorySession( repositorySession );
+
+        RepositoryContentFactory factory = mock( RepositoryContentFactory.class );
+
+        action.setRepositoryFactory( factory );
+
+        ManagedRepository config = new ManagedRepository();
+        config.setId( TEST_REPO );
+        config.setLocation( new File( "target/test-repo" ).getAbsolutePath() );
+
+        ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
+        content.setRepository( config );
+        when( factory.getManagedRepositoryContent( TEST_REPO ) ).thenReturn( content );
+
+        ArchivaConfiguration archivaConfig = mock( ArchivaConfiguration.class );
+
+        Configuration configuration = new Configuration();
+        configuration.addManagedRepository(
+            new BeanReplicator().replicateBean( config, ManagedRepositoryConfiguration.class ) );
+        when( archivaConfig.getConfiguration() ).thenReturn( configuration );
+
+        when( factory.getArchivaConfiguration() ).thenReturn( archivaConfig );
+
+    }
+
     public void testInstantiation()
     {
         assertFalse( action == getActionProxy( "/showArtifact.action" ).getAction() );
@@ -293,49 +333,49 @@ public class ShowArtifactActionTest
         assertNull( action.getMailingLists() );
         assertTrue( action.getArtifacts().isEmpty() );
     }
-    
+
     public void testMetadataHasRepositoryFacetProblem()
     {
         String errMsg = "Error in resolving artifact's parent POM file: Sample Parent POM not found";
-        ProjectVersionMetadata metaData = createProjectModel(TEST_SNAPSHOT_VERSION);
-        metaData.addFacet( createRepositoryProblemFacet( TEST_REPO, errMsg, 
-                                                         TEST_GROUP_ID, TEST_SNAPSHOT_VERSION, TEST_NAMESPACE ) );
-        
-        
+        ProjectVersionMetadata metaData = createProjectModel( TEST_SNAPSHOT_VERSION );
+        metaData.addFacet(
+            createRepositoryProblemFacet( TEST_REPO, errMsg, TEST_GROUP_ID, TEST_SNAPSHOT_VERSION, TEST_NAMESPACE ) );
+
         metadataResolver.setProjectVersion( TEST_REPO, TEST_GROUP_ID, TEST_ARTIFACT_ID, metaData );
-        
+
         metadataResolver.setArtifacts( TEST_REPO, TEST_GROUP_ID, TEST_ARTIFACT_ID, TEST_SNAPSHOT_VERSION,
-                                  TEST_SNAPSHOT_ARTIFACTS );
+                                       TEST_SNAPSHOT_ARTIFACTS );
 
         action.setGroupId( TEST_GROUP_ID );
         action.setArtifactId( TEST_ARTIFACT_ID );
         action.setVersion( TEST_SNAPSHOT_VERSION );
 
         String result = action.artifact();
-        
+
         assertEquals( Action.SUCCESS, result );
 
         assertTrue( action.hasActionErrors() );
         assertFalse( action.hasActionMessages() );
         assertEquals( "Artifact metadata is incomplete: " + errMsg, action.getActionErrors().toArray()[0].toString() );
     }
-    
+
     public void testMetadataIncomplete()
     {
-        ProjectVersionMetadata metaData = createProjectModel(TEST_SNAPSHOT_VERSION);
+        ProjectVersionMetadata metaData = createProjectModel( TEST_SNAPSHOT_VERSION );
         metaData.setIncomplete( true );
-        
+
         metadataResolver.setProjectVersion( TEST_REPO, TEST_GROUP_ID, TEST_ARTIFACT_ID, metaData );
-        
+
         metadataResolver.setArtifacts( TEST_REPO, TEST_GROUP_ID, TEST_ARTIFACT_ID, TEST_SNAPSHOT_VERSION,
-                                  TEST_SNAPSHOT_ARTIFACTS );
+                                       TEST_SNAPSHOT_ARTIFACTS );
 
         action.setGroupId( TEST_GROUP_ID );
         action.setArtifactId( TEST_ARTIFACT_ID );
-        action.setVersion( TEST_SNAPSHOT_VERSION );;
+        action.setVersion( TEST_SNAPSHOT_VERSION );
+        ;
 
         String result = action.artifact();
-        
+
         assertEquals( Action.SUCCESS, result );
 
         assertTrue( action.hasActionErrors() );
@@ -679,8 +719,9 @@ public class ShowArtifactActionTest
         assertTrue( action.getActionErrors().isEmpty() );
         assertTrue( action.getActionMessages().isEmpty() );
     }
-    
-    private RepositoryProblemFacet createRepositoryProblemFacet( String repoId, String errMsg, String projectId, String projectVersion, String namespace )
+
+    private RepositoryProblemFacet createRepositoryProblemFacet( String repoId, String errMsg, String projectId,
+                                                                 String projectVersion, String namespace )
     {
         RepositoryProblemFacet repoProblemFacet = new RepositoryProblemFacet();
         repoProblemFacet.setRepositoryId( repoId );
@@ -692,41 +733,4 @@ public class ShowArtifactActionTest
         repoProblemFacet.setNamespace( namespace );
         return repoProblemFacet;
     }
-
-    protected void setUp()
-        throws Exception
-    {
-        super.setUp();
-        action = (ShowArtifactAction) getActionProxy( "/showArtifact.action" ).getAction();
-
-        metadataResolver = new TestMetadataResolver();
-        MetadataRepository repo = mock( MetadataRepository.class );
-        RepositorySession repositorySession = mock( RepositorySession.class );
-        when( repositorySession.getResolver() ).thenReturn( metadataResolver );
-        when( repositorySession.getRepository() ).thenReturn( repo );
-        TestRepositorySessionFactory repositorySessionFactory =
-            applicationContext.getBean( "repositorySessionFactory#test", TestRepositorySessionFactory.class );
-        repositorySessionFactory.setRepositorySession( repositorySession );
-
-        RepositoryContentFactory factory = mock( RepositoryContentFactory.class );
-
-        action.setRepositoryFactory( factory );
-
-        ManagedRepositoryConfiguration config = new ManagedRepositoryConfiguration();
-        config.setId( TEST_REPO );
-        config.setLocation( new File( "target/test-repo" ).getAbsolutePath() );
-
-        ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
-        content.setRepository( config );
-        when( factory.getManagedRepositoryContent( TEST_REPO ) ).thenReturn( content );
-
-        ArchivaConfiguration archivaConfig = mock( ArchivaConfiguration.class );
-
-        Configuration configuration = new Configuration();
-        configuration.addManagedRepository( config );
-        when( archivaConfig.getConfiguration() ).thenReturn( configuration );
-
-        when( factory.getArchivaConfiguration() ).thenReturn( archivaConfig );
-
-    }
 }

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/UploadActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/UploadActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/UploadActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/UploadActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,6 +20,8 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Action;
+import net.sf.beanlib.provider.replicator.BeanReplicator;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.audit.AuditEvent;
 import org.apache.archiva.audit.AuditListener;
 import org.apache.archiva.checksum.ChecksumAlgorithm;
@@ -140,19 +142,22 @@ public class UploadActionTest
     private void assertAllArtifactsIncludingSupportArtifactsArePresent( String repoLocation, String artifact,
                                                                         String version )
     {
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar" ).exists() );
+        assertTrue( new File( repoLocation,
+                              "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar" ).exists() );
         assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact
             + ".jar.sha1" ).exists() );
         assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact
             + ".jar.md5" ).exists() );
 
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom" ).exists() );
+        assertTrue( new File( repoLocation,
+                              "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom" ).exists() );
         assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact
             + ".pom.sha1" ).exists() );
         assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact
             + ".pom.md5" ).exists() );
 
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() );
+        assertTrue(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() );
         assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA
             + ".sha1" ).exists() );
         assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA
@@ -162,40 +167,37 @@ public class UploadActionTest
     private void verifyVersionMetadataChecksums( String repoLocation, String version )
         throws IOException
     {
-        ChecksummedFile checksum =
-            new ChecksummedFile( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/"
-                + MetadataTools.MAVEN_METADATA ) );
+        ChecksummedFile checksum = new ChecksummedFile( new File( repoLocation,
+                                                                  "/org/apache/archiva/artifact-upload/" + version + "/"
+                                                                      + MetadataTools.MAVEN_METADATA ) );
         String sha1 = checksum.calculateChecksum( ChecksumAlgorithm.SHA1 );
         String md5 = checksum.calculateChecksum( ChecksumAlgorithm.MD5 );
 
-        String contents =
-            FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/"
-                + MetadataTools.MAVEN_METADATA + ".sha1" ) );
+        String contents = FileUtils.readFileToString( new File( repoLocation,
+                                                                "/org/apache/archiva/artifact-upload/" + version + "/"
+                                                                    + MetadataTools.MAVEN_METADATA + ".sha1" ) );
         assertTrue( StringUtils.contains( contents, sha1 ) );
 
-        contents =
-            FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/"
-                + MetadataTools.MAVEN_METADATA + ".md5" ) );
+        contents = FileUtils.readFileToString( new File( repoLocation,
+                                                         "/org/apache/archiva/artifact-upload/" + version + "/"
+                                                             + MetadataTools.MAVEN_METADATA + ".md5" ) );
         assertTrue( StringUtils.contains( contents, md5 ) );
     }
 
     private void verifyProjectMetadataChecksums( String repoLocation )
         throws IOException
     {
-        ChecksummedFile checksum =
-            new ChecksummedFile( new File( repoLocation, "/org/apache/archiva/artifact-upload/"
-                + MetadataTools.MAVEN_METADATA ) );
+        ChecksummedFile checksum = new ChecksummedFile(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ) );
         String sha1 = checksum.calculateChecksum( ChecksumAlgorithm.SHA1 );
         String md5 = checksum.calculateChecksum( ChecksumAlgorithm.MD5 );
 
-        String contents =
-            FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/"
-                + MetadataTools.MAVEN_METADATA + ".sha1" ) );
+        String contents = FileUtils.readFileToString(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + ".sha1" ) );
         assertTrue( StringUtils.contains( contents, sha1 ) );
 
-        contents =
-            FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/"
-                + MetadataTools.MAVEN_METADATA + ".md5" ) );
+        contents = FileUtils.readFileToString(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + ".md5" ) );
         assertTrue( StringUtils.contains( contents, md5 ) );
     }
 
@@ -206,40 +208,34 @@ public class UploadActionTest
         String sha1;
         String md5;
         String contents;
-        checksum =
-            new ChecksummedFile( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/"
-                + artifact + ".pom" ) );
+        checksum = new ChecksummedFile(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom" ) );
         sha1 = checksum.calculateChecksum( ChecksumAlgorithm.SHA1 );
         md5 = checksum.calculateChecksum( ChecksumAlgorithm.MD5 );
 
-        contents =
-            FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/"
-                + artifact + ".pom.sha1" ) );
+        contents = FileUtils.readFileToString(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom.sha1" ) );
         assertTrue( StringUtils.contains( contents, sha1 ) );
 
-        contents =
-            FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/"
-                + artifact + ".pom.md5" ) );
+        contents = FileUtils.readFileToString(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom.md5" ) );
         assertTrue( StringUtils.contains( contents, md5 ) );
     }
 
     private void verifyArtifactChecksums( String repoLocation, String artifact, String version )
         throws IOException
     {
-        ChecksummedFile checksum =
-            new ChecksummedFile( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/"
-                + artifact + ".jar" ) );
+        ChecksummedFile checksum = new ChecksummedFile(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar" ) );
         String sha1 = checksum.calculateChecksum( ChecksumAlgorithm.SHA1 );
         String md5 = checksum.calculateChecksum( ChecksumAlgorithm.MD5 );
 
-        String contents =
-            FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/"
-                + artifact + ".jar.sha1" ) );
+        String contents = FileUtils.readFileToString(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar.sha1" ) );
         assertTrue( StringUtils.contains( contents, sha1 ) );
 
-        contents =
-            FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/"
-                + artifact + ".jar.md5" ) );
+        contents = FileUtils.readFileToString(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar.md5" ) );
         assertTrue( StringUtils.contains( contents, md5 ) );
     }
 
@@ -256,12 +252,12 @@ public class UploadActionTest
         {
             endIndex = artifactsList[index].indexOf( ".pom" );
         }
-        
+
         timestamp = artifactsList[index].substring( startIndex, endIndex );
 
         return timestamp;
     }
-    
+
     private MockControl mockAuditLogs( List<String> resources )
     {
         return mockAuditLogs( AuditEvent.UPLOAD_FILE, resources );
@@ -286,16 +282,17 @@ public class UploadActionTest
         uploadAction.setAuditListeners( Collections.singletonList( listener ) );
         return control;
     }
-    
+
     public void testArtifactUploadWithPomSuccessful()
         throws Exception
     {
         setUploadParameters( "1.0", null, new File( FileUtil.getBasedir(),
                                                     "target/test-classes/upload-artifact-test/artifact-to-be-uploaded.jar" ),
-                             new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/pom.xml" ), false );
+                             new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/pom.xml" ),
+                             false );
 
         ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
-        content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) );
+        content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) );
 
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
         repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content );
@@ -327,10 +324,11 @@ public class UploadActionTest
     {
         setUploadParameters( "1.0", "tests", new File( FileUtil.getBasedir(),
                                                        "target/test-classes/upload-artifact-test/artifact-to-be-uploaded.jar" ),
-                             new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/pom.xml" ), false );
+                             new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/pom.xml" ),
+                             false );
 
         ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
-        content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) );
+        content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) );
 
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
         repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content );
@@ -350,16 +348,22 @@ public class UploadActionTest
         control.verify();
 
         String repoLocation = config.findManagedRepositoryById( REPOSITORY_ID ).getLocation();
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar" ).exists() );
+        assertTrue( new File( repoLocation,
+                              "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar" ).exists() );
         assertTrue( new File( repoLocation,
                               "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar.sha1" ).exists() );
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar.md5" ).exists() );
+        assertTrue( new File( repoLocation,
+                              "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar.md5" ).exists() );
 
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom" ).exists() );
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom.sha1" ).exists() );
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom.md5" ).exists() );
+        assertTrue(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom" ).exists() );
+        assertTrue(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom.sha1" ).exists() );
+        assertTrue(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom.md5" ).exists() );
 
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() );
+        assertTrue(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() );
         assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA
             + ".sha1" ).exists() );
         assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA
@@ -377,7 +381,7 @@ public class UploadActionTest
                              null, true );
 
         ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
-        content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) );
+        content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) );
 
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
         repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content );
@@ -412,7 +416,7 @@ public class UploadActionTest
                              null, false );
 
         ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
-        content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) );
+        content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) );
 
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
         repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content );
@@ -447,10 +451,10 @@ public class UploadActionTest
 
         assertTrue(
             new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() );
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA +
-            ".sha1" ).exists() );
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA +
-            ".md5" ).exists() );
+        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA
+            + ".sha1" ).exists() );
+        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA
+            + ".md5" ).exists() );
 
         // verify checksums of jar file
         ChecksummedFile checksum = new ChecksummedFile(
@@ -502,11 +506,14 @@ public class UploadActionTest
         repoFactoryControl.verify();
 
         String repoLocation = config.findManagedRepositoryById( REPOSITORY_ID ).getLocation();
-        assertFalse( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.jar" ).exists() );
+        assertFalse(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.jar" ).exists() );
 
-        assertFalse( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom" ).exists() );
+        assertFalse(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom" ).exists() );
 
-        assertFalse( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() );
+        assertFalse(
+            new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() );
     }
 
     public void testArtifactUploadSnapshots()
@@ -517,7 +524,7 @@ public class UploadActionTest
                              null, true );
 
         ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
-        content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) );
+        content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) );
 
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
         repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content );
@@ -546,10 +553,12 @@ public class UploadActionTest
         assertEquals( 9, artifactsList.length );
         assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/"
             + MetadataTools.MAVEN_METADATA ).exists() );
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/"
-            + MetadataTools.MAVEN_METADATA + ".sha1" ).exists() );
-        assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/"
-            + MetadataTools.MAVEN_METADATA + ".md5" ).exists() );
+        assertTrue( new File( repoLocation,
+                              "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA
+                                  + ".sha1" ).exists() );
+        assertTrue( new File( repoLocation,
+                              "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA
+                                  + ".md5" ).exists() );
 
         int startIndex = "artifact-upload-1.0-".length();
         String timestampPath = getTimestamp( artifactsList, startIndex, 0 );
@@ -562,8 +571,8 @@ public class UploadActionTest
         verifyVersionMetadataChecksums( repoLocation, "1.0-SNAPSHOT" );
 
         // verify build number
-        File metadataFile =
-            new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA );
+        File metadataFile = new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/"
+            + MetadataTools.MAVEN_METADATA );
         ArchivaRepositoryMetadata artifactMetadata = RepositoryMetadataReader.read( metadataFile );
 
         SnapshotVersion snapshotVersion = artifactMetadata.getSnapshotVersion();
@@ -583,35 +592,34 @@ public class UploadActionTest
 
         // MRM-1353
         // upload snapshot artifact again and check if build number was incremented
-        setUploadParameters( "1.0-SNAPSHOT", null,
-                             new File( FileUtil.getBasedir(),
-                                       "target/test-classes/upload-artifact-test/artifact-to-be-uploaded.jar" ), null,
-                             true );
+        setUploadParameters( "1.0-SNAPSHOT", null, new File( FileUtil.getBasedir(),
+                                                             "target/test-classes/upload-artifact-test/artifact-to-be-uploaded.jar" ),
+                             null, true );
 
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
         repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content );
-        
+
         archivaConfigControl.replay();
         repoFactoryControl.replay();
-        
+
         fmt = new SimpleDateFormat( "yyyyMMdd.HHmmss" );
         fmt.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
         timestamp = fmt.format( new Date() );
-        
+
         control = mockAuditLogs( Arrays.asList(
-                       "org/apache/archiva/artifact-upload/1.0-SNAPSHOT/artifact-upload-1.0-" + timestamp + "-2.jar",
-                       "org/apache/archiva/artifact-upload/1.0-SNAPSHOT/artifact-upload-1.0-" + timestamp + "-2.pom" ) );
-        
+            "org/apache/archiva/artifact-upload/1.0-SNAPSHOT/artifact-upload-1.0-" + timestamp + "-2.jar",
+            "org/apache/archiva/artifact-upload/1.0-SNAPSHOT/artifact-upload-1.0-" + timestamp + "-2.pom" ) );
+
         returnString = uploadAction.doUpload();
         assertEquals( Action.SUCCESS, returnString );
 
         archivaConfigControl.verify();
         repoFactoryControl.verify();
         control.verify();
-        
+
         artifactsList = new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" ).list();
         Arrays.sort( artifactsList );
-        
+
         assertEquals( 15, artifactsList.length );
 
         timestampPath = getTimestamp( artifactsList, startIndex, 6 );
@@ -624,8 +632,8 @@ public class UploadActionTest
         verifyVersionMetadataChecksums( repoLocation, "1.0-SNAPSHOT" );
 
         // verify build number set in metadata and in filename
-        metadataFile =
-            new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA );
+        metadataFile = new File( repoLocation,
+                                 "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA );
         artifactMetadata = RepositoryMetadataReader.read( metadataFile );
 
         snapshotVersion = artifactMetadata.getSnapshotVersion();
@@ -648,7 +656,7 @@ public class UploadActionTest
         ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
         ManagedRepositoryConfiguration repoConfig = config.findManagedRepositoryById( REPOSITORY_ID );
         repoConfig.setBlockRedeployments( false );
-        content.setRepository( repoConfig );
+        content.setRepository( getManagedRepository( repoConfig ) );
 
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
         repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content );
@@ -712,7 +720,7 @@ public class UploadActionTest
                              null, true );
 
         ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
-        content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) );
+        content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) );
 
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 2 );
         repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content, 2 );
@@ -754,7 +762,7 @@ public class UploadActionTest
         ManagedRepositoryContent content = new ManagedDefaultRepositoryContent();
         ManagedRepositoryConfiguration repoConfig = config.findManagedRepositoryById( REPOSITORY_ID );
         repoConfig.setBlockRedeployments( false );
-        content.setRepository( repoConfig );
+        content.setRepository( getManagedRepository( repoConfig ) );
 
         archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 2 );
         repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content, 2 );
@@ -789,4 +797,9 @@ public class UploadActionTest
         verifyPomChecksums( repoLocation, "artifact-upload-1.0", "1.0" );
         verifyProjectMetadataChecksums( repoLocation );
     }
+
+    ManagedRepository getManagedRepository( ManagedRepositoryConfiguration conf )
+    {
+        return new BeanReplicator().replicateBean( conf, ManagedRepository.class );
+    }
 }

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Action;
+import org.apache.archiva.admin.model.proxyconnector.ProxyConnector;
 import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
 import org.apache.archiva.admin.repository.proxyconnector.DefaultProxyConnectorAdmin;
-import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector;
 import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
@@ -37,8 +37,8 @@ import org.apache.maven.archiva.policies
 import org.apache.maven.archiva.policies.ReleasesPolicy;
 import org.apache.maven.archiva.policies.SnapshotsPolicy;
 import org.apache.maven.archiva.web.action.AbstractWebworkTestCase;
-import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.plexus.registry.RegistryException;
+import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.easymock.MockControl;
 
 import java.util.List;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Action;
+import org.apache.archiva.admin.model.proxyconnector.ProxyConnector;
 import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
 import org.apache.archiva.admin.repository.proxyconnector.DefaultProxyConnectorAdmin;
-import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector;
 import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathActionTest.java Tue Sep 13 12:12:39 2011
@@ -21,7 +21,7 @@ package org.apache.maven.archiva.web.act
 
 import com.opensymphony.xwork2.validator.ActionValidatorManager;
 import junit.framework.TestCase;
-import org.apache.archiva.admin.repository.admin.LegacyArtifactPath;
+import org.apache.archiva.admin.model.admin.LegacyArtifactPath;
 import org.apache.archiva.web.validator.utils.ValidatorUtil;
 import org.apache.maven.archiva.web.action.admin.repositories.DefaultActionValidatorManagerFactory;
 

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,17 +20,16 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.validator.ActionValidatorManager;
+import junit.framework.TestCase;
+import org.apache.archiva.admin.model.networkproxy.NetworkProxy;
+import org.apache.archiva.web.validator.utils.ValidatorUtil;
+import org.apache.maven.archiva.web.action.admin.repositories.DefaultActionValidatorManagerFactory;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import junit.framework.TestCase;
-import org.apache.archiva.admin.repository.networkproxy.NetworkProxy;
-import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
-import org.apache.maven.archiva.web.action.admin.repositories.DefaultActionValidatorManagerFactory;
-import org.apache.archiva.web.validator.utils.ValidatorUtil;
-
 public class ConfigureNetworkProxyActionTest extends TestCase
 {
     private static final String EMPTY_STRING = "";

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.validator.ActionValidatorManager;
-import org.apache.archiva.admin.repository.managed.ManagedRepository;
-import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.struts2.StrutsSpringTestCase;
 
 import java.io.File;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Action;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.admin.repository.RepositoryCommonValidator;
 import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
-import org.apache.archiva.admin.repository.managed.ManagedRepository;
 import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
 import org.apache.archiva.scheduler.repository.RepositoryTask;
 import org.apache.archiva.security.ArchivaRoleConstants;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Action;
+import org.apache.archiva.admin.model.remote.RemoteRepository;
 import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin;
-import org.apache.archiva.admin.repository.remote.RemoteRepository;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.web.action.AbstractActionTestCase;

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,14 +20,18 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Action;
+import net.sf.beanlib.provider.replicator.BeanReplicator;
+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.admin.repository.managed.DefaultManagedRepositoryAdmin;
-import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.audit.AuditEvent;
 import org.apache.archiva.audit.AuditListener;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.RepositorySession;
 import org.apache.archiva.metadata.repository.memory.TestRepositorySessionFactory;
 import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager;
+import org.apache.archiva.security.ArchivaRoleConstants;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;
@@ -35,7 +39,6 @@ import org.apache.maven.archiva.configur
 import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
 import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
 import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
-import org.apache.archiva.security.ArchivaRoleConstants;
 import org.apache.maven.archiva.web.action.AbstractActionTestCase;
 import org.apache.maven.archiva.web.action.AuditEventArgumentsMatcher;
 import org.codehaus.plexus.redback.role.RoleManager;
@@ -128,7 +131,7 @@ public class DeleteManagedRepositoryActi
     }
 
     public void testSecureActionBundle()
-        throws SecureActionException
+        throws SecureActionException, RepositoryAdminException
     {
         archivaConfiguration.getConfiguration();
         archivaConfigurationControl.setReturnValue( new Configuration() );
@@ -173,7 +176,7 @@ public class DeleteManagedRepositoryActi
     public void testDeleteRepositoryConfirmation()
         throws Exception
     {
-        ManagedRepositoryConfiguration originalRepository = createRepository();
+        ManagedRepository originalRepository = createRepository();
         Configuration configuration = createConfigurationForEditing( originalRepository );
 
         archivaConfiguration.getConfiguration();
@@ -189,7 +192,7 @@ public class DeleteManagedRepositoryActi
 
         action.prepare();
         assertEquals( REPO_ID, action.getRepoid() );
-        ManagedRepositoryConfiguration repository = action.getRepository();
+        ManagedRepository repository = action.getRepository();
         assertNotNull( repository );
         assertRepositoryEquals( repository, createRepository() );
 
@@ -305,13 +308,13 @@ public class DeleteManagedRepositoryActi
     {
         repositoryStatisticsManagerControl.replay();
 
-        ManagedRepositoryConfiguration originalRepository = createRepository();
+        ManagedRepository originalRepository = createRepository();
         Configuration configuration = prepDeletionTest( originalRepository, 3 );
 
         String status = action.execute();
         assertEquals( Action.SUCCESS, status );
 
-        ManagedRepositoryConfiguration repository = action.getRepository();
+        ManagedRepository repository = action.getRepository();
         assertRepositoryEquals( repository, createRepository() );
         assertEquals( Collections.singletonList( originalRepository ), configuration.getManagedRepositories() );
 
@@ -321,9 +324,8 @@ public class DeleteManagedRepositoryActi
     }
 
 
-    private Configuration prepDeletionTest( ManagedRepositoryConfiguration originalRepository,
-                                            int expectCountGetConfig )
-        throws RegistryException, IndeterminateConfigurationException
+    private Configuration prepDeletionTest( ManagedRepository originalRepository, int expectCountGetConfig )
+        throws RegistryException, IndeterminateConfigurationException, RepositoryAdminException
     {
         location.mkdirs();
 
@@ -347,7 +349,7 @@ public class DeleteManagedRepositoryActi
 
         action.prepare();
         assertEquals( REPO_ID, action.getRepoid() );
-        ManagedRepositoryConfiguration repository = action.getRepository();
+        ManagedRepository repository = action.getRepository();
         assertNotNull( repository );
         assertRepositoryEquals( repository, createRepository() );
 
@@ -355,16 +357,15 @@ public class DeleteManagedRepositoryActi
         return configuration;
     }
 
-    private void assertRepositoryEquals( ManagedRepositoryConfiguration expectedRepository,
-                                         ManagedRepositoryConfiguration actualRepository )
+    private void assertRepositoryEquals( ManagedRepository expectedRepository, ManagedRepository actualRepository )
     {
         assertEquals( expectedRepository.getDaysOlder(), actualRepository.getDaysOlder() );
         assertEquals( expectedRepository.getId(), actualRepository.getId() );
-        assertEquals( expectedRepository.getIndexDir(), actualRepository.getIndexDir() );
+        assertEquals( expectedRepository.getIndexDirectory(), actualRepository.getIndexDirectory() );
         assertEquals( expectedRepository.getLayout(), actualRepository.getLayout() );
         assertEquals( expectedRepository.getLocation(), actualRepository.getLocation() );
         assertEquals( expectedRepository.getName(), actualRepository.getName() );
-        assertEquals( expectedRepository.getRefreshCronExpression(), actualRepository.getRefreshCronExpression() );
+        assertEquals( expectedRepository.getCronExpression(), actualRepository.getCronExpression() );
         assertEquals( expectedRepository.getRetentionCount(), actualRepository.getRetentionCount() );
         assertEquals( expectedRepository.isDeleteReleasedSnapshots(), actualRepository.isDeleteReleasedSnapshots() );
         assertEquals( expectedRepository.isScanned(), actualRepository.isScanned() );
@@ -372,21 +373,22 @@ public class DeleteManagedRepositoryActi
         assertEquals( expectedRepository.isSnapshots(), actualRepository.isSnapshots() );
     }
 
-    private Configuration createConfigurationForEditing( ManagedRepositoryConfiguration repositoryConfiguration )
+    private Configuration createConfigurationForEditing( ManagedRepository repositoryConfiguration )
     {
         Configuration configuration = new Configuration();
-        configuration.addManagedRepository( repositoryConfiguration );
+        configuration.addManagedRepository(
+            new BeanReplicator().replicateBean( repositoryConfiguration, ManagedRepositoryConfiguration.class ) );
         return configuration;
     }
 
-    private ManagedRepositoryConfiguration createRepository()
+    private ManagedRepository createRepository()
     {
-        ManagedRepositoryConfiguration r = new ManagedRepositoryConfiguration();
+        ManagedRepository r = new ManagedRepository();
         r.setId( REPO_ID );
         r.setName( "repo name" );
         r.setLocation( location.getAbsolutePath() );
         r.setLayout( "default" );
-        r.setRefreshCronExpression( "* 0/5 * * * ?" );
+        r.setCronExpression( "* 0/5 * * * ?" );
         r.setDaysOlder( 0 );
         r.setRetentionCount( 0 );
         r.setReleases( true );

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java?rev=1170135&r1=1170134&r2=1170135&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java Tue Sep 13 12:12:39 2011
@@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.act
  */
 
 import com.opensymphony.xwork2.Action;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.remote.RemoteRepository;
 import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin;
-import org.apache.archiva.admin.repository.remote.RemoteRepository;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;



Mime
View raw message