Search in sources :

Example 1 with GalleyMavenBuilder

use of org.commonjava.maven.galley.maven.GalleyMavenBuilder in project galley by Commonjava.

the class GalleyMavenFixture method initGalley.

public void initGalley() throws IOException {
    if (temp == null) {
        temp = new TemporaryFolder();
    }
    temp.create();
    if (cacheDir == null) {
        cacheDir = temp.newFolder("cache");
    }
    mavenBuilder = new GalleyMavenBuilder();
    mavenBuilder.withCacheProviderFactory(new FileCacheProviderFactory(cacheDir));
}
Also used : GalleyMavenBuilder(org.commonjava.maven.galley.maven.GalleyMavenBuilder) TemporaryFolder(org.junit.rules.TemporaryFolder) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory)

Example 2 with GalleyMavenBuilder

use of org.commonjava.maven.galley.maven.GalleyMavenBuilder in project indy by Commonjava.

the class AutoProxDataManagerDecoratorTest method setup.

@Before
public final void setup() throws Exception {
    rootDir = temp.newFolder("indy.root");
    autoproxDataDir = new File(rootDir, "data/autoprox");
    autoproxDataDir.mkdirs();
    File cacheDir = temp.newFolder();
    FileCacheProvider cache = new FileCacheProvider(cacheDir, new HashedLocationPathGenerator(), new NoOpFileEventManager(), new NoOpTransferDecorator());
    galley = new GalleyMavenBuilder(cache).withEnabledTransports(new HttpClientTransport(new HttpImpl(new MemoryPasswordManager()))).build();
    final DataFileManager dataFiles = new DataFileManager(rootDir, new DataFileEventManager());
    ruleParser = new ScriptRuleParser(new ScriptEngine(dataFiles));
    final AutoProxConfig indyConfig = new AutoProxConfig(autoproxDataDir.getName(), true);
    catalog = new AutoProxCatalogManager(dataFiles, indyConfig, ruleParser);
    storeDataManager = new TestAutoProxyDataManager(catalog, galley.getTransferManager());
    storeDataManager.install();
    storeDataManager.clear(summary);
    storeQuery = storeDataManager.query().packageType(MAVEN_PKG_KEY);
    System.setProperty("baseUrl", http.getBaseUri());
}
Also used : FileCacheProvider(org.commonjava.maven.galley.cache.FileCacheProvider) NoOpTransferDecorator(org.commonjava.maven.galley.io.NoOpTransferDecorator) HashedLocationPathGenerator(org.commonjava.maven.galley.io.HashedLocationPathGenerator) AutoProxConfig(org.commonjava.indy.autoprox.conf.AutoProxConfig) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) ScriptEngine(org.commonjava.indy.subsys.template.ScriptEngine) NoOpFileEventManager(org.commonjava.maven.galley.event.NoOpFileEventManager) GalleyMavenBuilder(org.commonjava.maven.galley.maven.GalleyMavenBuilder) HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) ScriptRuleParser(org.commonjava.indy.autoprox.util.ScriptRuleParser) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) TestAutoProxyDataManager(org.commonjava.indy.autoprox.fixture.TestAutoProxyDataManager) File(java.io.File) Before(org.junit.Before)

Aggregations

GalleyMavenBuilder (org.commonjava.maven.galley.maven.GalleyMavenBuilder)2 File (java.io.File)1 AutoProxConfig (org.commonjava.indy.autoprox.conf.AutoProxConfig)1 TestAutoProxyDataManager (org.commonjava.indy.autoprox.fixture.TestAutoProxyDataManager)1 ScriptRuleParser (org.commonjava.indy.autoprox.util.ScriptRuleParser)1 DataFileManager (org.commonjava.indy.subsys.datafile.DataFileManager)1 DataFileEventManager (org.commonjava.indy.subsys.datafile.change.DataFileEventManager)1 ScriptEngine (org.commonjava.indy.subsys.template.ScriptEngine)1 MemoryPasswordManager (org.commonjava.maven.galley.auth.MemoryPasswordManager)1 FileCacheProvider (org.commonjava.maven.galley.cache.FileCacheProvider)1 FileCacheProviderFactory (org.commonjava.maven.galley.cache.FileCacheProviderFactory)1 NoOpFileEventManager (org.commonjava.maven.galley.event.NoOpFileEventManager)1 HashedLocationPathGenerator (org.commonjava.maven.galley.io.HashedLocationPathGenerator)1 NoOpTransferDecorator (org.commonjava.maven.galley.io.NoOpTransferDecorator)1 HttpClientTransport (org.commonjava.maven.galley.transport.htcli.HttpClientTransport)1 HttpImpl (org.commonjava.maven.galley.transport.htcli.HttpImpl)1 Before (org.junit.Before)1 TemporaryFolder (org.junit.rules.TemporaryFolder)1