]> source.dussan.org Git - archiva.git/commitdiff
Fixing the deletion of proxy connectors, by making action consistent with jsp usage.
authorJoakim Erdfelt <joakime@apache.org>
Wed, 7 Nov 2007 18:05:53 +0000 (18:05 +0000)
committerJoakim Erdfelt <joakime@apache.org>
Wed, 7 Nov 2007 18:05:53 +0000 (18:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@592838 13f79535-47bb-0310-9956-ffa450edef68

archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorActionTest.java

index 1fa7fa538edd8db82910698a627938ce52b1ea72..2de3ee9a5ae50d55791f139b9faaa87f6ca8d367 100644 (file)
@@ -32,21 +32,21 @@ import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
 public class DeleteProxyConnectorAction
     extends AbstractProxyConnectorAction
 {
-    private String sourceId;
+    private String source;
 
-    private String targetId;
+    private String target;
 
     private ProxyConnectorConfiguration proxyConfig;
 
     public String confirmDelete()
     {
-        this.proxyConfig = findProxyConnector( sourceId, targetId );
+        this.proxyConfig = findProxyConnector( source, target );
 
         // Not set? Then there is nothing to delete.
         if ( this.proxyConfig == null )
         {
-            addActionError( "Unable to delete proxy configuration, configuration with source [" + sourceId
-                + "], and target [" + targetId + "] does not exist." );
+            addActionError( "Unable to delete proxy configuration, configuration with source [" + source
+                + "], and target [" + target + "] does not exist." );
             return ERROR;
         }
 
@@ -55,13 +55,13 @@ public class DeleteProxyConnectorAction
 
     public String delete()
     {
-        this.proxyConfig = findProxyConnector( sourceId, targetId );
+        this.proxyConfig = findProxyConnector( source, target );
 
         // Not set? Then there is nothing to delete.
         if ( this.proxyConfig == null )
         {
-            addActionError( "Unable to delete proxy configuration, configuration with source [" + sourceId
-                + "], and target [" + targetId + "] does not exist." );
+            addActionError( "Unable to delete proxy configuration, configuration with source [" + source
+                + "], and target [" + target + "] does not exist." );
             return ERROR;
         }
 
@@ -71,32 +71,32 @@ public class DeleteProxyConnectorAction
         }
         
         removeProxyConnector( proxyConfig );
-        addActionMessage( "Successfully removed proxy connector [" + sourceId + " , " + targetId + " ]" );
+        addActionMessage( "Successfully removed proxy connector [" + source + " , " + target + " ]" );
 
-        setSourceId( null );
-        setTargetId( null );
+        setSource( null );
+        setTarget( null );
         
         return saveConfiguration();
     }
 
-    public String getSourceId()
+    public String getSource()
     {
-        return sourceId;
+        return source;
     }
 
-    public void setSourceId( String sourceId )
+    public void setSource( String id )
     {
-        this.sourceId = sourceId;
+        this.source = id;
     }
 
-    public String getTargetId()
+    public String getTarget()
     {
-        return targetId;
+        return target;
     }
 
-    public void setTargetId( String targetId )
+    public void setTarget( String id )
     {
-        this.targetId = targetId;
+        this.target = id;
     }
 
     public ProxyConnectorConfiguration getProxyConfig()
index 261ea21f165c968d9c0e8f15b39e333862468a3e..d3d30f19076fd5331f0a876c3c709d2cf1e66457 100644 (file)
@@ -59,8 +59,8 @@ public class DeleteProxyConnectorActionTest
 
         // Show the confirm the delete of proxy connector screen.
         preRequest( action );
-        action.setSourceId( TEST_SOURCE_ID );
-        action.setTargetId( TEST_TARGET_ID );
+        action.setSource( TEST_SOURCE_ID );
+        action.setTarget( TEST_TARGET_ID );
         String status = action.confirmDelete();
         assertEquals( Action.INPUT, status );
         assertNoErrors( action );
@@ -76,24 +76,24 @@ public class DeleteProxyConnectorActionTest
         // a bad source id or target id to actually delete
 
         preRequest( action );
-        action.setSourceId( "bad-source" ); // id doesn't exist.
-        action.setTargetId( "bad-target" ); // id doesn't exist.
+        action.setSource( "bad-source" ); // id doesn't exist.
+        action.setTarget( "bad-target" ); // id doesn't exist.
         String status = action.confirmDelete();
         // Should have resulted in an error.
         assertEquals( Action.ERROR, status );
         assertHasErrors( action );
 
         preRequest( action );
-        action.setSourceId( "bad" ); // Bad doesn't exist.
-        action.setTargetId( TEST_TARGET_ID );
+        action.setSource( "bad" ); // Bad doesn't exist.
+        action.setTarget( TEST_TARGET_ID );
         status = action.confirmDelete();
         // Should have resulted in an error.
         assertEquals( Action.ERROR, status );
         assertHasErrors( action );
 
         preRequest( action );
-        action.setSourceId( TEST_SOURCE_ID );
-        action.setTargetId( "bad" ); // Bad doesn't exist.
+        action.setSource( TEST_SOURCE_ID );
+        action.setTarget( "bad" ); // Bad doesn't exist.
         status = action.confirmDelete();
         // Should have resulted in an error.
         assertEquals( Action.ERROR, status );
@@ -110,24 +110,24 @@ public class DeleteProxyConnectorActionTest
         // the source id or target id to actually delete
 
         preRequest( action );
-        action.setSourceId( null ); // No source Id.
-        action.setTargetId( null ); // No target Id.
+        action.setSource( null ); // No source Id.
+        action.setTarget( null ); // No target Id.
         String status = action.confirmDelete();
         // Should have resulted in an error.
         assertEquals( Action.ERROR, status );
         assertHasErrors( action );
 
         preRequest( action );
-        action.setSourceId( TEST_SOURCE_ID );
-        action.setTargetId( null ); // No target Id.
+        action.setSource( TEST_SOURCE_ID );
+        action.setTarget( null ); // No target Id.
         status = action.confirmDelete();
         // Should have resulted in an error.
         assertEquals( Action.ERROR, status );
         assertHasErrors( action );
 
         preRequest( action );
-        action.setSourceId( null ); // No source Id.
-        action.setTargetId( TEST_TARGET_ID );
+        action.setSource( null ); // No source Id.
+        action.setTarget( TEST_TARGET_ID );
         status = action.confirmDelete();
         // Should have resulted in an error.
         assertEquals( Action.ERROR, status );
@@ -142,8 +142,8 @@ public class DeleteProxyConnectorActionTest
 
         // Show the confirm the delete of proxy connector screen.
         preRequest( action );
-        action.setSourceId( TEST_SOURCE_ID );
-        action.setTargetId( TEST_TARGET_ID );
+        action.setSource( TEST_SOURCE_ID );
+        action.setTarget( TEST_TARGET_ID );
         String status = action.confirmDelete();
         assertEquals( Action.INPUT, status );
         assertNoErrors( action );