Search in sources :

Example 11 with MemoryStoreDataManager

use of org.commonjava.indy.mem.data.MemoryStoreDataManager in project indy by Commonjava.

the class DownloadManagerTest method setupTest.

@Before
public void setupTest() throws Exception {
    data = new MemoryStoreDataManager(true);
    WeftExecutorService rescanService = new PoolWeftExecutorService("test-rescan-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    downloader = new DefaultDownloadManager(data, fixture.getTransferManager(), new IndyLocationExpander(data), null, new NoOpNotFoundCache(), rescanService);
}
Also used : PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) WeftExecutorService(org.commonjava.cdi.util.weft.WeftExecutorService) PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) NoOpNotFoundCache(org.commonjava.maven.galley.nfc.NoOpNotFoundCache) Before(org.junit.Before)

Example 12 with MemoryStoreDataManager

use of org.commonjava.indy.mem.data.MemoryStoreDataManager in project indy by Commonjava.

the class ImpliedRepositoryDetectorTest method setup.

@Before
public void setup() throws Throwable {
    fixture = new GalleyMavenFixture(temp);
    fixture.initGalley();
    fixture.withEnabledTransports(new HttpClientTransport(new HttpImpl(new MemoryPasswordManager())));
    fixture.before();
    storeManager = new MemoryStoreDataManager(true);
    metadataManager = new ImpliedRepoMetadataManager(new IndyObjectMapper(true));
    final ImpliedRepoConfig config = new ImpliedRepoConfig();
    config.setEnabled(true);
    config.addEnabledGroupNamePattern(".*");
    File rootDir = temp.newFolder("indy.root");
    final DataFileManager dataFiles = new DataFileManager(rootDir, new DataFileEventManager());
    validator = new ArtifactStoreValidator(fixture.getTransferManager());
    final IndyObjectMapper mapper = new IndyObjectMapper(Collections.emptySet());
    ScriptEngine engine = new ScriptEngine(dataFiles);
    detector = new TestImpliedRepositoryDetector(fixture.getPomReader(), storeManager, metadataManager, validator, engine, config, mapper);
    summary = new ChangeSummary(ChangeSummary.SYSTEM_USER, "test setup");
    RemoteRepository remote = new RemoteRepository("test", "http://www.foo.com/repo");
    Group group = new Group("group", remote.getKey());
    storeManager.storeArtifactStore(remote, summary, false, true, new EventMetadata());
    storeManager.storeArtifactStore(group, summary, false, true, new EventMetadata());
    server.expect("HEAD", server.formatUrl("/repo/"), 200, "");
}
Also used : Group(org.commonjava.indy.model.core.Group) ArtifactStoreValidator(org.commonjava.indy.data.ArtifactStoreValidator) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) ImpliedRepoMetadataManager(org.commonjava.indy.implrepo.data.ImpliedRepoMetadataManager) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) GalleyMavenFixture(org.commonjava.maven.galley.testing.maven.GalleyMavenFixture) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) ScriptEngine(org.commonjava.indy.subsys.template.ScriptEngine) EventMetadata(org.commonjava.maven.galley.event.EventMetadata) HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) ImpliedRepoConfig(org.commonjava.indy.implrepo.conf.ImpliedRepoConfig) ChangeSummary(org.commonjava.indy.audit.ChangeSummary) File(java.io.File) Before(org.junit.Before)

Example 13 with MemoryStoreDataManager

use of org.commonjava.indy.mem.data.MemoryStoreDataManager in project indy by Commonjava.

the class ImpliedRepoMaintainerTest method setup.

@Before
public void setup() {
    storeDataManager = new MemoryStoreDataManager(true);
    metadataManager = new ImpliedRepoMetadataManager(new IndyObjectMapper(true));
    final ImpliedRepoConfig config = new ImpliedRepoConfig();
    config.setEnabled(true);
    maintainer = new ImpliedRepoMaintainer(storeDataManager, metadataManager, config);
    summary = new ChangeSummary(ChangeSummary.SYSTEM_USER, "test setup");
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) ImpliedRepoMetadataManager(org.commonjava.indy.implrepo.data.ImpliedRepoMetadataManager) ImpliedRepoConfig(org.commonjava.indy.implrepo.conf.ImpliedRepoConfig) ChangeSummary(org.commonjava.indy.audit.ChangeSummary) Before(org.junit.Before)

Aggregations

MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)13 Before (org.junit.Before)10 PoolWeftExecutorService (org.commonjava.cdi.util.weft.PoolWeftExecutorService)8 WeftExecutorService (org.commonjava.cdi.util.weft.WeftExecutorService)8 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)8 DefaultDownloadManager (org.commonjava.indy.core.content.DefaultDownloadManager)7 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)7 IndyLocationExpander (org.commonjava.indy.content.IndyLocationExpander)6 DefaultDirectContentAccess (org.commonjava.indy.core.content.DefaultDirectContentAccess)6 DefaultIndyConfiguration (org.commonjava.indy.conf.DefaultIndyConfiguration)5 DirectContentAccess (org.commonjava.indy.content.DirectContentAccess)5 DownloadManager (org.commonjava.indy.content.DownloadManager)5 ExpiringMemoryNotFoundCache (org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache)5 DataFileManager (org.commonjava.indy.subsys.datafile.DataFileManager)5 DataFileEventManager (org.commonjava.indy.subsys.datafile.change.DataFileEventManager)5 SpecialPathManagerImpl (org.commonjava.maven.galley.io.SpecialPathManagerImpl)5 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)4 ContentDigester (org.commonjava.indy.content.ContentDigester)4 DefaultContentDigester (org.commonjava.indy.core.content.DefaultContentDigester)4 GStringTemplateEngine (groovy.text.GStringTemplateEngine)3