]> source.dussan.org Git - archiva.git/commitdiff
fix some compile issues from tests
authorBrett Porter <brett@apache.org>
Sun, 2 Feb 2014 03:15:01 +0000 (03:15 +0000)
committerBrett Porter <brett@apache.org>
Sun, 2 Feb 2014 03:15:01 +0000 (03:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.3.x@1563560 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java

index 130e4e2dcd974f6a5c925d38d0886f145bf55851..22a1f1b8db7e049ed7276e6b53d129f2f6b9bd5d 100644 (file)
@@ -42,9 +42,16 @@ public class EditProxyConnectorAction
      */
     private String target;
 
-    public String input()
+    @Override
+    public void prepare()
     {
+        super.prepare();
+
         connector = findProxyConnector( source, target );
+    }
+
+    public String input()
+    {
         if ( connector == null )
         {
             addActionError( "Unable to edit non existant proxy connector with source [" + source + "] and target ["
index 7a354540227d56ebe229a0490839937e216ab560..b069c137d9643b9e7273e7be024708949e6319cb 100644 (file)
@@ -34,12 +34,21 @@ import org.apache.maven.archiva.repository.audit.AuditEvent;
  */
 public class DeleteRepositoryGroupAction 
     extends AbstractRepositoriesAdminAction
+    implements Preparable
 {
     private RepositoryGroupConfiguration repositoryGroup;
 
     private String repoGroupId;
 
     private boolean cancel;
+
+    public void prepare()
+    {
+        if ( StringUtils.isNotBlank( repoGroupId ) )
+        {
+            this.repositoryGroup = archivaConfiguration.getConfiguration().findRepositoryGroupById( repoGroupId );
+        }
+    }
        
     public String confirmDelete()
     {
@@ -48,10 +57,6 @@ public class DeleteRepositoryGroupAction
             addActionError( "Unable to delete repository group: repository id was blank." );
             return ERROR;
         }
-        else
-        {
-            this.repositoryGroup = archivaConfiguration.getConfiguration().findRepositoryGroupById( repoGroupId );
-        }
 
         return INPUT;
     }
index da717c1714b2a055a707d3ad49a9f0d4d10860f7..1b3edf20b63797a9f343c6bb336e9e2a70ceac08 100644 (file)
     <action name="editProxyConnector" class="editProxyConnectorAction" method="input">
       <result name="input">/WEB-INF/jsp/admin/editProxyConnector.jsp</result>
       <result name="success" type="redirectAction">proxyConnectors</result>
-      <interceptor-ref name="configuredArchivaStack">
-        <param name="params.acceptParamNames">\w+((\.\w+)|(\[\d+\])|(\(\d+\))|(\['[-\w]+'\])|(\('\w+'\)))*</param>
-      </interceptor-ref>
+      <interceptor-ref name="configuredPrepareParamsStack" />
     </action>
 
     <action name="editProxyConnector_*" class="editProxyConnectorAction" method="{1}">
index ccd69f49f0514cf1d22f6aeda24e25c01590043d..37f961283232f7e7176c1d6a05a0a48255ecbe38 100644 (file)
@@ -147,7 +147,7 @@ public class DeleteManagedRepositoryActionTest
         auditLogsDaoControl.expectAndReturn( auditLogsDao.saveAuditLogs( new ArchivaAuditLogs() ), null );
         auditLogsDaoControl.replay();
         
-        String status = action.deleteEntry();        
+        String status = action.delete();
                 
         auditLogsDaoControl.verify();
         
@@ -167,8 +167,9 @@ public class DeleteManagedRepositoryActionTest
         
         auditLogsDaoControl.expectAndReturn( auditLogsDao.saveAuditLogs( new ArchivaAuditLogs() ), null );
         auditLogsDaoControl.replay();
-        
-        String status = action.deleteContents();
+
+        action.setDeleteContents( Boolean.TRUE.toString() );
+        String status = action.delete();
         
         auditLogsDaoControl.verify();
                
@@ -193,8 +194,9 @@ public class DeleteManagedRepositoryActionTest
         
         auditLogsDaoControl.expectAndReturn( auditLogsDao.saveAuditLogs( new ArchivaAuditLogs() ), null );
         auditLogsDaoControl.replay();
-        
-        String status = action.deleteContents();
+
+        action.setDeleteContents( Boolean.TRUE.toString() );
+        String status = action.delete();
         
         auditLogsDaoControl.verify();
         assertEquals( Action.SUCCESS, status );
@@ -235,8 +237,9 @@ public class DeleteManagedRepositoryActionTest
         
         auditLogsDaoControl.expectAndReturn( auditLogsDao.saveAuditLogs( new ArchivaAuditLogs() ), null );
         auditLogsDaoControl.replay();
-        
-        String status = action.deleteContents();
+
+        action.setDeleteContents( Boolean.TRUE.toString() );
+        String status = action.delete();
         assertEquals( Action.SUCCESS, status );
         auditLogsDaoControl.verify();