You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by jo...@apache.org on 2007/11/07 19:05:54 UTC
svn commit: r592838 - in /maven/archiva/trunk/archiva-web/archiva-webapp/src:
main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/
test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/
Author: joakime
Date: Wed Nov 7 10:05:53 2007
New Revision: 592838
URL: http://svn.apache.org/viewvc?rev=592838&view=rev
Log:
Fixing the deletion of proxy connectors, by making action consistent with jsp usage.
Modified:
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java
maven/archiva/trunk/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorActionTest.java
Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java?rev=592838&r1=592837&r2=592838&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java Wed Nov 7 10:05:53 2007
@@ -32,21 +32,21 @@
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 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 @@
}
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()
Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorActionTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorActionTest.java?rev=592838&r1=592837&r2=592838&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorActionTest.java (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorActionTest.java Wed Nov 7 10:05:53 2007
@@ -59,8 +59,8 @@
// 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 @@
// 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 @@
// 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 @@
// 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 );