Search in sources :

Example 1 with IndyLocationExpander

use of org.commonjava.indy.content.IndyLocationExpander in project indy by Commonjava.

the class MavenMetadataGeneratorTest method setup.

@Before
public void setup() throws Exception {
    stores = new MemoryStoreDataManager(true);
    final LocationExpander locations = new IndyLocationExpander(stores);
    final DownloadManager downloads = new DefaultDownloadManager(stores, fixture.getTransferManager(), locations);
    final XMLInfrastructure xml = new XMLInfrastructure();
    final TypeMapper types = new StandardTypeMapper();
    final MavenMetadataMerger merger = new MavenMetadataMerger(Collections.emptyList());
    final GroupMergeHelper helper = new GroupMergeHelper(downloads);
    DefaultDirectContentAccess contentAccess = new DefaultDirectContentAccess(downloads, Executors.newCachedThreadPool());
    generator = new MavenMetadataGenerator(contentAccess, stores, xml, types, merger, helper, new MemoryNotFoundCache());
    metadataReader = new MavenMetadataReader(xml, locations, fixture.getArtifactMetadataManager(), fixture.getXPathManager());
}
Also used : StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) TypeMapper(org.commonjava.maven.galley.maven.spi.type.TypeMapper) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) DownloadManager(org.commonjava.indy.content.DownloadManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) LocationExpander(org.commonjava.maven.galley.spi.transport.LocationExpander) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) MavenMetadataMerger(org.commonjava.indy.pkg.maven.content.group.MavenMetadataMerger) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) MavenMetadataReader(org.commonjava.maven.galley.maven.parse.MavenMetadataReader) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) GroupMergeHelper(org.commonjava.indy.core.content.group.GroupMergeHelper) Before(org.junit.Before)

Example 2 with IndyLocationExpander

use of org.commonjava.indy.content.IndyLocationExpander in project indy by Commonjava.

the class PromotionManagerTest method setup.

@Before
public void setup() throws Exception {
    contentMetadata.clear();
    galleyParts = new GalleyMavenFixture(true, temp);
    galleyParts.initMissingComponents();
    storeManager = new MemoryStoreDataManager(true);
    downloadManager = new DefaultDownloadManager(storeManager, galleyParts.getTransferManager(), new IndyLocationExpander(storeManager), new MockInstance<>(new MockContentAdvisor()));
    DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, Executors.newSingleThreadExecutor());
    ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
    contentManager = new DefaultContentManager(storeManager, downloadManager, new IndyObjectMapper(true), new SpecialPathManagerImpl(), new MemoryNotFoundCache(), contentDigester, Collections.<ContentGenerator>emptySet());
    dataManager = new DataFileManager(temp.newFolder("data"), new DataFileEventManager());
    validationsManager = new PromoteValidationsManager(dataManager, new PromoteConfig(), new ValidationRuleParser(new ScriptEngine(dataManager), new IndyObjectMapper(true)));
    MavenModelProcessor modelProcessor = new MavenModelProcessor();
    validator = new PromotionValidator(validationsManager, new PromotionValidationTools(contentManager, storeManager, galleyParts.getPomReader(), galleyParts.getMavenMetadataReader(), modelProcessor, galleyParts.getTypeMapper(), galleyParts.getTransferManager(), contentDigester), storeManager);
    PromoteConfig config = new PromoteConfig();
    manager = new PromotionManager(validator, contentManager, downloadManager, storeManager, config);
    executor = Executors.newCachedThreadPool();
}
Also used : ValidationRuleParser(org.commonjava.indy.promote.validate.ValidationRuleParser) GalleyMavenFixture(org.commonjava.maven.galley.testing.maven.GalleyMavenFixture) DefaultContentManager(org.commonjava.indy.core.content.DefaultContentManager) MavenModelProcessor(org.commonjava.maven.galley.maven.rel.MavenModelProcessor) SpecialPathManagerImpl(org.commonjava.maven.galley.io.SpecialPathManagerImpl) ContentGenerator(org.commonjava.indy.content.ContentGenerator) DirectContentAccess(org.commonjava.indy.content.DirectContentAccess) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) MockInstance(org.commonjava.indy.test.fixture.core.MockInstance) TransferMetadata(org.commonjava.maven.galley.io.checksum.TransferMetadata) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) PromotionValidator(org.commonjava.indy.promote.validate.PromotionValidator) ContentDigester(org.commonjava.indy.content.ContentDigester) DefaultContentDigester(org.commonjava.indy.core.content.DefaultContentDigester) PromotionValidationTools(org.commonjava.indy.promote.validate.PromotionValidationTools) DefaultContentDigester(org.commonjava.indy.core.content.DefaultContentDigester) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) PromoteConfig(org.commonjava.indy.promote.conf.PromoteConfig) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) ScriptEngine(org.commonjava.indy.subsys.template.ScriptEngine) PromoteValidationsManager(org.commonjava.indy.promote.validate.PromoteValidationsManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) MockContentAdvisor(org.commonjava.indy.test.fixture.core.MockContentAdvisor) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) Before(org.junit.Before)

Example 3 with IndyLocationExpander

use of org.commonjava.indy.content.IndyLocationExpander in project indy by Commonjava.

the class KojiMavenMetadataProviderTest method initKojiClient.

private void initKojiClient(String exchangeName, boolean verifyArtifacts) throws BindException, IOException, GalleyInitException, IndyDataException {
    StoreDataManager storeDataManager = new MemoryStoreDataManager(true);
    if (verifyArtifacts) {
        RemoteRepository verifyRepo = new RemoteRepository(MAVEN_PKG_KEY, VERIFY_REPO, server.formatUrl(VERIFY_BASEPATH));
        storeDataManager.storeArtifactStore(verifyRepo, new ChangeSummary(ChangeSummary.SYSTEM_USER, "Adding verification repo"), false, true, new EventMetadata());
        kojiConfig.setArtifactAuthorityStore(new StoreKey(MAVEN_PKG_KEY, remote, VERIFY_REPO).toString());
    }
    String resourceBase = "koji-metadata/" + exchangeName;
    configureKojiServer(server, KOJI_BASEPATH, counter, resourceBase, verifyArtifacts, VERIFY_BASEPATH);
    kojiClient = new KojiClient(kojiConfig, new MemoryPasswordManager(), Executors.newCachedThreadPool());
    GalleyCore galley = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).withEnabledTransports(new HttpClientTransport(new HttpImpl(new org.commonjava.maven.galley.auth.MemoryPasswordManager()), new IndyObjectMapper(true), new GlobalHttpConfiguration())).build();
    DownloadManager downloadManager = new DefaultDownloadManager(storeDataManager, galley.getTransferManager(), new IndyLocationExpander(storeDataManager));
    DirectContentAccess directContentAccess = new DefaultDirectContentAccess(downloadManager, Executors.newCachedThreadPool());
    DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, Executors.newSingleThreadExecutor());
    ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
    KojiBuildAuthority buildAuthority = new KojiBuildAuthority(kojiConfig, new StandardTypeMapper(), kojiClient, storeDataManager, contentDigester, directContentAccess);
    provider = new KojiMavenMetadataProvider(this.cache, kojiClient, buildAuthority, kojiConfig);
}
Also used : GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) DownloadManager(org.commonjava.indy.content.DownloadManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) EventMetadata(org.commonjava.maven.galley.event.EventMetadata) DirectContentAccess(org.commonjava.indy.content.DirectContentAccess) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) TransferMetadata(org.commonjava.maven.galley.io.checksum.TransferMetadata) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) StoreDataManager(org.commonjava.indy.data.StoreDataManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) ContentDigester(org.commonjava.indy.content.ContentDigester) DefaultContentDigester(org.commonjava.indy.core.content.DefaultContentDigester) GalleyCore(org.commonjava.maven.galley.GalleyCore) DefaultContentDigester(org.commonjava.indy.core.content.DefaultContentDigester) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory) MemoryPasswordManager(org.commonjava.util.jhttpc.auth.MemoryPasswordManager) StoreKey(org.commonjava.indy.model.core.StoreKey) HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) GlobalHttpConfiguration(org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration) ChangeSummary(org.commonjava.indy.audit.ChangeSummary) KojiClient(com.redhat.red.build.koji.KojiClient) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess)

Example 4 with IndyLocationExpander

use of org.commonjava.indy.content.IndyLocationExpander in project indy by Commonjava.

the class DefaultDownloadManagerTest method setup.

@Before
public void setup() throws IOException, GalleyInitException {
    core = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).build();
    storeManager = new MemoryStoreDataManager(true);
    LocationExpander locationExpander = new IndyLocationExpander(storeManager);
    downloadManager = new DefaultDownloadManager(storeManager, core.getTransferManager(), locationExpander);
}
Also used : IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) LocationExpander(org.commonjava.maven.galley.spi.transport.LocationExpander) GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory) Before(org.junit.Before)

Example 5 with IndyLocationExpander

use of org.commonjava.indy.content.IndyLocationExpander in project indy by Commonjava.

the class DownloadManagerTest method setupTest.

@Before
public void setupTest() throws Exception {
    data = new MemoryStoreDataManager(true);
    downloader = new DefaultDownloadManager(data, fixture.getTransferManager(), new IndyLocationExpander(data));
}
Also used : MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) Before(org.junit.Before)

Aggregations

IndyLocationExpander (org.commonjava.indy.content.IndyLocationExpander)5 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)5 DefaultDownloadManager (org.commonjava.indy.core.content.DefaultDownloadManager)4 Before (org.junit.Before)4 DefaultDirectContentAccess (org.commonjava.indy.core.content.DefaultDirectContentAccess)3 ContentDigester (org.commonjava.indy.content.ContentDigester)2 DirectContentAccess (org.commonjava.indy.content.DirectContentAccess)2 DownloadManager (org.commonjava.indy.content.DownloadManager)2 DefaultContentDigester (org.commonjava.indy.core.content.DefaultContentDigester)2 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)2 GalleyCoreBuilder (org.commonjava.maven.galley.GalleyCoreBuilder)2 FileCacheProviderFactory (org.commonjava.maven.galley.cache.FileCacheProviderFactory)2 TransferMetadata (org.commonjava.maven.galley.io.checksum.TransferMetadata)2 StandardTypeMapper (org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper)2 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)2 LocationExpander (org.commonjava.maven.galley.spi.transport.LocationExpander)2 KojiClient (com.redhat.red.build.koji.KojiClient)1 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)1 ContentGenerator (org.commonjava.indy.content.ContentGenerator)1 DefaultContentManager (org.commonjava.indy.core.content.DefaultContentManager)1