Search in sources :

Example 1 with PackageMetadataMerger

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));
}
Also used : StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) TypeMapper(org.commonjava.maven.galley.maven.spi.type.TypeMapper) PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory) ExpiringMemoryNotFoundCache(org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) ExpiringMemoryNotFoundCache(org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache) DownloadManager(org.commonjava.indy.content.DownloadManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) SpecialPathManagerImpl(org.commonjava.maven.galley.io.SpecialPathManagerImpl) PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) WeftExecutorService(org.commonjava.cdi.util.weft.WeftExecutorService) LocationExpander(org.commonjava.maven.galley.spi.transport.LocationExpander) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyPathGenerator(org.commonjava.indy.content.IndyPathGenerator) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) PackageMetadataMerger(org.commonjava.indy.pkg.npm.content.group.PackageMetadataMerger) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) GroupMergeHelper(org.commonjava.indy.core.content.group.GroupMergeHelper) Before(org.junit.Before)

Aggregations

PoolWeftExecutorService (org.commonjava.cdi.util.weft.PoolWeftExecutorService)1 WeftExecutorService (org.commonjava.cdi.util.weft.WeftExecutorService)1 DefaultIndyConfiguration (org.commonjava.indy.conf.DefaultIndyConfiguration)1 DownloadManager (org.commonjava.indy.content.DownloadManager)1 IndyLocationExpander (org.commonjava.indy.content.IndyLocationExpander)1 IndyPathGenerator (org.commonjava.indy.content.IndyPathGenerator)1 DefaultDirectContentAccess (org.commonjava.indy.core.content.DefaultDirectContentAccess)1 DefaultDownloadManager (org.commonjava.indy.core.content.DefaultDownloadManager)1 GroupMergeHelper (org.commonjava.indy.core.content.group.GroupMergeHelper)1 ExpiringMemoryNotFoundCache (org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache)1 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)1 PackageMetadataMerger (org.commonjava.indy.pkg.npm.content.group.PackageMetadataMerger)1 GalleyCoreBuilder (org.commonjava.maven.galley.GalleyCoreBuilder)1 FileCacheProviderFactory (org.commonjava.maven.galley.cache.FileCacheProviderFactory)1 SpecialPathManagerImpl (org.commonjava.maven.galley.io.SpecialPathManagerImpl)1 StandardTypeMapper (org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper)1 TypeMapper (org.commonjava.maven.galley.maven.spi.type.TypeMapper)1 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)1 LocationExpander (org.commonjava.maven.galley.spi.transport.LocationExpander)1 Before (org.junit.Before)1