use of org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration in project galley by Commonjava.
the class DownloadHandlerConcurrencyTest method before.
@Before
public void before() throws IOException {
executor = Executors.newCachedThreadPool();
cacheProvider = new FileCacheProvider(temp.newFolder(), new HashedLocationPathGenerator(), new NoOpFileEventManager(), new NoOpTransferDecorator(), false);
transport = new HttpClientTransport(new HttpImpl(new MemoryPasswordManager()), new ObjectMapper(), new GlobalHttpConfiguration());
}
use of org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration in project indy by Commonjava.
the class TestProvider method setup.
@PostConstruct
public void setup() {
storeDataManager = new MemoryStoreDataManager(true);
nfc = new MemoryNotFoundCache();
objectMapper = new IndyObjectMapper(false);
fileEventManager = new NoOpFileEventManager();
transferDecorator = new NoOpTransferDecorator();
transportManagerConfig = new TransportManagerConfig();
weftConfig = new DefaultWeftConfig();
globalHttpConfiguration = new GlobalHttpConfiguration();
userLifecycleManager = new AlternativeUserLifecycleManager();
temp = new TemporaryFolder();
try {
temp.create();
cacheProvider = new FileCacheProvider(temp.newFolder("storage"), indyPathGenerator, fileEventManager, new TransferDecoratorManager(transferDecorator));
} catch (IOException e) {
fail("Cannot initialize temporary directory structure");
temp.delete();
}
}
use of org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration in project galley by Commonjava.
the class TestCDIProvider method start.
@PostConstruct
public void start() {
try {
temp.create();
cacheProvider = new PartyLineCacheProvider(temp.newFolder(), pathGenerator, eventManager, transferDecorator);
fileTransportConfig = new FileTransportConfig(temp.newFolder(), pathGenerator);
} catch (IOException e) {
Assert.fail("Failed to init temp folder fro file cache.");
}
locationExpander = new NoOpLocationExpander();
locationResolver = new SimpleUrlLocationResolver(locationExpander, transportManager);
globalHttpConfiguration = new GlobalHttpConfiguration();
weftConfig = new DefaultWeftConfig();
}
use of org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration in project indy by Commonjava.
the class KojiMavenMetadataProviderTest method initKojiClient.
private void initKojiClient(String exchangeName, boolean verifyArtifacts) throws IOException, GalleyInitException, IndyDataException, KojiClientException {
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(), null, null)).build();
WeftExecutorService rescanService = new PoolWeftExecutorService("test-rescan-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
DownloadManager downloadManager = new DefaultDownloadManager(storeDataManager, galley.getTransferManager(), new IndyLocationExpander(storeDataManager), rescanService);
WeftExecutorService contentAccessService = new PoolWeftExecutorService("test-content-access-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
DirectContentAccess directContentAccess = new DefaultDirectContentAccess(downloadManager, contentAccessService);
DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, contentAccessService);
ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
KojiBuildAuthority buildAuthority = new KojiBuildAuthority(kojiConfig, new StandardTypeMapper(), kojiClient, storeDataManager, contentDigester, directContentAccess, cacheManager);
WeftExecutorService kojiMDService = new PoolWeftExecutorService("test-koji-metadata-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
provider = new KojiMavenMetadataProvider(this.cache, kojiClient, buildAuthority, kojiConfig, kojiMDService, cacheManager);
}
Aggregations