*/
import com.opensymphony.xwork2.Action;
-
import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
import org.apache.archiva.admin.repository.proxyconnector.DefaultProxyConnectorAdmin;
import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin;
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
import org.apache.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;
/**
- * ProxyConnectorsActionTest
+ * ProxyConnectorsActionTest
*
* @version $Id$
*/
{
super.setUp();
- action = (ProxyConnectorsAction) getActionProxy("/admin/proxyConnectors.action" ).getAction();
+ action = (ProxyConnectorsAction) getActionProxy( "/admin/proxyConnectors.action" ).getAction();
archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class );
archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock();
archivaConfiguration );
( (DefaultRemoteRepositoryAdmin) action.getRemoteRepositoryAdmin() ).setArchivaConfiguration(
archivaConfiguration );
- ( (DefaultProxyConnectorAdmin) action.getProxyConnectorAdmin() ).setArchivaConfiguration( archivaConfiguration );
+ ( (DefaultProxyConnectorAdmin) action.getProxyConnectorAdmin() ).setArchivaConfiguration(
+ archivaConfiguration );
}
public void testSecureActionBundle()
throws Exception
{
- expectConfigurationRequests( 4 );
+ expectConfigurationRequests( 5 );
archivaConfigurationControl.replay();
action.prepare();
String status = action.execute();
assertEquals( Action.SUCCESS, status );
assertNoErrors( action );
-
+
assertNotNull( action.getProxyConnectorMap() );
assertNotNull( action.getRepoMap() );
{
Configuration config = createInitialConfiguration();
- for ( int i = 0; i < requestConfigCount; i++ )
- {
- archivaConfiguration.getConfiguration();
- archivaConfigurationControl.setReturnValue( config );
- }
+ archivaConfiguration.getConfiguration();
+ archivaConfigurationControl.setReturnValue( config, requestConfigCount + 1 );
archivaConfiguration.save( config );
}
import org.apache.archiva.configuration.Configuration;
import org.apache.archiva.web.action.AbstractActionTestCase;
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
-import org.codehaus.redback.integration.interceptor.SecureActionException;
import org.easymock.MockControl;
import java.util.Collections;
{
Configuration configuration = new Configuration();
archivaConfiguration.getConfiguration();
- archivaConfigurationControl.setReturnValue( configuration );
+ archivaConfigurationControl.setReturnValue( configuration, 2 );
archivaConfiguration.save( configuration );
archivaConfiguration.getConfiguration();
- archivaConfigurationControl.setReturnValue( configuration );
+ archivaConfigurationControl.setReturnValue( configuration, 1 );
archivaConfigurationControl.replay();
Configuration configuration = createConfigurationForEditing( originalRepository );
archivaConfiguration.getConfiguration();
- archivaConfigurationControl.setReturnValue( configuration );
-
- archivaConfiguration.getConfiguration();
- archivaConfigurationControl.setReturnValue( configuration );
+ archivaConfigurationControl.setReturnValue( configuration, 3, 4 );
archivaConfigurationControl.replay();
Configuration configuration = createConfigurationForEditing( originalRepository );
archivaConfiguration.getConfiguration();
- archivaConfigurationControl.setReturnValue( configuration, 2 );
+ archivaConfigurationControl.setReturnValue( configuration, 4 );
archivaConfiguration.save( configuration );
archivaConfigurationControl.replay();