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());
}
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();
}
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);
}
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);
}
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));
}
Aggregations