Search in sources :

Example 1 with RepositoryCopyProgressListener

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;
}
Also used : CopyProgressEvent(org.apache.ivy.util.CopyProgressEvent) FileRepository(org.apache.ivy.plugins.repository.file.FileRepository) RepositoryCopyProgressListener(org.apache.ivy.plugins.repository.RepositoryCopyProgressListener) FileSystemResolver(org.apache.ivy.plugins.resolver.FileSystemResolver)

Aggregations

RepositoryCopyProgressListener (org.apache.ivy.plugins.repository.RepositoryCopyProgressListener)1 FileRepository (org.apache.ivy.plugins.repository.file.FileRepository)1 FileSystemResolver (org.apache.ivy.plugins.resolver.FileSystemResolver)1 CopyProgressEvent (org.apache.ivy.util.CopyProgressEvent)1