mirror of https://github.com/apache/archiva.git
fix junit due to ArrayList init mock call number changed
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1229366 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
37b752dd5d
commit
609db54fef
|
@ -400,13 +400,8 @@ public class AddProxyConnectorActionTest
|
||||||
throws RegistryException, IndeterminateConfigurationException
|
throws RegistryException, IndeterminateConfigurationException
|
||||||
{
|
{
|
||||||
Configuration config = createInitialConfiguration();
|
Configuration config = createInitialConfiguration();
|
||||||
|
|
||||||
for ( int i = 0; i < requestConfigCount; i++ )
|
|
||||||
{
|
|
||||||
archivaConfiguration.getConfiguration();
|
archivaConfiguration.getConfiguration();
|
||||||
archivaConfigurationControl.setReturnValue( config );
|
archivaConfigurationControl.setReturnValue( config, requestConfigCount, requestConfigCount + 1 );
|
||||||
}
|
|
||||||
|
|
||||||
archivaConfiguration.save( config );
|
archivaConfiguration.save( config );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ package org.apache.archiva.web.action.admin.connectors.proxy;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import com.opensymphony.xwork2.Action;
|
import com.opensymphony.xwork2.Action;
|
||||||
|
|
||||||
import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
|
import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
|
||||||
import org.apache.archiva.admin.repository.proxyconnector.DefaultProxyConnectorAdmin;
|
import org.apache.archiva.admin.repository.proxyconnector.DefaultProxyConnectorAdmin;
|
||||||
import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin;
|
import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin;
|
||||||
|
@ -31,8 +30,8 @@ import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
|
||||||
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
|
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
|
||||||
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
||||||
import org.apache.archiva.web.action.AbstractWebworkTestCase;
|
import org.apache.archiva.web.action.AbstractWebworkTestCase;
|
||||||
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
|
|
||||||
import org.codehaus.plexus.registry.RegistryException;
|
import org.codehaus.plexus.registry.RegistryException;
|
||||||
|
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
|
||||||
import org.easymock.MockControl;
|
import org.easymock.MockControl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,13 +68,14 @@ public class ProxyConnectorsActionTest
|
||||||
archivaConfiguration );
|
archivaConfiguration );
|
||||||
( (DefaultRemoteRepositoryAdmin) action.getRemoteRepositoryAdmin() ).setArchivaConfiguration(
|
( (DefaultRemoteRepositoryAdmin) action.getRemoteRepositoryAdmin() ).setArchivaConfiguration(
|
||||||
archivaConfiguration );
|
archivaConfiguration );
|
||||||
( (DefaultProxyConnectorAdmin) action.getProxyConnectorAdmin() ).setArchivaConfiguration( archivaConfiguration );
|
( (DefaultProxyConnectorAdmin) action.getProxyConnectorAdmin() ).setArchivaConfiguration(
|
||||||
|
archivaConfiguration );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSecureActionBundle()
|
public void testSecureActionBundle()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
expectConfigurationRequests( 4 );
|
expectConfigurationRequests( 5 );
|
||||||
archivaConfigurationControl.replay();
|
archivaConfigurationControl.replay();
|
||||||
|
|
||||||
action.prepare();
|
action.prepare();
|
||||||
|
@ -108,11 +108,8 @@ public class ProxyConnectorsActionTest
|
||||||
{
|
{
|
||||||
Configuration config = createInitialConfiguration();
|
Configuration config = createInitialConfiguration();
|
||||||
|
|
||||||
for ( int i = 0; i < requestConfigCount; i++ )
|
|
||||||
{
|
|
||||||
archivaConfiguration.getConfiguration();
|
archivaConfiguration.getConfiguration();
|
||||||
archivaConfigurationControl.setReturnValue( config );
|
archivaConfigurationControl.setReturnValue( config, requestConfigCount + 1 );
|
||||||
}
|
|
||||||
|
|
||||||
archivaConfiguration.save( config );
|
archivaConfiguration.save( config );
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,6 @@ import org.apache.archiva.configuration.ArchivaConfiguration;
|
||||||
import org.apache.archiva.configuration.Configuration;
|
import org.apache.archiva.configuration.Configuration;
|
||||||
import org.apache.archiva.web.action.AbstractActionTestCase;
|
import org.apache.archiva.web.action.AbstractActionTestCase;
|
||||||
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
|
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
|
||||||
import org.codehaus.redback.integration.interceptor.SecureActionException;
|
|
||||||
import org.easymock.MockControl;
|
import org.easymock.MockControl;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -95,12 +94,12 @@ public class AddRemoteRepositoryActionTest
|
||||||
{
|
{
|
||||||
Configuration configuration = new Configuration();
|
Configuration configuration = new Configuration();
|
||||||
archivaConfiguration.getConfiguration();
|
archivaConfiguration.getConfiguration();
|
||||||
archivaConfigurationControl.setReturnValue( configuration );
|
archivaConfigurationControl.setReturnValue( configuration, 2 );
|
||||||
|
|
||||||
archivaConfiguration.save( configuration );
|
archivaConfiguration.save( configuration );
|
||||||
|
|
||||||
archivaConfiguration.getConfiguration();
|
archivaConfiguration.getConfiguration();
|
||||||
archivaConfigurationControl.setReturnValue( configuration );
|
archivaConfigurationControl.setReturnValue( configuration, 1 );
|
||||||
|
|
||||||
archivaConfigurationControl.replay();
|
archivaConfigurationControl.replay();
|
||||||
|
|
||||||
|
|
|
@ -73,10 +73,7 @@ public class DeleteRemoteRepositoryActionTest
|
||||||
Configuration configuration = createConfigurationForEditing( originalRepository );
|
Configuration configuration = createConfigurationForEditing( originalRepository );
|
||||||
|
|
||||||
archivaConfiguration.getConfiguration();
|
archivaConfiguration.getConfiguration();
|
||||||
archivaConfigurationControl.setReturnValue( configuration );
|
archivaConfigurationControl.setReturnValue( configuration, 3, 4 );
|
||||||
|
|
||||||
archivaConfiguration.getConfiguration();
|
|
||||||
archivaConfigurationControl.setReturnValue( configuration );
|
|
||||||
|
|
||||||
archivaConfigurationControl.replay();
|
archivaConfigurationControl.replay();
|
||||||
|
|
||||||
|
@ -134,7 +131,7 @@ public class DeleteRemoteRepositoryActionTest
|
||||||
Configuration configuration = createConfigurationForEditing( originalRepository );
|
Configuration configuration = createConfigurationForEditing( originalRepository );
|
||||||
|
|
||||||
archivaConfiguration.getConfiguration();
|
archivaConfiguration.getConfiguration();
|
||||||
archivaConfigurationControl.setReturnValue( configuration, 2 );
|
archivaConfigurationControl.setReturnValue( configuration, 4 );
|
||||||
|
|
||||||
archivaConfiguration.save( configuration );
|
archivaConfiguration.save( configuration );
|
||||||
archivaConfigurationControl.replay();
|
archivaConfigurationControl.replay();
|
||||||
|
|
Loading…
Reference in New Issue