<redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
<basedir>${basedir}</basedir>
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
+ <buildDirectory>${project.build.directory}</buildDirectory>
</systemPropertyVariables>
</configuration>
</plugin>
import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.configuration.Configuration;
+import org.apache.archiva.redback.integration.interceptor.SecureActionBundle;
+import org.apache.archiva.redback.integration.interceptor.SecureActionException;
import org.apache.archiva.redback.role.RoleManager;
import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
import org.apache.archiva.scheduler.repository.RepositoryTask;
import org.apache.archiva.security.common.ArchivaRoleConstants;
import org.apache.archiva.web.validator.utils.ValidatorUtil;
import org.apache.commons.io.FileUtils;
-import org.apache.archiva.redback.integration.interceptor.SecureActionBundle;
-import org.apache.archiva.redback.integration.interceptor.SecureActionException;
import org.easymock.MockControl;
import org.easymock.classextension.MockClassControl;
repositoryTaskSchedulerControl = MockClassControl.createControl( RepositoryArchivaTaskScheduler.class );
repositoryTaskScheduler = (RepositoryArchivaTaskScheduler) repositoryTaskSchedulerControl.getMock();
- location = new File( "target/test/location" );
+ location = new File( System.getProperty( "basedir" ), "target/test/location" );
( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setArchivaConfiguration( archivaConfiguration );
( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setRoleManager( roleManager );
( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setRegistry( registry );
import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
import org.apache.archiva.audit.AuditEvent;
import org.apache.archiva.audit.AuditListener;
-import org.apache.archiva.metadata.repository.MetadataRepository;
-import org.apache.archiva.metadata.repository.RepositorySession;
-import org.apache.archiva.security.common.ArchivaRoleConstants;
-import org.apache.archiva.webtest.memory.TestRepositorySessionFactory;
-import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager;
import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.configuration.Configuration;
import org.apache.archiva.configuration.IndeterminateConfigurationException;
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
import org.apache.archiva.configuration.RepositoryGroupConfiguration;
-import org.apache.archiva.web.action.AbstractActionTestCase;
-import org.apache.archiva.web.action.AuditEventArgumentsMatcher;
-import org.apache.archiva.redback.role.RoleManager;
-import org.apache.archiva.redback.role.RoleManagerException;
+import org.apache.archiva.metadata.repository.MetadataRepository;
+import org.apache.archiva.metadata.repository.RepositorySession;
+import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager;
import org.apache.archiva.redback.components.registry.RegistryException;
import org.apache.archiva.redback.integration.interceptor.SecureActionBundle;
import org.apache.archiva.redback.integration.interceptor.SecureActionException;
+import org.apache.archiva.redback.role.RoleManager;
+import org.apache.archiva.redback.role.RoleManagerException;
+import org.apache.archiva.security.common.ArchivaRoleConstants;
+import org.apache.archiva.web.action.AbstractActionTestCase;
+import org.apache.archiva.web.action.AuditEventArgumentsMatcher;
+import org.apache.archiva.webtest.memory.TestRepositorySessionFactory;
import org.easymock.MockControl;
import java.io.File;
roleManagerControl = MockControl.createControl( RoleManager.class );
roleManager = (RoleManager) roleManagerControl.getMock();
//action.setRoleManager( roleManager );
- location = new File( "target/test/location" );
+ location = new File( System.getProperty( "basedir" ), "target/test/location" );
repositoryStatisticsManagerControl = MockControl.createControl( RepositoryStatisticsManager.class );
repositoryStatisticsManager = (RepositoryStatisticsManager) repositoryStatisticsManagerControl.getMock();
stageRepoConfiguration.addManagedRepository( createStagingRepository() );
archivaConfigurationControl.setReturnValue( stageRepoConfiguration );
-
archivaConfiguration.getConfiguration();
archivaConfigurationControl.setReturnValue( configuration );
-
archivaConfigurationControl.replay();
action.setRepoid( REPO_ID );
import org.apache.archiva.metadata.repository.MetadataRepository;
import org.apache.archiva.metadata.repository.RepositorySession;
import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager;
+import org.apache.archiva.redback.integration.interceptor.SecureActionBundle;
+import org.apache.archiva.redback.integration.interceptor.SecureActionException;
+import org.apache.archiva.redback.role.RoleManager;
import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
import org.apache.archiva.scheduler.repository.RepositoryTask;
import org.apache.archiva.security.common.ArchivaRoleConstants;
import org.apache.archiva.web.validator.utils.ValidatorUtil;
import org.apache.archiva.webtest.memory.TestRepositorySessionFactory;
import org.apache.commons.io.FileUtils;
-import org.apache.archiva.redback.role.RoleManager;
-import org.apache.archiva.redback.integration.interceptor.SecureActionBundle;
-import org.apache.archiva.redback.integration.interceptor.SecureActionException;
import org.easymock.MockControl;
import org.easymock.classextension.MockClassControl;
(RepositoryStatisticsManager) repositoryStatisticsManagerControl.getMock();
( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setRepositoryStatisticsManager(
repositoryStatisticsManager );
- // no deletion
+ repositoryStatisticsManager.deleteStatistics( metadataRepository , REPO_ID );
+ repositoryStatisticsManagerControl.setVoidCallable();
repositoryStatisticsManagerControl.replay();
new File( "target/test/" + REPO_ID + "-stage" ).mkdirs();
+ repository.setLocation( System.getProperty( "basedir" ) + "/target/test/" + REPO_ID );
+
action.setRepository( repository );
action.setStageNeeded( true );
String status = action.commit();
throws IOException
{
ManagedRepository r = new ManagedRepository();
+ r.setLocation( System.getProperty( "basedir" ) + "/target/repo-" + REPO_ID );
+ r.setIndexDirectory( System.getProperty( "basedir" ) + "/target/repo-" + REPO_ID + "-index" );
r.setId( REPO_ID );
populateRepository( r );
return r;
{
ManagedRepositoryConfiguration r = new ManagedRepositoryConfiguration();
r.setId( REPO_ID + "-stage" );
+ r.setLocation( System.getProperty( "basedir" ) + "/target/" + REPO_ID + "-stage" );
populateStagingRepository( r );
return r;
}