]> source.dussan.org Git - archiva.git/commitdiff
fix junit due to ArrayList init mock call number changed
authorOlivier Lamy <olamy@apache.org>
Mon, 9 Jan 2012 21:46:07 +0000 (21:46 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 9 Jan 2012 21:46:07 +0000 (21:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1229366 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/admin/connectors/proxy/ProxyConnectorsActionTest.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java

index 504d9d38bcc43bd1ed43712cf84bb38511804421..824779b1a01206ec94b32e369a38b9bc50b3448c 100644 (file)
@@ -400,13 +400,8 @@ public class AddProxyConnectorActionTest
         throws RegistryException, IndeterminateConfigurationException
     {
         Configuration config = createInitialConfiguration();
-
-        for ( int i = 0; i < requestConfigCount; i++ )
-        {
-            archivaConfiguration.getConfiguration();
-            archivaConfigurationControl.setReturnValue( config );
-        }
-
+        archivaConfiguration.getConfiguration();
+        archivaConfigurationControl.setReturnValue( config, requestConfigCount, requestConfigCount + 1 );
         archivaConfiguration.save( config );
     }
 
index 12adeb4983f4f24c054fb82277ad40a5d30fa4cb..b4f4939ed65b3497766c5baaba4bd7754c334863 100644 (file)
@@ -20,7 +20,6 @@ package org.apache.archiva.web.action.admin.connectors.proxy;
  */
 
 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;
@@ -31,12 +30,12 @@ import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
 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$
  */
@@ -61,7 +60,7 @@ public class ProxyConnectorsActionTest
     {
         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();
@@ -69,13 +68,14 @@ public class ProxyConnectorsActionTest
             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();
@@ -95,7 +95,7 @@ public class ProxyConnectorsActionTest
         String status = action.execute();
         assertEquals( Action.SUCCESS, status );
         assertNoErrors( action );
-        
+
         assertNotNull( action.getProxyConnectorMap() );
         assertNotNull( action.getRepoMap() );
 
@@ -108,11 +108,8 @@ public class ProxyConnectorsActionTest
     {
         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 );
     }
index ef349167556ceb5f8aa957719ea89176a4370eae..ff2f07bc2d620ef5099a372b2b9f8077771a9096 100644 (file)
@@ -26,7 +26,6 @@ import org.apache.archiva.configuration.ArchivaConfiguration;
 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;
@@ -95,12 +94,12 @@ public class AddRemoteRepositoryActionTest
     {
         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();
 
index d4e87195e161bd57eee87a7876e2d036cf07e327..0e3bfdb2b97a3d4778f61c39f5f03dfaebbaa584 100644 (file)
@@ -73,10 +73,7 @@ public class DeleteRemoteRepositoryActionTest
         Configuration configuration = createConfigurationForEditing( originalRepository );
 
         archivaConfiguration.getConfiguration();
-        archivaConfigurationControl.setReturnValue( configuration );
-
-        archivaConfiguration.getConfiguration();
-        archivaConfigurationControl.setReturnValue( configuration );
+        archivaConfigurationControl.setReturnValue( configuration, 3, 4 );
 
         archivaConfigurationControl.replay();
 
@@ -134,7 +131,7 @@ public class DeleteRemoteRepositoryActionTest
         Configuration configuration = createConfigurationForEditing( originalRepository );
 
         archivaConfiguration.getConfiguration();
-        archivaConfigurationControl.setReturnValue( configuration, 2 );
+        archivaConfigurationControl.setReturnValue( configuration, 4 );
 
         archivaConfiguration.save( configuration );
         archivaConfigurationControl.replay();