use of org.apache.ivy.plugins.repository.RepositoryCopyProgressListener in project ant-ivy by apache.
the class ArtifactLockStrategyTest method createSlowResolver.
private FileSystemResolver createSlowResolver(IvySettings settings, final int sleep) {
FileSystemResolver resolver = new FileSystemResolver();
resolver.setRepositoryCacheManager(newCacheManager(settings));
resolver.setRepository(new FileRepository() {
private RepositoryCopyProgressListener progress = new RepositoryCopyProgressListener(this) {
public void progress(CopyProgressEvent evt) {
super.progress(evt);
// makes the file copy longer to test concurrency issues
sleepSilently(sleep);
}
};
protected RepositoryCopyProgressListener getProgressListener() {
return progress;
}
});
resolver.setName("test");
resolver.setSettings(settings);
resolver.addIvyPattern(settings.getBaseDir() + "/test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]");
resolver.addArtifactPattern(settings.getBaseDir() + "/test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]");
return resolver;
}
Aggregations