use of org.commonjava.indy.pkg.npm.content.group.PackageMetadataMerger in project indy by Commonjava.
the class PackageMetadataGeneratorTest method setup.
@Before
public void setup() throws Exception {
stores = new MemoryStoreDataManager(true);
core = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).build();
final DefaultIndyConfiguration config = new DefaultIndyConfiguration();
config.setNotFoundCacheTimeoutSeconds(1);
final ExpiringMemoryNotFoundCache nfc = new ExpiringMemoryNotFoundCache(config);
WeftExecutorService rescanService = new PoolWeftExecutorService("test-rescan-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
final LocationExpander locations = new IndyLocationExpander(stores);
final PackageMetadataMerger merger = new PackageMetadataMerger();
final TypeMapper types = new StandardTypeMapper();
final DownloadManager downloads = new DefaultDownloadManager(stores, core.getTransferManager(), locations, null, nfc, rescanService);
WeftExecutorService contentAccessService = new PoolWeftExecutorService("test-content-access-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
DefaultDirectContentAccess contentAccess = new DefaultDirectContentAccess(downloads, contentAccessService);
final GroupMergeHelper helper = new GroupMergeHelper(downloads);
specialPathManager = new SpecialPathManagerImpl();
fileManager = new DefaultDownloadManager(stores, core.getTransferManager(), core.getLocationExpander(), rescanService);
generator = new PackageMetadataGenerator(contentAccess, stores, downloads, types, merger, helper, new MemoryNotFoundCache(), new IndyPathGenerator(Collections.singleton(new NPMStoragePathCalculator(specialPathManager))), new NPMStoragePathCalculator(specialPathManager));
}
Aggregations