fix unit test when executing all : an other unit tests set a mock in the singleton component

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1163922 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-09-01 07:04:39 +00:00
parent 75b97f7c21
commit f42244015e
1 changed files with 8 additions and 5 deletions

View File

@ -21,6 +21,7 @@ package org.apache.maven.archiva.web.action.admin.repositories;
import com.opensymphony.xwork2.Action;
import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
import org.apache.archiva.audit.AuditListener;
import org.apache.archiva.metadata.repository.MetadataRepository;
import org.apache.archiva.metadata.repository.RepositorySession;
import org.apache.archiva.metadata.repository.memory.TestRepositorySessionFactory;
@ -43,7 +44,6 @@ import org.easymock.classextension.MockClassControl;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -117,7 +117,12 @@ public class EditManagedRepositoryActionTest
( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setRepositoryTaskScheduler(
repositoryTaskScheduler );
( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setRepositorySessionFactory( factory );
( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setAuditListeners(
new ArrayList<AuditListener>( 0 ) );
action.setManagedRepositoryAdmin( getManagedRepositoryAdmin() );
}
public void testSecureActionBundle()
@ -178,7 +183,6 @@ public class EditManagedRepositoryActionTest
roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, REPO_ID );
roleManagerControl.setVoidCallable();
roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, stageRepoId );
roleManagerControl.setReturnValue( false );
roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, stageRepoId );
@ -189,7 +193,6 @@ public class EditManagedRepositoryActionTest
roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, stageRepoId );
roleManagerControl.setVoidCallable();
roleManagerControl.replay();
registry.getString( "appserver.base", "${appserver.base}" );