use of ddf.catalog.resource.download.ReliableResourceDownloaderConfig in project ddf by codice.
the class DownloadsStatusEventListenerTest method setUp.
@BeforeClass
public static void setUp() {
ReliableResourceDownloaderConfig downloaderConfig = new ReliableResourceDownloaderConfig();
testDownloadStatusInfo = new DownloadStatusInfoImpl();
hcInstanceFactory = new TestHazelcastInstanceFactory(10);
ResourceCacheImpl testResourceCache = new ResourceCacheImpl();
testResourceCache.setCache(hcInstanceFactory.newHazelcastInstance());
productCacheDir = System.getProperty("user.dir") + "/target" + File.separator + ResourceCacheImpl.DEFAULT_PRODUCT_CACHE_DIRECTORY;
testResourceCache.setProductCacheDirectory(productCacheDir);
DownloadsStatusEventPublisher testEventPublisher = mock(DownloadsStatusEventPublisher.class);
testEventListener = new DownloadsStatusEventListener();
downloaderConfig.setResourceCache(testResourceCache);
downloaderConfig.setEventPublisher(testEventPublisher);
downloaderConfig.setEventListener(testEventListener);
testDownloadManager = new ReliableResourceDownloadManager(downloaderConfig, testDownloadStatusInfo, Executors.newSingleThreadExecutor());
testDownloadManager.setMaxRetryAttempts(1);
testDownloadManager.setDelayBetweenAttempts(0);
testDownloadManager.setMonitorPeriod(5);
}
Aggregations